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 IntMapp2wMap (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.voidonContradiction(ContradictionException cex)-
Methods inherited from class org.chocosolver.solver.search.strategy.strategy.AbstractStrategy
getVariables, init, 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
-
onContradiction
public void onContradiction(ContradictionException cex)
- Specified by:
onContradictionin interfaceIMonitorContradiction
-
computeDecision
public Decision<IntVar> computeDecision(IntVar variable)
Description copied from class:AbstractStrategyComputes a decision to be applied to variable var This method should be implemented in order to use search patterns- Overrides:
computeDecisionin classAbstractStrategy<IntVar>- Parameters:
variable- a variable- Returns:
- a decision to be applied to variable var
-
getDecision
public Decision<IntVar> getDecision()
Description copied from class:AbstractStrategyProvides access to the current decision in the strategy. If there are no more decision to provide, it returnsnull.- Specified by:
getDecisionin classAbstractStrategy<IntVar>- Returns:
- the current decision
-
-