Class CPrecedence
java.lang.Object
org.btrplace.scheduler.choco.constraint.migration.CPrecedence
- All Implemented Interfaces:
ChocoConstraint
,Injectable
,MisplacedVMsEstimator
public class CPrecedence extends Object implements ChocoConstraint
Choco implementation of the
Precedence
constraint.- Author:
- Vincent Kherbache
-
Constructor Summary
Constructors Constructor Description CPrecedence(Precedence pr)
Make a new constraint. -
Method Summary
Modifier and Type Method Description Set<VM>
getMisPlacedVMs(Instance i)
Get the VMs that are supposed to be mis-placed.boolean
inject(Parameters ps, ReconfigurationProblem rp)
Inject the constraint into the problem.
-
Constructor Details
-
CPrecedence
Make a new constraint.- Parameters:
pr
- the Precedence constraint to rely on
-
-
Method Details
-
inject
Description copied from interface:Injectable
Inject the constraint into the problem.- Specified by:
inject
in interfaceInjectable
- Parameters:
ps
- the scheduler parametersrp
- the problem- Returns:
true
if the injection succeeded,false
if the problem is sure to not have a solution- Throws:
SchedulerException
- if an error occurred while injecting.
-
getMisPlacedVMs
Description copied from interface:MisplacedVMsEstimator
Get the VMs that are supposed to be mis-placed.- Specified by:
getMisPlacedVMs
in interfaceMisplacedVMsEstimator
- Parameters:
i
- the instance to inspect- Returns:
- a set of VMs identifier that may be empty (when no VMs are misplaced)
-