public class Search extends Object
Constructor and Description |
---|
Search() |
Modifier and Type | Method and Description |
---|---|
static AbstractStrategy<IntVar> |
activityBasedSearch(IntVar... vars)
Create an Activity based search strategy.
|
static AbstractStrategy<IntVar> |
bestBound(AbstractStrategy formerSearch)
Search heuristic combined with a constraint performing strong consistency on the next decision variable
and branching on the value with the best objective bound (for optimization) and branches on the lower bound for SAT problems.
|
static AbstractStrategy |
conflictOrderingSearch(AbstractStrategy formerSearch)
Use the conflict ordering search as a pluggin to improve a former search heuristic
Should be set after specifying a search strategy.
|
static AbstractStrategy |
defaultSearch(Model model)
Creates a default search strategy for the given model.
|
static AbstractStrategy<IntVar> |
domOverWDegSearch(IntVar... vars)
Assignment strategy which selects a variable according to
DomOverWDeg and assign it to its lower bound |
static AbstractStrategy |
greedySearch(AbstractStrategy search)
Make the input search strategy greedy, that is, decisions can be applied but not refuted.
|
static AbstractStrategy |
ibexSolving(Model model)
Create a strategy which lets Ibex terminates the solving process for the CSP,
once all integer variables have been instantiated.
|
static IntStrategy |
inputOrderLBSearch(IntVar... vars)
Assigns the first non-instantiated variable to its lower bound.
|
static IntStrategy |
inputOrderUBSearch(IntVar... vars)
Assigns the first non-instantiated variable to its upper bound.
|
static AbstractStrategy<IntVar> |
intVarSearch(IntVar... vars)
Builds a default search heuristics of integer variables
Variable selection relies on
domOverWDegSearch(IntVar...)
Value selection relies on InDomainBest for optimization and InDomainMin for satisfaction |
static IntStrategy |
intVarSearch(VariableSelector<IntVar> varSelector,
IntValueSelector valSelector,
DecisionOperator<IntVar> decisionOperator,
IntVar... vars)
Builds your own search strategy based on binary decisions.
|
static IntStrategy |
intVarSearch(VariableSelector<IntVar> varSelector,
IntValueSelector valSelector,
IntVar... vars)
Builds your own assignment strategy based on binary decisions.
|
static AbstractStrategy |
lastConflict(AbstractStrategy formerSearch)
Use the last conflict heuristic as a pluggin to improve a former search heuristic
Should be set after specifying a search strategy.
|
static AbstractStrategy |
lastConflict(AbstractStrategy formerSearch,
int k)
Use the last conflict heuristic as a pluggin to improve a former search heuristic
Should be set after specifying a search strategy.
|
static IntStrategy |
minDomLBSearch(IntVar... vars)
Assigns the non-instantiated variable of smallest domain size to its lower bound.
|
static IntStrategy |
minDomUBSearch(IntVar... vars)
Assigns the non-instantiated variable of smallest domain size to its upper bound.
|
static IntStrategy |
randomSearch(IntVar[] vars,
long seed)
Randomly selects a variable and assigns it to a value randomly taken in
- the domain in case the variable has an enumerated domain
- {LB,UB} (one of the two bounds) in case the domain is bounded
|
static RealStrategy |
realVarSearch(double epsilon,
RealVar... reals)
strategy to branch on real variables by choosing sequentially the next variable domain
to split in two, wrt the middle value.
|
static RealStrategy |
realVarSearch(RealVar... reals)
strategy to branch on real variables by choosing sequentially the next variable domain
to split in two, wrt the middle value.
|
static RealStrategy |
realVarSearch(VariableSelector<RealVar> varS,
RealValueSelector valS,
boolean leftFirst,
RealVar... rvars)
Generic strategy to branch on real variables, based on domain splitting.
|
static RealStrategy |
realVarSearch(VariableSelector<RealVar> varS,
RealValueSelector valS,
double epsilon,
boolean leftFirst,
RealVar... rvars)
Generic strategy to branch on real variables, based on domain splitting.
|
static AbstractStrategy |
sequencer(AbstractStrategy... searches) |
static SetStrategy |
setVarSearch(SetVar... sets)
strategy to branch on sets by choosing the first unfixed variable and forcing its first unfixed value
|
static SetStrategy |
setVarSearch(VariableSelector<SetVar> varS,
SetValueSelector valS,
boolean enforceFirst,
SetVar... sets)
Generic strategy to branch on set variables
|
public static AbstractStrategy lastConflict(AbstractStrategy formerSearch)
public static AbstractStrategy<IntVar> bestBound(AbstractStrategy formerSearch)
formerSearch
- default search to branch on variables (defines the variable selector and the value selector when this does not hold)public static AbstractStrategy lastConflict(AbstractStrategy formerSearch, int k)
k
- the maximum number of conflicts to storepublic static AbstractStrategy conflictOrderingSearch(AbstractStrategy formerSearch)
public static AbstractStrategy greedySearch(AbstractStrategy search)
search
- a search heuristic building branching decisionspublic static AbstractStrategy sequencer(AbstractStrategy... searches)
public static SetStrategy setVarSearch(VariableSelector<SetVar> varS, SetValueSelector valS, boolean enforceFirst, SetVar... sets)
varS
- variable selection strategyvalS
- integer selection strategyenforceFirst
- branching order true = enforce first; false = remove firstsets
- SetVar array to branch onpublic static SetStrategy setVarSearch(SetVar... sets)
sets
- variables to branch onpublic static RealStrategy realVarSearch(VariableSelector<RealVar> varS, RealValueSelector valS, double epsilon, boolean leftFirst, RealVar... rvars)
varS
- variable selection strategyvalS
- strategy to select where to split domainsepsilon
- gap for refutationrvars
- RealVar array to branch onleftFirst
- select left range firstpublic static RealStrategy realVarSearch(double epsilon, RealVar... reals)
epsilon
- gap for refutationreals
- variables to branch onpublic static RealStrategy realVarSearch(VariableSelector<RealVar> varS, RealValueSelector valS, boolean leftFirst, RealVar... rvars)
varS
- variable selection strategyvalS
- strategy to select where to split domainsleftFirst
- select left range firstrvars
- RealVar array to branch onpublic static RealStrategy realVarSearch(RealVar... reals)
Double.MIN_VALUE
reals
- variables to branch onpublic static IntStrategy intVarSearch(VariableSelector<IntVar> varSelector, IntValueSelector valSelector, DecisionOperator<IntVar> decisionOperator, IntVar... vars)
varSelector
- defines how to select a variable to branch on.valSelector
- defines how to select a value in the domain of the selected variabledecisionOperator
- defines how to modify the domain of the selected variable with the selected valuevars
- variables to branch onpublic static IntStrategy intVarSearch(VariableSelector<IntVar> varSelector, IntValueSelector valSelector, IntVar... vars)
varSelector
- defines how to select a variable to branch on.valSelector
- defines how to select a value in the domain of the selected variablevars
- variables to branch onpublic static AbstractStrategy<IntVar> intVarSearch(IntVar... vars)
domOverWDegSearch(IntVar...)
Value selection relies on InDomainBest for optimization and InDomainMin for satisfactionvars
- variables to branch onpublic static AbstractStrategy<IntVar> domOverWDegSearch(IntVar... vars)
DomOverWDeg
and assign it to its lower boundvars
- list of variablespublic static AbstractStrategy<IntVar> activityBasedSearch(IntVar... vars)
"Activity-Based Search for Black-Box Constraint Propagramming Solver",
Laurent Michel and Pascal Van Hentenryck, CPAIOR12.
Uses public static parameters (GAMMA=0.999d, DELTA=0.2d, ALPHA=8, RESTART=1.1d, FORCE_SAMPLING=1)
vars
- collection of variablespublic static IntStrategy randomSearch(IntVar[] vars, long seed)
vars
- list of variablesseed
- a seed for randompublic static IntStrategy inputOrderLBSearch(IntVar... vars)
vars
- list of variablespublic static IntStrategy inputOrderUBSearch(IntVar... vars)
vars
- list of variablespublic static IntStrategy minDomLBSearch(IntVar... vars)
vars
- list of variablespublic static IntStrategy minDomUBSearch(IntVar... vars)
vars
- list of variablespublic static AbstractStrategy defaultSearch(Model model)
model
- a model requiring a default search strategypublic static AbstractStrategy ibexSolving(Model model)
Create a strategy which lets Ibex terminates the solving process for the CSP, once all integer variables have been instantiated.
Note that if the system is not constrained enough, there can be an infinite number of solutions.
For example, solving the function
x,y in [0.0,1.0] with
x + y = 1.0
will return x,y in [0.0,1.0] and not a single solution.
If one wants a unique solution,
calling realVarSearch(RealVar...)
should be considered.
model
- declaring modelCopyright © 2018. All rights reserved.