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
Constructs a container for evidence for the given Bayes IM.- Parameters:
semIm
- aSemIm
object
-
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.
- Parameters:
nodeName
- aString
object- Returns:
- a int
-
getNodeIndex
getNodeIndex.
- Parameters:
node
- aNode
object- Returns:
- a int
-
getNumNodes
public int getNumNodes()getNumNodes.
- Returns:
- a int
-
getNode
getNode.
- Parameters:
nodeIndex
- a int- Returns:
- a
Node
object
-
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
toString.
-
getNodesInEvidence
getNodesInEvidence.
- Returns:
- the variable for which there is evidence.
-
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
public int hashCode()hashCode.
-