norsys.netica
Class State

java.lang.Object
  |
  +--norsys.netica.Generic
        |
        +--norsys.netica.State
All Implemented Interfaces:
NeticaListener

public class State
extends Generic

A state of a discrete Node, or a state of a discretized continuous Node.

There is no public constructor for State; obtain states by calling Node.state

States inherit from Generic, but currently the only facilities available are the name and title.

Since:
2.08
Version:
2.21 - May 7, 2002

Fields inherited from class norsys.netica.Generic
NAME_MAX
 
Method Summary
 int getIndex()

Returns the index number of this state.

 Node getNode()

Returns the Node that this state belongs to.

 double getNumeric()

Returns the real value that has been previously associated with this discrete state (by calling setNumeric or Node.setLevels).

 void setNumeric(double value)

Sets the real value to be associated with this discrete state.

 
Methods inherited from class norsys.netica.Generic
addListener, eventOccurred, getComment, getEnviron, getName, getNthUserField, getTitle, getUserData, getUserField, removeListener, setComment, setName, setTitle, setUserData, setUserField, toString, user
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getIndex

public int getIndex()
Returns the index number of this state. It will be between 0 and one less than the number of states of the node.

Version:
In version 2.14 and later.

getNode

public Node getNode()
Returns the Node that this state belongs to.

Version:
In version 2.14 and later.

getNumeric

public double getNumeric()
                  throws NeticaException
Returns the real value that has been previously associated with this discrete state (by calling setNumeric or Node.setLevels).

Throws an exception if a real value has not been associated with this state.

Version:

In version 2.14 and later.
See Also:
setNumeric    Sets it
setLevels    Sets real value of all states, including this one
getLevels    Retrieves the real values of all states


setNumeric

public void setNumeric(double value)
                throws NeticaException
Sets the real value to be associated with this discrete state.

The number can be integer or real, negative or positive.

This is for discrete nodes only. An exception will be thrown if it is attempted on a continuous node, even one that has been discretized.

Parameters:
double    value    value to be associated with this discrete state

Version:

In version 2.14 and later.
See Also:
getNumeric    Retrieves value
setLevels    Sets real value for all states, including this one