Class Evidence

java.lang.Object
edu.cmu.tetrad.bayes.Evidence
All Implemented Interfaces:
TetradSerializable, Serializable

public final class Evidence extends Object implements TetradSerializable
Stores information for a variable source about evidence we have for each variable as well as whether each variable has been manipulated.
Author:
josephramsey
See Also:
  • Constructor Details

    • Evidence

      public Evidence(Evidence evidence)
      Copy constructor.
    • Evidence

      public Evidence(Proposition proposition)
      Wraps the proposition. The Bayes IM and manipulation will be null.
    • Evidence

      public Evidence(Evidence evidence, VariableSource variableSource)
  • Method Details

    • tautology

      public static Evidence tautology(VariableSource variableSource)
    • serializableInstance

      public static Evidence serializableInstance()
      Generates a simple exemplar of this class to test serialization.
    • getVariableSource

      public VariableSource getVariableSource()
      Returns:
      the Bayes IM that this is evidence for.
    • getNodeIndex

      public int getNodeIndex(String nodeName)
    • getCategoryIndex

      public int getCategoryIndex(String nodeName, String category)
    • getNumNodes

      public int getNumNodes()
    • getNode

      public Node getNode(int nodeIndex)
    • getVariable

      public DiscreteVariable getVariable(String nodeName)
    • getNumCategories

      public int getNumCategories(int variable)
    • getProposition

      public Proposition getProposition()
    • isManipulated

      public boolean isManipulated(int nodeIndex)
    • setManipulated

      public void setManipulated(int nodeIndex, boolean manipulated)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hasNoEvidence

      public boolean hasNoEvidence(int variable)
    • getVariablesInEvidence

      public List<Node> getVariablesInEvidence()
      Returns:
      the variable for which there is evidence.
    • getCategory

      public String getCategory(Node node, int j)
    • isIncompatibleWith

      public boolean isIncompatibleWith(VariableSource variableSource)
      Returna true just in case this evidence has a list of variables equal to those of the given variable source.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object