Package edu.cmu.tetrad.bayes
Class Evidence
java.lang.Object
edu.cmu.tetrad.bayes.Evidence
- All Implemented Interfaces:
TetradSerializable
,Serializable
Stores information for a variable source 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
ConstructorsConstructorDescriptionCopy constructor.Evidence
(Evidence evidence, VariableSource variableSource) Constructor for Evidence.Evidence
(Proposition proposition) Wraps the proposition. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getCategory
(Node node, int j) getCategory.int
getCategoryIndex
(String nodeName, String category) getCategoryIndex.getNode
(int nodeIndex) getNode.int
getNodeIndex
(String nodeName) getNodeIndex.int
getNumCategories
(int variable) getNumCategories.int
getNumNodes.Getter for the fieldproposition
.getVariable
(String nodeName) getVariable.getVariablesInEvidence.getVariableSource.int
hashCode()
hashCode.boolean
hasNoEvidence
(int variable) hasNoEvidence.boolean
isIncompatibleWith
(VariableSource variableSource) Returna true just in case this evidence has a list of variables equal to those of the given variable source.boolean
isManipulated
(int nodeIndex) isManipulated.static Evidence
Generates a simple exemplar of this class to test serialization.void
setManipulated
(int nodeIndex, boolean manipulated) setManipulated.static Evidence
tautology
(VariableSource variableSource) tautology.toString()
toString.
-
Constructor Details
-
Evidence
Copy constructor.- Parameters:
evidence
- aEvidence
object
-
Evidence
Wraps the proposition. The Bayes IM and manipulation will be null.- Parameters:
proposition
- aProposition
object
-
Evidence
Constructor for Evidence.
- Parameters:
evidence
- aEvidence
objectvariableSource
- aVariableSource
object
-
-
Method Details
-
tautology
tautology.
- Parameters:
variableSource
- aVariableSource
object- Returns:
- a
Evidence
object
-
serializableInstance
Generates a simple exemplar of this class to test serialization.- Returns:
- a
Evidence
object
-
getVariableSource
getVariableSource.
- Returns:
- the Bayes IM that this is evidence for.
-
getNodeIndex
getNodeIndex.
- Parameters:
nodeName
- aString
object- Returns:
- a int
-
getCategoryIndex
getCategoryIndex.
-
getNumNodes
public int getNumNodes()getNumNodes.
- Returns:
- a int
-
getNode
getNode.
- Parameters:
nodeIndex
- a int- Returns:
- a
Node
object
-
getVariable
getVariable.
- Parameters:
nodeName
- aString
object- Returns:
- a
DiscreteVariable
object
-
getNumCategories
public int getNumCategories(int variable) getNumCategories.
- Parameters:
variable
- a int- Returns:
- a int
-
getProposition
Getter for the field
proposition
.- Returns:
- a
Proposition
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.
-
hasNoEvidence
public boolean hasNoEvidence(int variable) hasNoEvidence.
- Parameters:
variable
- a int- Returns:
- a boolean
-
getVariablesInEvidence
getVariablesInEvidence.
- Returns:
- the variable for which there is evidence.
-
getCategory
getCategory.
-
isIncompatibleWith
Returna true just in case this evidence has a list of variables equal to those of the given variable source.- Parameters:
variableSource
- aVariableSource
object- Returns:
- a boolean
-
equals
-
hashCode
public int hashCode()hashCode.
-