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 Summary
ConstructorsConstructorDescriptionSemEvidence
(SemEvidence evidence) Constructor for SemEvidence.SemEvidence
(SemIm semIm) Constructs a container for evidence for the given Bayes IM. -
Method Summary
Modifier and TypeMethodDescriptionboolean
This method checks if the given object is equal to the current instance of SemEvidence.getNode
(int nodeIndex) getNode.int
getNodeIndex
(Node node) getNodeIndex.int
getNodeIndex
(String nodeName) getNodeIndex.getNodesInEvidence.int
getNumNodes.Getter for the fieldproposition
.getSemIm()
Getter for the fieldsemIm
.int
hashCode()
hashCode.boolean
isManipulated
(int nodeIndex) isManipulated.static SemEvidence
Generates a simple exemplar of this class to test serialization.void
setManipulated
(int nodeIndex, boolean manipulated) setManipulated.toString()
toString.
-
Constructor Details
-
SemEvidence
-
SemEvidence
Constructor for SemEvidence.
- Parameters:
evidence
- aSemEvidence
object
-
-
Method Details
-
serializableInstance
Generates a simple exemplar of this class to test serialization.- Returns:
- a
SemEvidence
object
-
getSemIm
Getter for the field
semIm
.- Returns:
- the Bayes IM that this is evidence for.
-
getNodeIndex
-
getNodeIndex
-
getNumNodes
public int getNumNodes()getNumNodes.
- Returns:
- a int
-
getNode
-
getProposition
Getter for the field
proposition
.- Returns:
- a
SemProposition
object
-
isManipulated
public boolean isManipulated(int nodeIndex) isManipulated.
- Parameters:
nodeIndex
- a int- Returns:
- a boolean
-
setManipulated
public void setManipulated(int nodeIndex, boolean manipulated) setManipulated.
- Parameters:
nodeIndex
- a intmanipulated
- a boolean
-
toString
-
getNodesInEvidence
-
equals
This 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:
equals
in classObject
- 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
-
hashCode
-