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 TypeMethodDescriptionbooleangetCategory(Node node, int j) getCategory.intgetCategoryIndex(String nodeName, String category) getCategoryIndex.getNode(int nodeIndex) getNode.intgetNodeIndex(String nodeName) getNodeIndex.intgetNumCategories(int variable) getNumCategories.intgetNumNodes.Getter for the fieldproposition.getVariable(String nodeName) getVariable.getVariablesInEvidence.getVariableSource.inthashCode()hashCode.booleanhasNoEvidence(int variable) hasNoEvidence.booleanisIncompatibleWith(VariableSource variableSource) Returna true just in case this evidence has a list of variables equal to those of the given variable source.booleanisManipulated(int nodeIndex) isManipulated.static EvidenceGenerates a simple exemplar of this class to test serialization.voidsetManipulated(int nodeIndex, boolean manipulated) setManipulated.static Evidencetautology(VariableSource variableSource) tautology.toString()toString.
-
Constructor Details
-
Evidence
-
Evidence
Wraps the proposition. The Bayes IM and manipulation will be null.- Parameters:
proposition- aPropositionobject
-
Evidence
Constructor for Evidence.
- Parameters:
evidence- aEvidenceobjectvariableSource- aVariableSourceobject
-
-
Method Details
-
tautology
tautology.
- Parameters:
variableSource- aVariableSourceobject- Returns:
- a
Evidenceobject
-
serializableInstance
-
getVariableSource
getVariableSource.
- Returns:
- the Bayes IM that this is evidence for.
-
getNodeIndex
-
getCategoryIndex
-
getNumNodes
public int getNumNodes()getNumNodes.
- Returns:
- a int
-
getNode
-
getVariable
getVariable.
- Parameters:
nodeName- aStringobject- Returns:
- a
DiscreteVariableobject
-
getNumCategories
public int getNumCategories(int variable) getNumCategories.
- Parameters:
variable- a int- Returns:
- a int
-
getProposition
-
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
-
hasNoEvidence
public boolean hasNoEvidence(int variable) hasNoEvidence.
- Parameters:
variable- a int- Returns:
- a boolean
-
getVariablesInEvidence
-
getCategory
-
isIncompatibleWith
Returna true just in case this evidence has a list of variables equal to those of the given variable source.- Parameters:
variableSource- aVariableSourceobject- Returns:
- a boolean
-
equals
-
hashCode
-