Class IndependenceFacts

java.lang.Object
edu.cmu.tetrad.data.IndependenceFacts
All Implemented Interfaces:
DataModel, KnowledgeTransferable, VariableSource, TetradSerializable, Serializable

public class IndependenceFacts extends Object implements DataModel
Stores a list of independence facts.
Version:
$Id: $Id
Author:
josephramsey
See Also:
  • Constructor Details

    • IndependenceFacts

      public IndependenceFacts()

      Constructor for IndependenceFacts.

    • IndependenceFacts

      public IndependenceFacts(Graph graph)

      Constructor for IndependenceFacts.

      Parameters:
      graph - a Graph object
    • IndependenceFacts

      public IndependenceFacts(IndependenceFacts facts)

      Constructor for IndependenceFacts.

      Parameters:
      facts - a IndependenceFacts object
  • Method Details

    • serializableInstance

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

      public void add(IndependenceFact fact)

      add.

      Parameters:
      fact - a IndependenceFact object
    • toString

      public String toString()

      toString.

      Specified by:
      toString in interface DataModel
      Overrides:
      toString in class Object
      Returns:
      a String object
    • isContinuous

      public boolean isContinuous()

      isContinuous.

      Specified by:
      isContinuous in interface DataModel
      Returns:
      true if the data model is continuous, false otherwise.
    • isDiscrete

      public boolean isDiscrete()

      isDiscrete.

      Specified by:
      isDiscrete in interface DataModel
      Returns:
      true if the data model is discrete, false otherwise.
    • isMixed

      public boolean isMixed()

      isMixed.

      Specified by:
      isMixed in interface DataModel
      Returns:
      true if the data model is mixed continuous/discrete, false otherwise.
    • getVariable

      public Node getVariable(String name)

      getVariable.

      Specified by:
      getVariable in interface DataModel
      Parameters:
      name - a String object
      Returns:
      the variable with the given name, or null if no such variable exists.
    • copy

      public DataModel copy()

      copy.

      Specified by:
      copy in interface DataModel
      Returns:
      a copy of the data model.
    • remove

      public void remove(IndependenceFact fact)

      remove.

      Parameters:
      fact - a IndependenceFact object
    • getName

      public String getName()

      Getter for the field name.

      Specified by:
      getName in interface DataModel
      Returns:
      a String object
    • setName

      public void setName(String name)
      Sets the name of the data model (may be null).
      Specified by:
      setName in interface DataModel
      Parameters:
      name - the name to set
    • isIndependent

      public boolean isIndependent(Node x, Node y, Node... z)

      isIndependent.

      Parameters:
      x - a Node object
      y - a Node object
      z - a Node object
      Returns:
      a boolean
    • isIndependent

      public boolean isIndependent(Node x, Node y, Set<Node> z)

      isIndependent.

      Parameters:
      x - a Node object
      y - a Node object
      z - a Set object
      Returns:
      a boolean
    • getKnowledge

      public Knowledge getKnowledge()

      Getter for the field knowledge.

      Specified by:
      getKnowledge in interface KnowledgeTransferable
      Returns:
      a Knowledge object
    • setKnowledge

      public void setKnowledge(Knowledge knowledge)
      Sets knowledge to a copy of the given object.
      Specified by:
      setKnowledge in interface KnowledgeTransferable
      Parameters:
      knowledge - the knowledge to set
    • getVariables

      public List<Node> getVariables()

      getVariables.

      Specified by:
      getVariables in interface VariableSource
      Returns:
      a List object
    • getVariableNames

      public List<String> getVariableNames()

      getVariableNames.

      Specified by:
      getVariableNames in interface VariableSource
      Returns:
      a List object
    • setNodes

      public void setNodes(List<Node> nodes)

      Setter for the field nodes.

      Parameters:
      nodes - a List object
    • size

      public int size()

      size.

      Returns:
      a int
    • getFacts

      public List<IndependenceFact> getFacts()

      getFacts.

      Returns:
      a List object