use of org.btrplace.scheduler.choco.constraint.ChocoMapper in project scheduler by btrplace.
the class InstanceSolverRunner method makeViews.
private List<ChocoView> makeViews() throws SchedulerException {
List<ChocoView> l = new ArrayList<>();
ChocoMapper mapper = params.getMapper();
origin.getViews().stream().filter(v -> mapper.viewHasMapping(v.getClass())).forEach(v -> l.add(mapper.get(v)));
return l;
}
use of org.btrplace.scheduler.choco.constraint.ChocoMapper in project scheduler by btrplace.
the class InstanceSolverRunner method build.
/**
* Build a sat constraint
*
* @param cstr the model-side constraint
* @return the solver-side constraint
* @throws SchedulerException if the process failed
*/
private ChocoConstraint build(Constraint cstr) throws SchedulerException {
ChocoMapper mapper = params.getMapper();
ChocoConstraint cc = mapper.get(cstr);
if (cc == null) {
throw new SchedulerModelingException(origin, "No implementation mapped to '" + cstr.getClass().getSimpleName() + "'");
}
return cc;
}
Aggregations