NodeVisPos {RNetica}R Documentation

Gets, sets the visual position of the node on the Netica display.

Description

When displayed in the GUI, Netica nodes have a position. The NodeVisPos() attribute controls where the node will be displayed.

Usage

NodeVisPos(node)
NodeVisPos(node) <- value

Arguments

node

A NeticaNode object whose position is to be determined.

value

A numeric vector of length 2 giving the x and y coordinates.

Details

The visual position of the node doesn't make much different in RNetica, as R does not display the node. However, it will control the appearance when the net is loaded into the Netica GUI.

Value

A numeric vector of length 2 with names "x" and "y".

Note

The minimum possible node position appears to be (0,0) and the maximum is never stated. Netica appears to round positions to the nearest integer. Also, if the position appears too close to the boarder (Netica positions the center of the node), Netica will move it away from the edge.

Author(s)

Russell Almond

References

http://norsys.com/onLineAPIManual/index.html: GetNodeVisPosition_bn(), SetNodeVisPosition_bn(),

See Also

NeticaNode, NodeVisPos()

Examples

sess <- NeticaSession()
startSession(sess)
pnet <- CreateNetwork("PositionNet", session=sess)

pnode <- NewDiscreteNode(pnet,"PlaceMe")

NodeVisPos(pnode) <- c(100,300)
pos <- NodeVisPos(pnode)
stopifnot(
  pos["x"] ==100,
  pos["y"] ==300
)

## Netica rounds noninteger positions.
NodeVisPos(pnode) <- c(74.3,88.8)
pos <- NodeVisPos(pnode)
stopifnot(
  pos["x"] ==74,
  pos["y"] ==88
)

## Warning, setting a node too close to the edge can cause Netica to
## reposition the node
NodeVisPos(pnode) <- c(1,1)
pos <- NodeVisPos(pnode)
stopifnot(
  pos["x"] >1,
  pos["y"] >1
)

DeleteNetwork(pnet)
stopSession(sess)


[Package RNetica version 0.7-1 Index]