Class SemProposition

java.lang.Object
edu.cmu.tetrad.sem.SemProposition
All Implemented Interfaces:
TetradSerializable, Serializable

public final class SemProposition extends Object implements TetradSerializable
Represents propositions over the variables of a particular BayesIm describing and event of a fairly general sort--namely, conjunctions of propositions that particular variables take on values from a particular disjunctive list of categories. For example, X1 = 1 or 2 and X2 = 3 and X3 = 1 or 3 and X4 = 2 or 3 or 5. The proposition is created by allowing or disallowing particular categories. Notice that "knowing nothing" about a variable is the same as saying that all categories for that variable are allowed, so the proposition by default allows all categories for all variables--i.e. it is a tautology.
Version:
$Id: $Id
Author:
josephramsey
See Also:
  • Constructor Details

    • SemProposition

      public SemProposition(SemIm semIm)
      Creates a new Proposition which allows all values.
      Parameters:
      semIm - a SemIm object
    • SemProposition

      public SemProposition(SemProposition proposition)

      Constructor for SemProposition.

      Parameters:
      proposition - a SemProposition object
  • Method Details

    • tautology

      public static SemProposition tautology(SemIm semIm)

      tautology.

      Parameters:
      semIm - a SemIm object
      Returns:
      a SemProposition object
    • serializableInstance

      public static SemProposition serializableInstance()
      Generates a simple exemplar of this class to test serialization.
      Returns:
      a SemProposition object
    • getSemIm

      public SemIm getSemIm()

      Getter for the field semIm.

      Returns:
      the Bayes IM that this is a proposition for.
    • getNumVariables

      public int getNumVariables()

      getNumVariables.

      Returns:
      the number of variables for the proposition.
    • getNodeIndex

      public int getNodeIndex()

      getNodeIndex.

      Returns:
      the index of the variable with the given name, or -1 if such a variable does not exist.
    • equals

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

      public int hashCode()

      hashCode.

      Overrides:
      hashCode in class Object
      Returns:
      a int
    • toString

      public String toString()

      toString.

      Overrides:
      toString in class Object
      Returns:
      a String object
    • getValue

      public double getValue(int i)

      getValue.

      Parameters:
      i - a int
      Returns:
      a double
    • setValue

      public void setValue(int i, double value)

      setValue.

      Parameters:
      i - a int
      value - a double
    • getValue

      public double getValue(Node node)

      getValue.

      Parameters:
      node - a Node object
      Returns:
      a double
    • setValue

      public void setValue(Node node, double value)

      setValue.

      Parameters:
      node - a Node object
      value - a double