GetNetworkAutoUpdate {RNetica} | R Documentation |
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
GetNetworkAutoUpdate(net) SetNetworkAutoUpdate(net, newautoupdate) WithoutAutoUpdate(net,expr)
net |
A |
newautoupdate |
A logical values, |
expr |
An R expression to be evaluated with automatic updating turned off. |
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.
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
.
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.
Russell Almond
http://norsys.com/onLineAPIManual/index.html: SetNetAutoUpdate_bn(), GetNetAutoUpdate_bn()
NeticaBN
, NodeBeliefs()
,
NodeFinding()
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)