Module org.chocosolver
Class GreedyBranching
- java.lang.Object
-
- org.chocosolver.solver.search.strategy.strategy.AbstractStrategy
-
- org.chocosolver.solver.search.strategy.strategy.GreedyBranching
-
public class GreedyBranching extends AbstractStrategy
-
-
Field Summary
-
Fields inherited from class org.chocosolver.solver.search.strategy.strategy.AbstractStrategy
vars
-
-
Constructor Summary
Constructors Constructor Description GreedyBranching(AbstractStrategy mainSearch)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Decision
computeDecision(Variable variable)
Computes a decision to be applied to variable var This method should be implemented in order to use search patternsDecision
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
remove()
Remove the current strategy.-
Methods inherited from class org.chocosolver.solver.search.strategy.strategy.AbstractStrategy
getVariables, makeIntDecision, toString
-
-
-
-
Constructor Detail
-
GreedyBranching
public GreedyBranching(AbstractStrategy mainSearch)
-
-
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
-
remove
public void remove()
Description copied from class:AbstractStrategy
Remove the current strategy. This implies unplugging variable or search monitors.- Overrides:
remove
in classAbstractStrategy
-
getDecision
public Decision 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
- Returns:
- the current decision
-
computeDecision
public Decision computeDecision(Variable 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
- Parameters:
variable
- a variable- Returns:
- a decision to be applied to variable var
-
-