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 SummaryConstructorsConstructorDescriptionSemProposition(SemIm semIm) Creates a new Proposition which allows all values.SemProposition(SemProposition proposition) Creates a new SemProposition object by copying the values and semIm from the given proposition.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanCompares this SemProposition object with the specified object for equality.intReturns the index of the node.intReturns the number of variables in the current object.getSemIm()Retrieves the SemIm object associated with this SemProposition.doublegetValue(int i) Retrieves the value at the specified index.doubleRetrieves the value associated with the given node.inthashCode()Calculates the hash code for this object.static SemPropositionGenerates a simple exemplar of this class to test serialization.voidsetValue(int i, double value) Sets the value at the specified index in the array of values.voidSets the value for a given node in the SemProposition object.static SemPropositionCreates a tautology by wrapping the given SemIm object.toString()Returns a string representation of the object.
- 
Constructor Details- 
SemPropositionCreates a new Proposition which allows all values.- Parameters:
- semIm- a- SemImobject
 
- 
SemPropositionCreates a new SemProposition object by copying the values and semIm from the given proposition.- Parameters:
- proposition- the SemProposition object to be copied
 
 
- 
- 
Method Details- 
tautologyCreates a tautology by wrapping the given SemIm object.- Parameters:
- semIm- the SemIm object to be wrapped
- Returns:
- a SemProposition object representing the tautology
 
- 
serializableInstanceGenerates a simple exemplar of this class to test serialization.- Returns:
- a SemPropositionobject
 
- 
getSemImRetrieves the SemIm object associated with this SemProposition.- Returns:
- the SemIm object
 
- 
getNumVariablespublic int getNumVariables()Returns the number of variables in the current object.- Returns:
- the number of variables
 
- 
getNodeIndexpublic int getNodeIndex()Returns the index of the node.- Returns:
- the index of the node
 
- 
equalsCompares this SemProposition object with the specified object for equality.- Overrides:
- equalsin class- Object
- Parameters:
- o- the object to be compared with this SemProposition
- Returns:
- true if the given object is equal to this SemProposition, false otherwise
- Throws:
- IllegalArgumentException- if the given object is not an instance of SemProposition
 
- 
hashCodepublic int hashCode()Calculates the hash code for this object.
- 
toStringReturns a string representation of the object.
- 
getValuepublic double getValue(int i) Retrieves the value at the specified index.- Parameters:
- i- the index of the value to retrieve
- Returns:
- the value at the specified index
 
- 
setValuepublic void setValue(int i, double value) Sets the value at the specified index in the array of values.- Parameters:
- i- the index of the value to set
- value- the value to set
 
- 
getValueRetrieves the value associated with the given node.- Parameters:
- node- the node for which the value is retrieved
- Returns:
- the value associated with the given node
 
- 
setValueSets the value for a given node in the SemProposition object.- Parameters:
- node- the node for which the value is to be set
- value- the value to be assigned to the node
 
 
-