omnics.filter
Class ArcConsistency

java.lang.Object
  extended by omnics.AbstractAlgorithm
      extended by omnics.filter.AbstractFilter
          extended by omnics.filter.ArcConsistency
All Implemented Interfaces:
java.io.Serializable, Algorithm, Filter
Direct Known Subclasses:
GeneralArcConsistency

public abstract class ArcConsistency
extends AbstractFilter

Abstract class that offers support for creating global filters that maintain the arc-consistency of the constraint network beeing solved.

Author:
Cristian Frasinaru
See Also:
Serialized Form

Field Summary
protected  ConstraintSet[][] constraints
           
protected  Var current
           
protected  Explainer explainer
           
protected  boolean firingEvents
           
protected  int level
           
protected  int optimum
           
protected  Tuple solution
           
protected  SystematicSolver solver
           
 
Fields inherited from class omnics.filter.AbstractFilter
filtered
 
Fields inherited from class omnics.AbstractAlgorithm
name, problem
 
Constructor Summary
ArcConsistency(Problem problem)
          Creates a new instance of ArcConsistency.
 
Method Summary
 void createConstraintsMatrix()
          The constraint matrix has at row x.index and column y.index the constraints that contain both x and y.
 boolean filter(Var current)
          Performs an arc-consistency algorithm.
protected  boolean revise(Var x, Var y)
           
 
Methods inherited from class omnics.filter.AbstractFilter
getFiltered, setFiltered
 
Methods inherited from class omnics.AbstractAlgorithm
getName, getProblem, setName, setProblem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface omnics.Algorithm
getName, getProblem, setName, setProblem
 

Field Detail

current

protected Var current

constraints

protected ConstraintSet[][] constraints

solution

protected Tuple solution

solver

protected SystematicSolver solver

optimum

protected int optimum

level

protected int level

explainer

protected Explainer explainer

firingEvents

protected boolean firingEvents
Constructor Detail

ArcConsistency

public ArcConsistency(Problem problem)
Creates a new instance of ArcConsistency.

Parameters:
problem - a constraint satisfaction problem
Method Detail

createConstraintsMatrix

public void createConstraintsMatrix()
The constraint matrix has at row x.index and column y.index the constraints that contain both x and y.


filter

public boolean filter(Var current)
Performs an arc-consistency algorithm.

Specified by:
filter in interface Filter
Specified by:
filter in class AbstractFilter

revise

protected boolean revise(Var x,
                         Var y)