Class GraphChange

java.lang.Object
edu.cmu.tetrad.search.work_in_progress.GraphChange

public class GraphChange extends Object

Provides s a data structure created mainly for use in the ION search algorithm. However, it models a general concept: storage for a variety of seperate changes one could possibly apply to a PAG.

By convention, the NodePairs in the orients ArrayList are ordered such that Node1 is the "from" node and Node2 is the "to" node (ie 1 o-> 2).

Author:
Trevor Burns
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor, holds no changes.
    Copy constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addCollider(Triple colliderTrip)
    Add another collider operation to the GraphChange.
    void
    addNonCollider(Triple nonColliderTrip)
    Add another non-collider operation to the GraphChange.
    void
    addOrient(Node from, Node to)
    Add another orient operation to the GraphChange.
    void
    addRemove(Edge removalEdge)
    Add another remove operation to the GraphChange.
    applyTo(Graph graph)
    Outputs a new PAG, a copy of the input excepting the applied changes of this object.
    boolean
    Contains is defined such that if the internal strucs of this GraphChange all individually contain the elements in the corresponding strucs of GraphChange gc, then this "contains" gc.
    boolean
    equals(Object other)
    Equals is defined such that if the internal strucs of this GraphChange all individually equal the corresponding strucs of GraphChange gc, then this "equals" gc
    Return colliders
    Return noncolliders
    Return orients
    Return removes
    int
     
    boolean
    Consistency check, nonexhaustive, but catches the most blatant inconsistencies.
    Anly outputs ops which have elements, not empty structures.
    void
    Absorbs all changes from the GraphChange other into the calling GraphChange.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • GraphChange

      public GraphChange()
      Default constructor, holds no changes.
    • GraphChange

      public GraphChange(GraphChange source)
      Copy constructor.
  • Method Details

    • union

      public void union(GraphChange other)
      Absorbs all changes from the GraphChange other into the calling GraphChange.
    • isConsistent

      public boolean isConsistent(GraphChange other)
      Consistency check, nonexhaustive, but catches the most blatant inconsistencies.
    • applyTo

      public Graph applyTo(Graph graph)
      Outputs a new PAG, a copy of the input excepting the applied changes of this object. Will return null if some change fails (ie an obscure inconsistensy).
    • addRemove

      public void addRemove(Edge removalEdge)
      Add another remove operation to the GraphChange.
    • addCollider

      public void addCollider(Triple colliderTrip)
      Add another collider operation to the GraphChange.
    • addNonCollider

      public void addNonCollider(Triple nonColliderTrip)
      Add another non-collider operation to the GraphChange.
    • addOrient

      public void addOrient(Node from, Node to)
      Add another orient operation to the GraphChange.
    • contains

      public boolean contains(GraphChange gc)
      Contains is defined such that if the internal strucs of this GraphChange all individually contain the elements in the corresponding strucs of GraphChange gc, then this "contains" gc.
    • toString

      public String toString()
      Anly outputs ops which have elements, not empty structures.
      Overrides:
      toString in class Object
    • getColliders

      public List<Triple> getColliders()
      Return colliders
    • getNoncolliders

      public List<Triple> getNoncolliders()
      Return noncolliders
    • getRemoves

      public List<Edge> getRemoves()
      Return removes
    • getOrients

      public List<NodePair> getOrients()
      Return orients
    • equals

      public boolean equals(Object other)
      Equals is defined such that if the internal strucs of this GraphChange all individually equal the corresponding strucs of GraphChange gc, then this "equals" gc
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object