Package org.jacop.search.restart
Class Calculator<T extends Var>
- java.lang.Object
-
- org.jacop.search.restart.Calculator<T>
-
- All Implemented Interfaces:
ConsistencyListener
- Direct Known Subclasses:
ConstantCalculator
,GeometricCalculator
,LinearCalculator
,LubyCalculator
public abstract class Calculator<T extends Var> extends java.lang.Object implements ConsistencyListener
Defines interface for a calculator for restart search- Version:
- 4.7
-
-
Field Summary
Fields Modifier and Type Field Description (package private) ConsistencyListener
child
(package private) long
failLimit
(package private) long
numberFails
-
Constructor Summary
Constructors Constructor Description Calculator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
executeAfterConsistency(boolean consistent)
It is executed right after consistency of the current search node.long
getFailLimit()
long
getNumberFails()
abstract void
newLimit()
boolean
pointsExhausted()
void
setChildrenListeners(ConsistencyListener child)
Setting one child listener.void
setChildrenListeners(ConsistencyListener[] children)
Each of the child listeners will be called and the return code from them will be combined (taken into account) by a parent).void
setFailLimit(int limit)
-
-
-
Field Detail
-
numberFails
long numberFails
-
failLimit
long failLimit
-
child
ConsistencyListener child
-
-
Method Detail
-
newLimit
public abstract void newLimit()
-
executeAfterConsistency
public boolean executeAfterConsistency(boolean consistent)
It is executed right after consistency of the current search node. The return code specifies if the search should continue with or exit the current search node.- Specified by:
executeAfterConsistency
in interfaceConsistencyListener
- Parameters:
consistent
- specifies if the consistency call returned true or false.- Returns:
- true if the search should continue, false if the search should act as the consistency returned false.
-
setFailLimit
public void setFailLimit(int limit)
-
pointsExhausted
public boolean pointsExhausted()
-
getFailLimit
public long getFailLimit()
-
getNumberFails
public long getNumberFails()
-
setChildrenListeners
public void setChildrenListeners(ConsistencyListener[] children)
Description copied from interface:ConsistencyListener
Each of the child listeners will be called and the return code from them will be combined (taken into account) by a parent).- Specified by:
setChildrenListeners
in interfaceConsistencyListener
- Parameters:
children
- the children listeners attached to this listener.
-
setChildrenListeners
public void setChildrenListeners(ConsistencyListener child)
Description copied from interface:ConsistencyListener
Setting one child listener.- Specified by:
setChildrenListeners
in interfaceConsistencyListener
- Parameters:
child
- the only child listener added to this consistency listener.
-
-