use of org.chocosolver.solver.search.strategy.selectors.values.IntValueSelector in project scheduler by btrplace.
the class CMinMigrations method placeVMs.
/*
* Try to place the VMs associated on the actions in a random node while trying first to stay on the current node
*/
private void placeVMs(Parameters ps, List<AbstractStrategy<?>> strategies, List<VMTransition> actions, OnStableNodeFirst schedHeuristic, Map<IntVar, VM> map) {
IntValueSelector rnd = new WorstFit(map, rp, new BiggestDimension());
if (!useResources) {
rnd = new RandomVMPlacement(rp, map, true, ps.getRandomSeed());
}
IntVar[] hosts = dSlices(actions).map(Slice::getHoster).filter(v -> !v.isInstantiated()).toArray(IntVar[]::new);
if (hosts.length > 0) {
strategies.add(new IntStrategy(hosts, new HostingVariableSelector(rp.getModel(), schedHeuristic), rnd));
}
}
use of org.chocosolver.solver.search.strategy.selectors.values.IntValueSelector in project scheduler by btrplace.
the class CMinMTTR method placeVMs.
/*
* Try to place the VMs associated on the actions in a random node while trying first to stay on the current node
*/
private void placeVMs(Parameters ps, List<AbstractStrategy<?>> strategies, List<VMTransition> actions, OnStableNodeFirst schedHeuristic, Map<IntVar, VM> map) {
IntValueSelector rnd = new WorstFit(map, rp, new BiggestDimension());
if (!useResources) {
rnd = new RandomVMPlacement(rp, map, true, ps.getRandomSeed());
}
IntVar[] hosts = dSlices(actions).map(Slice::getHoster).filter(v -> !v.isInstantiated()).toArray(IntVar[]::new);
if (hosts.length > 0) {
strategies.add(new IntStrategy(hosts, new HostingVariableSelector(rp.getModel(), schedHeuristic), rnd));
}
}
Aggregations