SMILE allows me to use AddOutcome() but doesn't allow me to use SetNumberOfOutcomes(int). It returns a -19 DSL_WRONG_NUM_STATES error.
It's a decision node with no parents. Anybody know why the code does not let me set an arbitrary number of outomes with SetNumberOfOutcomes(int) but allows me to do so with AddOutcome()?
Just curious.
Curious why one way of setting outcomes fails.
-
- Site Admin
- Posts: 1417
- Joined: Mon Nov 26, 2007 5:51 pm
Re: Curious why one way of setting outcomes fails.
DSL_WRONG_NUM_STATES is returned when node for which SetNumberOfOutcomes was called has at least one child.gund wrote:It's a decision node with no parents. Anybody know why the code does not let me set an arbitrary number of outomes with SetNumberOfOutcomes(int) but allows me to do so with AddOutcome()?
Changing the outcome set of the parent node (creation, removal, reordering of the outcomes) also changes the structure of its children nodes. The children nodes are notified when AddOutcome or RemoveOutcome methods are called on the parent and must respond accordingly to keep the network in a consistent state.
This process is more difficult to implement when the entire set of outcomes changes at once. We decided to keep SetNumberOfOutcomes in SMILE, but limit its application to childless nodes; the method is here mainly for the benefit of file format readers.