choco.cp.common.util.preprocessor.detector
Class AbstractIntegerVariableEqualitiesDetector

java.lang.Object
  extended by choco.cp.common.util.preprocessor.AbstractDetector
      extended by choco.cp.common.util.preprocessor.AbstractAdvancedDetector
          extended by choco.cp.common.util.preprocessor.detector.AbstractIntegerVariableEqualitiesDetector
Direct Known Subclasses:
AbstractIntegerVariableEqualitiesDetector.IntegerVariableEqualitiesModelDetector, AbstractIntegerVariableEqualitiesDetector.IntegerVariableEqualitiesSolverDetector

public abstract class AbstractIntegerVariableEqualitiesDetector
extends AbstractAdvancedDetector

User : cprudhom
Mail : cprudhom(a)emn.fr
Date : 1 avr. 2010br/> Since : Choco 2.1.1

A class detector to detect equalities between IntegerVariable within a model.


Nested Class Summary
static class AbstractIntegerVariableEqualitiesDetector.IntegerVariableEqualitiesModelDetector
           
static class AbstractIntegerVariableEqualitiesDetector.IntegerVariableEqualitiesSolverDetector
           
 
Field Summary
 
Fields inherited from class choco.cp.common.util.preprocessor.AbstractAdvancedDetector
constraintsToAdd, constraintsToDelete, variablesToAdd, variablesToDelete, variablesToReplace
 
Fields inherited from class choco.cp.common.util.preprocessor.AbstractDetector
LOGGER, model
 
Constructor Summary
AbstractIntegerVariableEqualitiesDetector(CPModel model)
           
 
Method Summary
protected abstract  void action(Constraint c)
          Do an action on c, depending on implementation.
 void apply()
          Apply the detection defined within the detector.
protected abstract  void apply(int k, int nbIntVars, int[] color, gnu.trove.TIntObjectHashMap<IntegerVariableMerger> domainByColor)
          Merge equal IntegerVariable into a unique one.
 
Methods inherited from class choco.cp.common.util.preprocessor.AbstractAdvancedDetector
add, add, commit, delete, delete, forget, forget, keep, keep, replaceBy, rollback
 
Methods inherited from class choco.cp.common.util.preprocessor.AbstractDetector
applyThenCommit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractIntegerVariableEqualitiesDetector

public AbstractIntegerVariableEqualitiesDetector(CPModel model)
Method Detail

apply

public void apply()
Apply the detection defined within the detector.

Specified by:
apply in class AbstractAdvancedDetector

action

protected abstract void action(Constraint c)
Do an action on c, depending on implementation.

Parameters:
c -

apply

protected abstract void apply(int k,
                              int nbIntVars,
                              int[] color,
                              gnu.trove.TIntObjectHashMap<IntegerVariableMerger> domainByColor)
Merge equal IntegerVariable into a unique one.

Parameters:
k - number of unique variables
nbIntVars - number of integer variable within the model
color - array of indice of unique variables
domainByColor - domain of unique variables


Copyright © 2012. All Rights Reserved.