Search in sources :

Example 6 with IntStrategy

use of org.chocosolver.solver.search.strategy.strategy.IntStrategy in project scheduler by btrplace.

the class DefaultReconfigurationProblem method defaultHeuristic.

/**
 * A naive heuristic to be sure every variables will be instantiated.
 */
private void defaultHeuristic() {
    IntStrategy intStrat = Search.intVarSearch(new FirstFail(csp), new IntDomainMin(), csp.retrieveIntVars(true));
    SetStrategy setStrat = new SetStrategy(csp.retrieveSetVars(), new InputOrder<>(csp), new SetDomainMin(), true);
    RealStrategy realStrat = new RealStrategy(csp.retrieveRealVars(), new Occurrence<>(), new RealDomainMiddle());
    solver.setSearch(new StrategiesSequencer(intStrat, realStrat, setStrat));
}
Also used : IntStrategy(org.chocosolver.solver.search.strategy.strategy.IntStrategy) IntDomainMin(org.chocosolver.solver.search.strategy.selectors.values.IntDomainMin) FirstFail(org.chocosolver.solver.search.strategy.selectors.variables.FirstFail) RealDomainMiddle(org.chocosolver.solver.search.strategy.selectors.values.RealDomainMiddle) StrategiesSequencer(org.chocosolver.solver.search.strategy.strategy.StrategiesSequencer) SetStrategy(org.chocosolver.solver.search.strategy.strategy.SetStrategy) SetDomainMin(org.chocosolver.solver.search.strategy.selectors.values.SetDomainMin) RealStrategy(org.chocosolver.solver.search.strategy.strategy.RealStrategy)

Aggregations

IntDomainMin (org.chocosolver.solver.search.strategy.selectors.values.IntDomainMin)6 FirstFail (org.chocosolver.solver.search.strategy.selectors.variables.FirstFail)6 IntStrategy (org.chocosolver.solver.search.strategy.strategy.IntStrategy)6 StrategiesSequencer (org.chocosolver.solver.search.strategy.strategy.StrategiesSequencer)6 ArrayList (java.util.ArrayList)5 Objects (java.util.Objects)5 Slice (org.btrplace.scheduler.choco.Slice)5 VMTransition (org.btrplace.scheduler.choco.transition.VMTransition)5 AbstractStrategy (org.chocosolver.solver.search.strategy.strategy.AbstractStrategy)5 IntVar (org.chocosolver.solver.variables.IntVar)5 TObjectIntMap (gnu.trove.map.TObjectIntMap)4 Collections (java.util.Collections)4 HashSet (java.util.HashSet)4 Iterator (java.util.Iterator)4 LinkedList (java.util.LinkedList)4 List (java.util.List)4 Map (java.util.Map)4 Set (java.util.Set)4 Collectors (java.util.stream.Collectors)4 Stream (java.util.stream.Stream)4