|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.cp.common.util.preprocessor.AbstractDetector
choco.cp.common.util.preprocessor.AbstractAdvancedDetector
public abstract class AbstractAdvancedDetector
User : cprudhom
Mail : cprudhom(a)emn.fr
Date : 1 avr. 2010br/>
Since : Choco 2.1.1
An abstract class to set the methods of a detector.
A detector analyzes a model and thanks to its analizis, it is allowed to strongly modified the model involved.
Field Summary | |
---|---|
protected gnu.trove.TLongObjectHashMap<Constraint> |
constraintsToAdd
Internal structure to store constraint addition instructions |
protected gnu.trove.TLongObjectHashMap<Constraint> |
constraintsToDelete
Internal structure to store constraint deletion instructions |
protected gnu.trove.TLongObjectHashMap<Variable> |
variablesToAdd
Internal structure to store variable addition instructions |
protected gnu.trove.TLongObjectHashMap<Variable> |
variablesToDelete
Internal structure to store variable deletion instructions |
protected gnu.trove.THashMap<Variable,Variable> |
variablesToReplace
Internal structure to store variable deletion instructions |
Fields inherited from class choco.cp.common.util.preprocessor.AbstractDetector |
---|
LOGGER, model |
Constructor Summary | |
---|---|
protected |
AbstractAdvancedDetector(CPModel model)
|
Method Summary | |
---|---|
protected void |
add(Constraint c)
Add a constraint c to the model which is currently treated by the detector. |
protected void |
add(Variable v)
Add a variable v to the model which is currently treated by the detector. |
abstract void |
apply()
Apply the detection defined within the detector. |
void |
commit()
Send changes detected to the treated model. |
protected void |
delete(Constraint c)
Delete a constraint c to the model which is currently treated by the detector. |
protected void |
delete(Variable v)
Delete a variable v from the model which is currently treated by the detector. |
protected void |
forget(Constraint c)
Remove addition instruction on c . |
protected void |
forget(Variable v)
Remove addition instruction on v . |
protected void |
keep(Constraint c)
Remove deletion instruction on c . |
protected void |
keep(Variable v)
Remove deletion instruction on v . |
protected void |
replaceBy(Variable outVar,
Variable inVar)
Replace outVar by inVar in every constraint where outVar is involved. |
void |
rollback()
Remove all uncommited instructions. |
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 |
Field Detail |
---|
protected final gnu.trove.TLongObjectHashMap<Constraint> constraintsToAdd
protected final gnu.trove.TLongObjectHashMap<Constraint> constraintsToDelete
protected final gnu.trove.TLongObjectHashMap<Variable> variablesToAdd
protected final gnu.trove.TLongObjectHashMap<Variable> variablesToDelete
protected final gnu.trove.THashMap<Variable,Variable> variablesToReplace
Constructor Detail |
---|
protected AbstractAdvancedDetector(CPModel model)
Method Detail |
---|
public abstract void apply()
apply
in class AbstractDetector
protected final void add(Constraint c)
c
to the model which is currently treated by the detector.commit()
.
c
- contraint to addprotected final void delete(Constraint c)
c
to the model which is currently treated by the detector.commit()
.
c
- contraint to deleteprotected final void keep(Constraint c)
c
.
c
- contraint to keepprotected final void forget(Constraint c)
c
.
c
- contraint to not addprotected final void add(Variable v)
v
to the model which is currently treated by the detector.commit()
.
v
- variable to addprotected final void delete(Variable v)
v
from the model which is currently treated by the detector.commit()
.
v
- variable to deleteprotected final void keep(Variable v)
v
.
v
- variable to keepprotected final void forget(Variable v)
v
.
v
- contraint to not addprotected final void replaceBy(Variable outVar, Variable inVar)
outVar
by inVar
in every constraint where outVar
is involved.
outVar
- deleted variableinVar
- the substitutepublic final void commit()
commit
in class AbstractDetector
public final void rollback()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |