Search in sources :

Example 1 with ChocoConstraint

use of org.btrplace.scheduler.choco.constraint.ChocoConstraint 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;
}
Also used : ChocoMapper(org.btrplace.scheduler.choco.constraint.ChocoMapper) ChocoConstraint(org.btrplace.scheduler.choco.constraint.ChocoConstraint) SchedulerModelingException(org.btrplace.scheduler.SchedulerModelingException)

Aggregations

SchedulerModelingException (org.btrplace.scheduler.SchedulerModelingException)1 ChocoConstraint (org.btrplace.scheduler.choco.constraint.ChocoConstraint)1 ChocoMapper (org.btrplace.scheduler.choco.constraint.ChocoMapper)1