GetNetworkAutoUpdate {RNetica}R Documentation

Turns Netica automatic updating on or off for a network.

Description

Netica networks can either propagate the effects of new findings immediately, or they can delay propagation until the user queries the network. These functions toggle the switch that controls the autoupdate mechanism

Usage

GetNetworkAutoUpdate(net)
SetNetworkAutoUpdate(net, newautoupdate)
WithoutAutoUpdate(net,expr)

Arguments

net

A NeticaBN object to be queried or changed.

newautoupdate

A logical values, TRUE to turn automatic updating on. A value NA produces an error.

expr

An R expression to be evaluated with automatic updating turned off.

Details

Automatic updating means that queries operate very quickly, however, if a large number of finding are to be entered before the next query, they can slow the network down. These functions provide a mechanism for controlling that.

GetNetworkAutoUpdate() returns the current status of the autoupdate flag. SetNetworkAutoUpdate() sets flag, but returns its current value (to make it easier to restore). The function WithoutAutoUpdate provides a mechanism for turning updating off while performing a series of operations.

Value

GetNetworkAutoUpdate() and SetNetworkAutoUpdate both returns the current autoupdate flag as a logical value.

WithoutAutoUpdate() returns the value of executing expr, unless executing expr results in an error in which case it returns a try-error.

Note

Automatic updating makes a lot of sense when Netica is running under the GUI, but not so much when it is running as an API. It is probably easiest to just set this to false all the time.

Author(s)

Russell Almond

References

http://norsys.com/onLineAPIManual/index.html: SetNetAutoUpdate_bn(), GetNetAutoUpdate_bn()

See Also

NeticaBN, NodeBeliefs(), NodeFinding()

Examples

sess <- NeticaSession()
startSession(sess)

autoNet <- CreateNetwork("AutomaticTest", session=sess)

GetNetworkAutoUpdate(autoNet)

SetNetworkAutoUpdate(autoNet,FALSE)
stopifnot(!GetNetworkAutoUpdate(autoNet))
stopifnot(!SetNetworkAutoUpdate(autoNet,TRUE))
stopifnot(GetNetworkAutoUpdate(autoNet))

result <- TRUE
WithoutAutoUpdate(autoNet, result <<-GetNetworkAutoUpdate(autoNet))
stopifnot(!result)

DeleteNetwork(autoNet)
stopSession(sess)


[Package RNetica version 0.8-2 Index]