Package edu.cmu.tetrad.sem
Class SemEvidence
java.lang.Object
edu.cmu.tetrad.sem.SemEvidence
- All Implemented Interfaces:
- TetradSerializable,- Serializable
Stores information for a SemIm about evidence we have for each variable as well as whether each variable has been
 manipulated.
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionSemEvidence(SemEvidence evidence) Constructor for SemEvidence.SemEvidence(SemIm semIm) Constructs a container for evidence for the given Bayes IM.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanThis method checks if the given object is equal to the current instance of SemEvidence.getNode(int nodeIndex) getNode.intgetNodeIndex(Node node) getNodeIndex.intgetNodeIndex(String nodeName) getNodeIndex.getNodesInEvidence.intgetNumNodes.Getter for the fieldproposition.getSemIm()Getter for the fieldsemIm.inthashCode()hashCode.booleanisManipulated(int nodeIndex) isManipulated.static SemEvidenceGenerates a simple exemplar of this class to test serialization.voidsetManipulated(int nodeIndex, boolean manipulated) setManipulated.toString()toString.
- 
Constructor Details- 
SemEvidenceConstructs a container for evidence for the given Bayes IM.- Parameters:
- semIm- a- SemImobject
 
- 
SemEvidenceConstructor for SemEvidence. - Parameters:
- evidence- a- SemEvidenceobject
 
 
- 
- 
Method Details- 
serializableInstanceGenerates a simple exemplar of this class to test serialization.- Returns:
- a SemEvidenceobject
 
- 
getSemImGetter for the field semIm.- Returns:
- the Bayes IM that this is evidence for.
 
- 
getNodeIndexgetNodeIndex. - Parameters:
- nodeName- a- Stringobject
- Returns:
- a int
 
- 
getNodeIndexgetNodeIndex. - Parameters:
- node- a- Nodeobject
- Returns:
- a int
 
- 
getNumNodespublic int getNumNodes()getNumNodes. - Returns:
- a int
 
- 
getNodegetNode. - Parameters:
- nodeIndex- a int
- Returns:
- a Nodeobject
 
- 
getPropositionGetter for the field proposition.- Returns:
- a SemPropositionobject
 
- 
isManipulatedpublic boolean isManipulated(int nodeIndex) isManipulated. - Parameters:
- nodeIndex- a int
- Returns:
- a boolean
 
- 
setManipulatedpublic void setManipulated(int nodeIndex, boolean manipulated) setManipulated. - Parameters:
- nodeIndex- a int
- manipulated- a boolean
 
- 
toStringtoString. 
- 
getNodesInEvidencegetNodesInEvidence. - Returns:
- the variable for which there is evidence.
 
- 
equalsThis method checks if the given object is equal to the current instance of SemEvidence. Two SemEvidence objects are considered equal if they have the same semIm, proposition, and manipulation.- Overrides:
- equalsin class- Object
- Parameters:
- o- the object to be compared with the current instance of SemEvidence
- Returns:
- true if the given object is equal to the current instance of SemEvidence, false otherwise
- Throws:
- IllegalArgumentException- if the given object is not an instance of SemEvidence
 
- 
hashCodepublic int hashCode()hashCode. 
 
-