NodeStateTitles {RNetica}R Documentation

Accessors for the titles and comments associated with states of Netica nodes.

Description

Each state of a NeticaNode can have a longer title or comments associated with it. These functions get or set the titles or comments.

Usage

NodeStateTitles(node)
NodeStateTitles(node) <- value
NodeStateComments(node)
NodeStateComments(node) <- value

Arguments

node

An active NeticaNode object whose state titles or comments will be accessed.

value

A character vector of length NodeNumStates(node) which provides the new state titles or comments.

Details

The titles are meant to be a more human readable version of the state names and are not subject the IDname restrictions. These are displayed in the Netica GUI in certain display modes. The comments are meant to be a longer free form notes.

Both titles and comments are returned as a named character vector with names corresponding to the state names. Therefore one can change a single state title or comment by accessing it either using the state number or the state name.

Value

Both NodeStateTitles() and NodeStateComments() return a character vector of length NodeNumStates(node) giving the titles or comments respectively. The names of this vector are NodeStates(node).

The setter methods return the modified NeticaNode object invisibly.

Author(s)

Russell Almond

References

http://norsys.com/onLineAPIManual/index.html: GetNodeStateTitle_bn(),SetNodeStateTitle_bn(), GetNodeStateComment_bn(),SetNodeStateComment_bn()

See Also

NeticaNode, NodeStates(), NodeLevels()

Examples

sess <- NeticaSession()
startSession(sess)
cnet <- CreateNetwork("CreativeNet", session=sess)

orig <- NewDiscreteNode(cnet,"Originality", c("H","M","L"))
NodeStateTitles(orig) <- c("High","Medium","Low")
NodeStateComments(orig)[1] <- "Produces solutions unlike those typically seen."

stopifnot(
  NodeStateTitles(orig) == c("High","Medium","Low"),
  grep("solutions unlike", NodeStateComments(orig))==1,
  NodeStateComments(orig)[3]==""
  )

sol <- NewDiscreteNode(cnet,"Solution",
       c("Typical","Unusual","VeryUnusual"))
stopifnot(
  all(NodeStateTitles(sol) == ""),
  all(NodeStateComments(sol) == "")
  )

NodeStateTitles(sol)["VeryUnusual"] <- "Very Unusual"
NodeStateComments(sol) <- paste("Distance from typical solution",
                      c("<1", "1--2", ">2"))
stopifnot(
  NodeStateTitles(sol)[3]=="Very Unusual",
  NodeStateComments(sol)[1] == "Distance from typical solution <1"
  )

DeleteNetwork(cnet)
stopSession(sess)

[Package RNetica version 0.8-4 Index]