NodeStateTitles {RNetica} | R Documentation |
Each state of a NeticaNode
can have a longer title or
comments associated with it. These functions get or set the titles
or comments.
NodeStateTitles(node) NodeStateTitles(node) <- value NodeStateComments(node) NodeStateComments(node) <- value
node |
An active |
value |
A character vector of length |
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.
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.
Russell Almond
http://norsys.com/onLineAPIManual/index.html: GetNodeStateTitle_bn(),SetNodeStateTitle_bn(), GetNodeStateComment_bn(),SetNodeStateComment_bn()
NeticaNode
, NodeStates()
,
NodeLevels()
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)