com.cra.bnet.engine
Class EvidenceEvent

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

public class EvidenceEvent
extends EventObject

An event representing either evidence posted to or retracted from a Bayesian network.

See Also:
Serialized Form

Field Summary
static com.cra.bnet.engine.EvidenceEvent.EvidenceEventType ALL_EVIDENCE_RETRACTED
          The all evidence retracted event type.
static com.cra.bnet.engine.EvidenceEvent.EvidenceEventType EVIDENCE_POSTED
          The evidence posted event type.
static com.cra.bnet.engine.EvidenceEvent.EvidenceEventType EVIDENCE_RETRACTED
          The evidence retracted event type.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
EvidenceEvent(BayesianNetwork network)
          Creates a new EvidenceEvent representing a retraction of all evidence from a Bayesian network.
EvidenceEvent(Node node, double[] evidence)
          Creates a new EvidenceEvent representing a posting of new evidence.
EvidenceEvent(Node node, double[] evidence, boolean inconsistentEvidence)
          Creates a new EvidenceEvent representing a retraction of evidence.
 
Method Summary
 BayesianNetwork getBayesianNetwork()
          Returns the Bayesian network that evidence was posted to or retracted from.
 double[] getEvidence()
          Returns the evidence posted to or retracted from the node.
 Node getNode()
          Returns the node that evidence was posted to or retracted from.
 com.cra.bnet.engine.EvidenceEvent.EvidenceEventType getType()
          Returns the type of this evidence event.
 boolean isInconsistentEvidence()
          Returns true if this event represents a retraction of inconsistent evidence and false if it represents a normal retraction of evidence.
 String toString()
          Returns a string representation of this evidence 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
 

Field Detail

EVIDENCE_POSTED

public static final com.cra.bnet.engine.EvidenceEvent.EvidenceEventType EVIDENCE_POSTED
The evidence posted event type.


EVIDENCE_RETRACTED

public static final com.cra.bnet.engine.EvidenceEvent.EvidenceEventType EVIDENCE_RETRACTED
The evidence retracted event type.


ALL_EVIDENCE_RETRACTED

public static final com.cra.bnet.engine.EvidenceEvent.EvidenceEventType ALL_EVIDENCE_RETRACTED
The all evidence retracted event type.

Constructor Detail

EvidenceEvent

public EvidenceEvent(Node node,
                     double[] evidence,
                     boolean inconsistentEvidence)
Creates a new EvidenceEvent representing a retraction of evidence.

Parameters:
node - node that evidence was retracted from.
evidence - evidence retracted from the node.
inconsistentEvidence - true if this event represents a retraction of inconsistent evidence and false if it's just a normal retraction.

EvidenceEvent

public EvidenceEvent(Node node,
                     double[] evidence)
Creates a new EvidenceEvent representing a posting of new evidence.

Parameters:
node - node that new evidence was posted to.
evidence - evidence posted to the node.

EvidenceEvent

public EvidenceEvent(BayesianNetwork network)
Creates a new EvidenceEvent representing a retraction of all evidence from a Bayesian network.

Parameters:
network - network that all evidence was retracted from.
Method Detail

getBayesianNetwork

public BayesianNetwork getBayesianNetwork()
Returns the Bayesian network that evidence was posted to or retracted from.

Returns:
the Bayesian network that evidence was posted to or retracted from.

getNode

public Node getNode()
Returns the node that evidence was posted to or retracted from. If this is an ALL_EVIDENCE_RETRACTED event, this method returns null.

Returns:
the node that evidence was posted to or retracted from or null if this is an ALL_EVIDENCE_RETRACTED event.

getEvidence

public double[] getEvidence()
Returns the evidence posted to or retracted from the node. This method will return null if this event represents a retraction of all evidence.

Returns:
the evidence posted to or retracted from the node.

getType

public com.cra.bnet.engine.EvidenceEvent.EvidenceEventType getType()
Returns the type of this evidence event.

Returns:
the type of this evidence event.

isInconsistentEvidence

public boolean isInconsistentEvidence()
Returns true if this event represents a retraction of inconsistent evidence and false if it represents a normal retraction of evidence. This method returns false if this event represents a posting of evidence or a retraction of all evidence.

Returns:
true if this event represents a retraction of inconsistent evidence and false otherwise.

toString

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

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