void SetNodeStateNames_bn ( node_bn*  node,   const char*  state_names )

Names the states of node using the list of names state_names.

The names must be separated by commas and/or whitespace (i.e., spaces, tabs or newlines). It is okay if there is an extra separator at the end. The number of names must be the number that would be returned by GetNodeNumberStates_bn.

Each name must be a legal IDname, which means it must have NAME_MAX_ns (30) or fewer characters, all of which are letters, digits or underscores, and it must start with a letter. No two states of a node may have the same name. To avoid these restrictions, you can give the states titles instead; see SetNodeStateTitle_bn.

It is not required that a node's states be named. If you pass NULL (not the empty string) for state_names, it will remove all the state names for node.

Discretized continuous nodes may have their states named, as well as regular discrete nodes.

Netica will copy from state_names; it won't modify or free the passed string.


Versions 2.10 and later have this function.

See also:

SetNodeStateName_bn    Sets name of one state at a time
GetNodeStateName_bn    Retrieves a single state name
SetNodeStateTitle_bn    Doesn't have the restrictions of a name
NewNode_bn    Sets the number of states to start with


// Here is how you would make a new node with the 2 states
// "true" and "false".
node_bn* node = NewNode_bn ("n1", 2, net);  // make new node with 2 states
SetNodeStateNames_bn (node, "true, false");