void AddNodeStates_bn ( node_bn*  node,   state_bn*  first_state,   const char*  state_names,   int  num_states,   double  cpt_fill )

Adds one or more states to node, inserting them into the existing states. The first one added will have index first_state, and num_states is the number of states that will be added. If state is zero, the states will be added before existing ones, and if it is the same as the number of states of the node ( or -1), they will be added at the end.

The state_names parameter can be a comma delimited list of new names for the added states, or it can be NULL, in which case the added states will be given default names. It must be NULL if the node's states currently do not have names.

Pass -1.0 for cpt_fill. It is only for future expansion.

This function is for discrete nodes only. It is not for continuous nodes, even if they have been discretized (use SetNodeLevels_bn instead).

All relevant parts of node will be properly modified to reflect the changes, including findings. The state titles and state comments of the added states will be absent.

The CPTable will be appropriately adjusted. In it, the probability of the new states will be zero.


Since version 3.01

See also:

RemoveNodeState_bn    Removes a single state
ReorderNodeStates_bn    Assign a new order to the states
GetNodeNumberStates_bn    first_state must be between 0 and this, inclusive
GetStateNamed_bn    Retrieve the new indexes of the states
SetNodeStateName_bn    Sets name of one state at a time
SetNodeStateTitle_bn    Doesn't have the restrictions of a name
SetNodeStateComment_bn    Assigns arbitrary text documentation to a state
SetNodeLevels_bn    For continuous nodes