omnics.expl
Class Explanation

java.lang.Object
  extended by omnics.expl.Explanation

public class Explanation
extends java.lang.Object

Explanation = set of eliminations

Author:
Cristian Frasinaru

Constructor Summary
Explanation(Tuple tuple)
          Creates a new instance of Explanation
 
Method Summary
 void addElimination(Elimination elim)
          Adds an elimination caused by the tuple.
 java.lang.String explain(java.lang.String indent)
          Explains why the tuple is not good.
 java.lang.String explain(Var var, java.lang.Object val, java.lang.String indent)
          Returns an explanation why a variable cannot hava a value;
 Elimination findElimination(Var var, java.lang.Object val)
          Finds the elimination of a value from a domain in the explanation tree, starting from this node up to the root.
 java.util.List<Explanation> getChildren()
          Returns the children of this explanation in the explanations tree created by the solver.
 java.util.List<Elimination> getEliminations()
          Returns the eliminations caused by the tuple.
 Filter getFilter()
          Returns the filter algoritm that provoked a nogood.
 Var getNextVar()
          Returns the variable which was added in the children nodes.
 Explanation getParent()
          Returns the parent of this explanation in the explanations tree created by the solver.
 Tuple getTuple()
          Returns the tuple which is beeing explained.
 Elimination last()
          Returns the last elimination.
 void removeElimination(Elimination elim)
          Removes an eliminations caused by the tuple.
 void setChildren(java.util.List<Explanation> children)
          Sets the children of this explanation in the explanations tree created by the solver.
 void setEliminations(java.util.List<Elimination> eliminations)
          Sets the eliminations caused by the tuple.
 void setFilter(Filter filter)
          Sets the filter algoritm that provoked a nogood.
 void setNextVar(Var nextVar)
          Sets the variable which was added in the children nodes.
 void setParent(Explanation parent)
          Sets the parent of this explanation in the explanations tree created by the solver.
 void setTuple(Tuple tuple)
          Sets the tuple which is beeing explained.
 java.lang.String toString()
          Returns a string representation of this explanation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Explanation

public Explanation(Tuple tuple)
Creates a new instance of Explanation

Method Detail

getTuple

public Tuple getTuple()
Returns the tuple which is beeing explained.


setTuple

public void setTuple(Tuple tuple)
Sets the tuple which is beeing explained.


getEliminations

public java.util.List<Elimination> getEliminations()
Returns the eliminations caused by the tuple.


setEliminations

public void setEliminations(java.util.List<Elimination> eliminations)
Sets the eliminations caused by the tuple.


addElimination

public void addElimination(Elimination elim)
Adds an elimination caused by the tuple.


removeElimination

public void removeElimination(Elimination elim)
Removes an eliminations caused by the tuple.


last

public Elimination last()
Returns the last elimination.


getParent

public Explanation getParent()
Returns the parent of this explanation in the explanations tree created by the solver.


setParent

public void setParent(Explanation parent)
Sets the parent of this explanation in the explanations tree created by the solver.


getChildren

public java.util.List<Explanation> getChildren()
Returns the children of this explanation in the explanations tree created by the solver.


setChildren

public void setChildren(java.util.List<Explanation> children)
Sets the children of this explanation in the explanations tree created by the solver.


getNextVar

public Var getNextVar()
Returns the variable which was added in the children nodes. example: tuple (x=0), children (x=0,y=0), (x=0,y=1): nextVar is y


setNextVar

public void setNextVar(Var nextVar)
Sets the variable which was added in the children nodes. example: tuple (x=0), children (x=0,y=0), (x=0,y=1): nextVar is y


getFilter

public Filter getFilter()
Returns the filter algoritm that provoked a nogood.


setFilter

public void setFilter(Filter filter)
Sets the filter algoritm that provoked a nogood.


toString

public java.lang.String toString()
Returns a string representation of this explanation.

Overrides:
toString in class java.lang.Object

explain

public java.lang.String explain(java.lang.String indent)
Explains why the tuple is not good.


explain

public java.lang.String explain(Var var,
                                java.lang.Object val,
                                java.lang.String indent)
Returns an explanation why a variable cannot hava a value;


findElimination

public Elimination findElimination(Var var,
                                   java.lang.Object val)
Finds the elimination of a value from a domain in the explanation tree, starting from this node up to the root.