NetworkUndo {RNetica}R Documentation

Undoes (redoes) a Netica operation on a network.

Description

Netica maintains an internal queue of reversible operations on a network. The NetworkUndo() rolls them back off the stack. The NetworkRedo().

Usage

NetworkUndo(net)
NetworkRedo(net)

Arguments

net

A NeticaBN object on which an action took place.

Details

The details of which operations are undoable is not clearly documented in Netica. Some obvious things, like adding nodes, do not appear to work.

Value

Returns an invisible integer which is the return code from the underlying network function. Its value is not documented, other than it will be negative if the undo/redo stack is empty.

Author(s)

Russell Almond

References

http://norsys.com/onLineAPIManual/index.html: UndoNetLastOper_bn(), RedoNetOper_bn()

See Also

NeticaBN, CreateNetwork

Examples

## Not run: 
sess <- NeticaSession()
startSession(sess)

activeNet <- CreateNetwork("undoRedoTest", session=sess)

NewContinuousNode(activeNet,"Node1")
NewContinuousNode(activeNet,"Node2")
NewContinuousNode(activeNet,"Node3")

## These tests don't actually work, I'm not sure
## what constitutes an undoable action in Netica.
print(NetworkUndo(activeNet))
stopifnot(length(NetworkAllNodes(activeNet))==2)

print(NetworkUndo(activeNet))
stopifnot(length(NetworkAllNodes(activeNet))==1)

print(NetworkRedo(activeNet))
stopifnot(length(NetworkAllNodes(activeNet))==2)

DeleteNetwork(activeNet)
stopSession(sess)

## End(Not run)

[Package RNetica version 0.5-4 Index]