NetworkNodeSets {RNetica} | R Documentation |
A node set is a character label associated with a node which provides information about its role in the models. This function returns the complete list of node sets associated with any node in the network.
NetworkNodeSets(net, incSystem = FALSE)
net |
An active |
incSystem |
A logical flag. If |
Netica node sets are a collection of string labels that can be
associated with various nodes in a network using the function
NodeSets()
. Node sets do not have any meaning to
Netica: node set membership only affect the way the node is displayed
(see NetworkNodeSetColor()
). One purpose of node sets
is to label a set of nodes that play a similar role in the model. For
example, "ReportingVariable"
or "Observable"
.
The expression NetworkNodeSets(net)
returns the node
sets that are currently associated with any node in net. If
incSystem=TRUE
, then the internal Netica system node sets will
be included as well. These begin with a colon (‘:’). This
value cannot be set directly, only indirectly through the use of
NodeSets
.
A character vector giving the node sets used by the network.
Node sets cannot be destroyed, only created. An empty node set has no effect.
Russell Almond
http://norsys.com/onLurl/Manual/index.html: GetAllNodesets_bn()
NeticaNode
, NodeSets()
,
NetworkSetPriority()
,
NetworkNodesInSet()
, NetworkNodeSetColor()
sess <- NeticaSession() startSession(sess) nsnet <- CreateNetwork("NodeSetExample", session=sess) Ability <- NewContinuousNode(nsnet,"Ability") EssayScore <- NewDiscreteNode(nsnet,"EssayScore",paste("level",5:0,sep="_")) Value <- NewContinuousNode(nsnet,"Value") NodeKind(Value) <- "Utility" Placement <- NewDiscreteNode(nsnet,"Placement", c("Advanced","Regular","Remedial")) NodeKind(Placement) <- "Decision" stopifnot( length(NetworkNodeSets(nsnet)) == 0, ## Nothing set yet length(NetworkNodeSets(nsnet,TRUE)) == 22 ## Number of system states ) NodeSets(Ability) <- "ReportingVariable" stopifnot( NetworkNodeSets(nsnet) == "ReportingVariable" ) NodeSets(EssayScore) <- "Observable" stopifnot( setequal(NetworkNodeSets(nsnet),c("Observable","ReportingVariable")) ) ## Changing spelling of name adds new set, doesn't delete the old one. NodeSets(EssayScore) <- "Observables" stopifnot( setequal(NetworkNodeSets(nsnet), c("Observables", "Observable","ReportingVariable")) ) ## Nor does deletion NodeSets(Ability) <- character() stopifnot( setequal(NetworkNodeSets(nsnet), c("Observables", "Observable","ReportingVariable")) ) DeleteNetwork(nsnet) stopSession(sess)