Package org.jacop.search
Class FailConstraintsStatistics<T extends Var>
- java.lang.Object
-
- org.jacop.search.FailConstraintsStatistics<T>
-
- All Implemented Interfaces:
ConsistencyListener
public class FailConstraintsStatistics<T extends Var> extends java.lang.Object implements ConsistencyListener
Defines functionality for FailConstraintsStatistics plug-in, that collects statistics on the failed constraints; both for each individual constraint as well as a class of constraints.- Version:
- 4.8
-
-
Field Summary
Fields Modifier and Type Field Description java.util.Map<java.lang.String,java.lang.Integer>
failConstraintsIdStatistics
java.util.Map<java.lang.String,java.lang.Integer>
failConstraintsStatistics
long
otherFails
(package private) Store
store
-
Constructor Summary
Constructors Constructor Description FailConstraintsStatistics(Store s)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
collectFailStatistics(Constraint currentConstraint)
boolean
executeAfterConsistency(boolean consistent)
It is executed right after consistency of the current search node.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).private static java.util.List<java.util.Map.Entry<java.lang.String,java.lang.Integer>>
sortByValues(java.util.Map<java.lang.String,java.lang.Integer> map)
java.lang.String
toString()
-
-
-
Field Detail
-
failConstraintsStatistics
public java.util.Map<java.lang.String,java.lang.Integer> failConstraintsStatistics
-
failConstraintsIdStatistics
public java.util.Map<java.lang.String,java.lang.Integer> failConstraintsIdStatistics
-
otherFails
public long otherFails
-
store
Store store
-
-
Constructor Detail
-
FailConstraintsStatistics
public FailConstraintsStatistics(Store s)
-
-
Method Detail
-
executeAfterConsistency
public boolean executeAfterConsistency(boolean consistent)
Description copied from interface:ConsistencyListener
It is executed right after consistency of the current search node. Returning true when the parameter was false is not advised as things like invalid solutions can be found.- 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.
-
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.
-
collectFailStatistics
void collectFailStatistics(Constraint currentConstraint)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
sortByValues
private static java.util.List<java.util.Map.Entry<java.lang.String,java.lang.Integer>> sortByValues(java.util.Map<java.lang.String,java.lang.Integer> map)
-
-