Package org.jacop.search.restart
Class Calculator
java.lang.Object
org.jacop.search.restart.Calculator
- All Implemented Interfaces:
ConsistencyListener
- Direct Known Subclasses:
ConstantCalculator,GeometricCalculator,LinearCalculator,LubyCalculator
Defines interface for a calculator for restart search.
- Version:
- 4.10
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) ConsistencyListener(package private) long(package private) long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanexecuteAfterConsistency(boolean consistent) It is executed right after consistency of the current search node.longlongabstract voidnewLimit()booleanvoidSetting one child listener.voidsetChildrenListeners(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).voidsetFailLimit(int limit)
-
Field Details
-
numberFails
long numberFails -
failLimit
long failLimit -
child
ConsistencyListener child
-
-
Constructor Details
-
Calculator
public Calculator()
-
-
Method Details
-
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:
executeAfterConsistencyin 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
Description copied from interface:ConsistencyListenerEach of the child listeners will be called and the return code from them will be combined (taken into account) by a parent).- Specified by:
setChildrenListenersin interfaceConsistencyListener- Parameters:
children- the children listeners attached to this listener.
-
setChildrenListeners
Description copied from interface:ConsistencyListenerSetting one child listener.- Specified by:
setChildrenListenersin interfaceConsistencyListener- Parameters:
child- the only child listener added to this consistency listener.
-