PnodeName: Gets or sets name of a parameterized node.

PnodeNameR Documentation

Gets or sets name of a parameterized node.

Description

Gets or sets the name of the node. Rules for names are implementation dependent, but they should generally conform to variable naming conventions (begin with a letter and only contain alphanumeric characters, no embeded spaces.)

Usage

PnodeName(node)
PnodeName(node)<- value

Arguments

node

A Pnode object that references the node.

value

An character vector of length 1 giving the new name.

Details

The PnodeTitle() function provides another way to name a node which is not subject to naming restrictions.

Value

The name of the node as a character vector of length 1.

The setter method returns the node argument.

True Names

True names are the names in the secret ancient lanugage which hold power over an object (Le Guin, 1968).

Actually, this is a difficulty with implementations that place restrictions on the name of a network or node. In particular, Netica restricts node names to alphanumeric characters and limits the length. This may make it difficult to match nodes by name with other parts of the system which do not have this restriction. In this case the object may have both a true name, which is returned by PnodeName and an internal use name which is used by the implementation.

Author(s)

Russell Almond

References

Le Guin, U. K. (1968). A Wizard of Earthsea. Parnassus Press.

See Also

Pnode, PnetFindNode(), PnodeTitle(),

Examples

## Not run: 
library(PNetica) # Requires PNetica
sess <- NeticaSession()
startSession(sess)
net <- CreateNetwork("funNet", session=sess)

pnode <- NewDiscreteNode(net,"play")

stopifnot(PnodeName(pnode)=="play")
stopifnot(PnetFindNode(net,"play")==pnode)

PnodeName(pnode)<-"work"
stopifnot(PnetFindNode(net,"work")==pnode)

PnodeName(pnode) <- "Non-Netica Name"
stopifnot(PnetFindNode(net,"Non-Netica Name")==pnode)

DeleteNetwork(net)
stopSession(sess)

## End(Not run)

ralmond/Peanut documentation built on Sept. 19, 2023, 8:27 a.m.