NetworkSetPriority {RNetica}R Documentation

Changes the priority order of the node sets.

Description

Netica sets the visual appearance (i.e., colour, see NetworkNodeSetColor()) of a node according to highest priority set to which the node belongs. This function changes the order of priority.

Usage

NetworkSetPriority(net, setlist)

Arguments

net

An active NeticaBN object representing the network.

setlist

A character vector containing a subset of the node set names. The first ones in the sequence will have the highest priority.

Details

Netica determines the visual style of a node by stepping through the node sets to which the node belongs in priority order. Each node set can either have a colour set, or a flag set to indicate that the next node in order or priority should be used to determine the appearance of the node (see NetworkNodeSetColor()).

This function switches the priority of the node sets names in the second argument. The node sets note mentioned in setlist are not affected.

Value

Returns the net argument invisibly.

Note

The priority of the Netica internal node sets (the ones beginning with ‘:’) are set by Netica and cannot be changed. They all have lower priority than the user-defined node sets.

Author(s)

Russell Almond

References

http://norsys.com/onLurl/Manual/index.html: ReorderNodesets_bn(), SetNodesetColor_bn()

See Also

NeticaNode, NodeSets(), NetworkNodeSets(), NetworkNodesInSet(), NetworkNodeSetColor()

Examples

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"

NodeSets(EssayScore) <- c("ReportingVariable","Observable")

NetworkSetPriority(nsnet,c("Observable","ReportingVariable"))
## Now EssayScore should be coloured like an observable.
stopifnot( NodeSets(EssayScore) == c("Observable","ReportingVariable"))

NetworkSetPriority(nsnet,c("ReportingVariable","Observable"))
## Now EssayScore should be coloured like a Reporting Variable
stopifnot( NodeSets(EssayScore) == c("ReportingVariable","Observable"))

DeleteNetwork(nsnet)
stopSession(sess)


[Package RNetica version 0.7-3 Index]