Package edu.cmu.tetrad.sem
Class SemProposition
java.lang.Object
edu.cmu.tetrad.sem.SemProposition
- All Implemented Interfaces:
TetradSerializable
,Serializable
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 Summary
ConstructorsConstructorDescriptionSemProposition
(SemIm semIm) Creates a new Proposition which allows all values.SemProposition
(SemProposition proposition) Constructor for SemProposition. -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
getNodeIndex.int
getNumVariables.getSemIm()
Getter for the fieldsemIm
.double
getValue
(int i) getValue.double
getValue.int
hashCode()
hashCode.static SemProposition
Generates a simple exemplar of this class to test serialization.void
setValue
(int i, double value) setValue.void
setValue.static SemProposition
tautology.toString()
toString.
-
Constructor Details
-
SemProposition
Creates a new Proposition which allows all values.- Parameters:
semIm
- aSemIm
object
-
SemProposition
Constructor for SemProposition.
- Parameters:
proposition
- aSemProposition
object
-
-
Method Details
-
tautology
tautology.
- Parameters:
semIm
- aSemIm
object- Returns:
- a
SemProposition
object
-
serializableInstance
Generates a simple exemplar of this class to test serialization.- Returns:
- a
SemProposition
object
-
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
-
hashCode
public int hashCode()hashCode.
-
toString
toString.
-
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 intvalue
- a double
-
getValue
getValue.
- Parameters:
node
- aNode
object- Returns:
- a double
-
setValue
setValue.
- Parameters:
node
- aNode
objectvalue
- a double
-