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 SummaryConstructorsConstructorDescriptionCopy constructor.Evidence(Evidence evidence, VariableSource variableSource) Constructor for Evidence.Evidence(Proposition proposition) Wraps the proposition.
- 
Method SummaryModifier 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- 
EvidenceCopy constructor.- Parameters:
- evidence- a- Evidenceobject
 
- 
EvidenceWraps the proposition. The Bayes IM and manipulation will be null.- Parameters:
- proposition- a- Propositionobject
 
- 
EvidenceConstructor for Evidence. - Parameters:
- evidence- a- Evidenceobject
- variableSource- a- VariableSourceobject
 
 
- 
- 
Method Details- 
tautologytautology. - Parameters:
- variableSource- a- VariableSourceobject
- Returns:
- a Evidenceobject
 
- 
serializableInstanceGenerates a simple exemplar of this class to test serialization.- Returns:
- a Evidenceobject
 
- 
getVariableSourcegetVariableSource. - Returns:
- the Bayes IM that this is evidence for.
 
- 
getNodeIndexgetNodeIndex. - Parameters:
- nodeName- a- Stringobject
- Returns:
- a int
 
- 
getCategoryIndexgetCategoryIndex. 
- 
getNumNodespublic int getNumNodes()getNumNodes. - Returns:
- a int
 
- 
getNodegetNode. - Parameters:
- nodeIndex- a int
- Returns:
- a Nodeobject
 
- 
getVariablegetVariable. - Parameters:
- nodeName- a- Stringobject
- Returns:
- a DiscreteVariableobject
 
- 
getNumCategoriespublic int getNumCategories(int variable) getNumCategories. - Parameters:
- variable- a int
- Returns:
- a int
 
- 
getPropositionGetter for the field proposition.- Returns:
- a Propositionobject
 
- 
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. 
- 
hasNoEvidencepublic boolean hasNoEvidence(int variable) hasNoEvidence. - Parameters:
- variable- a int
- Returns:
- a boolean
 
- 
getVariablesInEvidencegetVariablesInEvidence. - Returns:
- the variable for which there is evidence.
 
- 
getCategorygetCategory. 
- 
isIncompatibleWithReturna true just in case this evidence has a list of variables equal to those of the given variable source.- Parameters:
- variableSource- a- VariableSourceobject
- Returns:
- a boolean
 
- 
equals
- 
hashCodepublic int hashCode()hashCode. 
 
-