NodeChildren {RNetica}R Documentation

Returns a list of the children of a node in a Netica network.

Description

The children of a node parent are the nodes which are directly connected to parent with an edge oriented from parent. The function NodeChildren(parent) returns a list of the children of parent

Usage

NodeChildren(parent)

Arguments

parent

A NeticaNode whose children are to be found.

Details

The function NodeChildren(parent) only returns the immediate descendants of parent. A list of all descendants can be found using the function GetRelatedNodes(parent,"decendents").

The function link{NodeParents}() returns the opposite end of the link, however, unlike NodeParents(), NodeChildren() cannot be directly set.

Value

A list (possibly empty) of NeticaNode objects which are the children of parent.

Author(s)

Russell Almond

References

http://norsys.com/onLineAPIManual/index.html: GetNodeChildren_bn()

See Also

NeticaNode, AddLink(), NodeParents(), GetRelatedNodes()

Examples

sess <- NeticaSession()
startSession(sess)

chnet <- CreateNetwork("ChildcareCenter", session=sess)
mom <- NewContinuousNode(chnet,"Mother")
stopifnot(
  length(NodeChildren(mom))==0
)

daughters <- NewDiscreteNode(chnet,paste("Daughter",1:3,sep=""))
sapply(daughters, function(d) AddLink(mom,d))

stopifnot(
  length(NodeChildren(mom))==3,
  all(match(daughters,NodeChildren(mom),nomatch=0))>0
)
  
DeleteNetwork(chnet)
stopSession(sess)


[Package RNetica version 0.7-2 Index]