is.discrete {RNetica}R Documentation

Determines whether a Netica node is discrete or continuous.

Description

A NeticaNode object can take on either a discrete set of values or an arbitrary real value. These functions determine which type of node this is.

Usage

is.discrete(node)
is.continuous(node)

Arguments

node

A NeticaNode object to test.

Details

While in the Netica GUI, one first creates a node and then determines whether it will be discrete or continuous, in the API this is determined at the time of creation (by calling NewContinuousNode() or NewDiscreteNode(). These functions determine which type of node the given node is.

Note that setting NodeLevels can make a continuous node behave like a discrete one and vice versa. For continuous nodes, the levels are cut points for getting a discrete state from the node. For a discrete node, the levels are real values representing the midpoint of the states.

Value

TRUE or FALSE depending on whether a node is discrete or continuous.

Note

Currently, this function does not actually look at the internal Netica state, but rather looks at the field "discrete" which is set when the node is created.

Author(s)

Russell Almond

References

http://norsys.com/onLineAPIManual/index.html: GetNodeType_bn(), SetNodeLevels_bn()

See Also

NewDiscreteNode(), NewContinuousNode(), NeticaNode, NodeLevels(), NodeStates()

Examples

sess <- NeticaSession()
startSession(sess)

netx <- CreateNetwork("netx", session=sess)

bnode <- NewDiscreteNode(netx,"bool",c("True","False"))
stopifnot(is.discrete(bnode))
stopifnot(!is.continuous(bnode))

rnode <- NewContinuousNode(netx,"real")
stopifnot(!is.discrete(rnode))
stopifnot(is.continuous(rnode))

DeleteNetwork(netx)
stopSession(sess)


[Package RNetica version 0.7-2 Index]