com.cra.bnet.engine
Class CptEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--com.cra.bnet.engine.CptEvent
All Implemented Interfaces:
Serializable

public class CptEvent
extends EventObject

An event representing a change in a cpt entry.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
CptEvent(DiscreteNode node)
          Creates a new CptEvent that represents a change to all entries in the specified node's conditional probability table.
CptEvent(DiscreteNode node, int nodeIndex, int[] parentIndices, double oldValue, double newValue)
          Creates a new CptEvent.
 
Method Summary
 double getNewValue()
          Returns the new cpt entry.
 DiscreteNode getNode()
          Returns the node whose cpt changed.
 int getNodeIndex()
          Returns the index of the node corresponding to the conditional probability that changed.
 double getOldValue()
          Returns the old cpt entry.
 int[] getParentIndices()
          Returns the indices of the parents corresponding to the conditional probability that changed.
 String toString()
          Returns a string representation of this cpt event.
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CptEvent

public CptEvent(DiscreteNode node,
                int nodeIndex,
                int[] parentIndices,
                double oldValue,
                double newValue)
Creates a new CptEvent.

Parameters:
node - node whose cpt changed.
nodeIndex - node's state index for entry that changed.
parentIndices - parent indices for entry that changed.
oldValue - old cpt entry.
newValue - new cpt entry.

CptEvent

public CptEvent(DiscreteNode node)
Creates a new CptEvent that represents a change to all entries in the specified node's conditional probability table.

Parameters:
node - node whose cpt changed.
Method Detail

getNewValue

public double getNewValue()
Returns the new cpt entry.

Returns:
the new cpt entry.

getNode

public DiscreteNode getNode()
Returns the node whose cpt changed.

Returns:
the node whose cpt changed.

getOldValue

public double getOldValue()
Returns the old cpt entry.

Returns:
the old cpt entry.

getNodeIndex

public int getNodeIndex()
Returns the index of the node corresponding to the conditional probability that changed.

Returns:
the index of the node corresponding to the conditional probability that changed.

getParentIndices

public int[] getParentIndices()
Returns the indices of the parents corresponding to the conditional probability that changed.

Returns:
the indices of the parents corresponding to the conditional probability that changed.

toString

public String toString()
Returns a string representation of this cpt event.

Overrides:
toString in class EventObject
Returns:
a string representation of this cpt event.