Module org.chocosolver
Class DomOverWDeg
- java.lang.Object
-
- org.chocosolver.solver.search.strategy.strategy.AbstractStrategy<IntVar>
-
- org.chocosolver.solver.search.strategy.selectors.variables.DomOverWDeg
-
- All Implemented Interfaces:
IMonitorContradiction
,ISearchMonitor
public class DomOverWDeg extends AbstractStrategy<IntVar> implements IMonitorContradiction
Implementation of DowOverWDeg[1]. [1]: F. Boussemart, F. Hemery, C. Lecoutre, and L. Sais, Boosting Systematic Search by Weighting Constraints, ECAI-04.- Since:
- 12/07/12
- Author:
- Charles Prud'homme
-
-
Field Summary
Fields Modifier and Type Field Description protected IntMap
p2w
Map (propagator - weight), where weight is the number of times the propagator fails.-
Fields inherited from class org.chocosolver.solver.search.strategy.strategy.AbstractStrategy
vars
-
-
Constructor Summary
Constructors Constructor Description DomOverWDeg(IntVar[] variables, long seed, IntValueSelector valueSelector)
Creates a DomOverWDeg variable selector
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Decision<IntVar>
computeDecision(IntVar variable)
Computes a decision to be applied to variable var This method should be implemented in order to use search patternsDecision<IntVar>
getDecision()
Provides access to the current decision in the strategy.boolean
init()
Preparethis
to be used in a search loop The initialization can detect inconsistency, in that case, it returns falsevoid
onContradiction(ContradictionException cex)
void
remove()
Remove the current strategy.-
Methods inherited from class org.chocosolver.solver.search.strategy.strategy.AbstractStrategy
getVariables, makeIntDecision, toString
-
-
-
-
Field Detail
-
p2w
protected IntMap p2w
Map (propagator - weight), where weight is the number of times the propagator fails.
-
-
Constructor Detail
-
DomOverWDeg
public DomOverWDeg(IntVar[] variables, long seed, IntValueSelector valueSelector)
Creates a DomOverWDeg variable selector- Parameters:
variables
- decision variablesseed
- seed for breaking ties randomlyvalueSelector
- a value selector
-
-
Method Detail
-
init
public boolean init()
Description copied from class:AbstractStrategy
Preparethis
to be used in a search loop The initialization can detect inconsistency, in that case, it returns false- Overrides:
init
in classAbstractStrategy<IntVar>
-
remove
public void remove()
Description copied from class:AbstractStrategy
Remove the current strategy. This implies unplugging variable or search monitors.- Overrides:
remove
in classAbstractStrategy<IntVar>
-
onContradiction
public void onContradiction(ContradictionException cex)
- Specified by:
onContradiction
in interfaceIMonitorContradiction
-
computeDecision
public Decision<IntVar> computeDecision(IntVar variable)
Description copied from class:AbstractStrategy
Computes a decision to be applied to variable var This method should be implemented in order to use search patterns- Overrides:
computeDecision
in classAbstractStrategy<IntVar>
- Parameters:
variable
- a variable- Returns:
- a decision to be applied to variable var
-
getDecision
public Decision<IntVar> getDecision()
Description copied from class:AbstractStrategy
Provides access to the current decision in the strategy. If there are no more decision to provide, it returnsnull
.- Specified by:
getDecision
in classAbstractStrategy<IntVar>
- Returns:
- the current decision
-
-