Package org.btrplace.model.constraint
Interface SatConstraint
- All Superinterfaces:
Constraint
- All Known Implementing Classes:
Among
,Ban
,Deadline
,Fence
,Gather
,Killed
,Lonely
,MaxOnline
,NoDelay
,Offline
,Online
,Overbook
,Precedence
,Preserve
,Quarantine
,Ready
,ResourceCapacity
,Root
,Running
,RunningCapacity
,Schedule
,Seq
,Serialize
,SimpleConstraint
,Sleeping
,Split
,SplitAmong
,Spread
,Sync
public interface SatConstraint extends Constraint
Abstract class to characterize a satisfaction-oriented constraint
that impose a restriction on some components of a model.
The restriction provided by the constraint can be either discrete or continuous.
If the restriction is discrete, then the constraint imposes a restriction on a Model
.
If the restriction is continuous, then the constraint imposes also a restriction on a whole ReconfigurationPlan
.
This may be the action schedule but also all the intermediary models that result from the application of the reconfiguration plan.
A constraint does not necessarily support both continuous or discrete restriction.
- Author:
- Fabien Hermenier
-
Method Summary
Modifier and Type Method Description SatConstraintChecker<? extends SatConstraint>
getChecker()
Get the validator used to check if a plan satisfies the constraint.default Collection<Node>
getInvolvedNodes()
Get the nodes involved in the constraint.default Collection<VM>
getInvolvedVMs()
Get the VMs involved in the constraint.boolean
isContinuous()
Check if the restriction provided by the constraint is continuous.default boolean
isSatisfied(Model i)
Check if a model satisfies the constraint.default boolean
isSatisfied(ReconfigurationPlan p)
Check if a plan satisfies the constraint.boolean
setContinuous(boolean b)
Indicates if the restriction provided by the constraint is continuous.
-
Method Details
-
getInvolvedNodes
Get the nodes involved in the constraint.- Returns:
- a set of nodes identifiers that may be empty
-
getInvolvedVMs
Get the VMs involved in the constraint.- Returns:
- a set of VM identifiers that may be empty
-
isContinuous
boolean isContinuous()Check if the restriction provided by the constraint is continuous.- Returns:
true
for a continuous restriction
-
setContinuous
boolean setContinuous(boolean b)Indicates if the restriction provided by the constraint is continuous.- Parameters:
b
-true
to ask for a continuous satisfaction,false
for a discrete satisfaction.- Returns:
true
iff the parameter has been considered
-
getChecker
SatConstraintChecker<? extends SatConstraint> getChecker()Get the validator used to check if a plan satisfies the constraint.- Returns:
- a non-null
SatConstraintChecker
-
isSatisfied
Check if a model satisfies the constraint. This method is used when the constraint provides only a discrete restriction.- Parameters:
i
- the model to check- Returns:
true
iff the constraint is not violated
-
isSatisfied
Check if a plan satisfies the constraint. This method is only considered when the constraint provides a continuous restriction.- Parameters:
p
- the plan to inspect- Returns:
true
iff the plan satisfies the constraint
-