public abstract class SatConstraint extends Object implements Constraint
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.
Constructor and Description |
---|
SatConstraint(Collection<VM> v,
Collection<Node> n,
boolean c)
Make a new constraint.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
SatConstraintChecker<?> |
getChecker()
Get the validator used to check if a plan satisfies the constraint.
|
Collection<Node> |
getInvolvedNodes()
Get the nodes involved in the constraint.
|
Collection<VM> |
getInvolvedVMs()
Get the VMs involved in the constraint.
|
int |
hashCode() |
boolean |
isContinuous()
Check if the restriction provided by the constraint is continuous.
|
boolean |
isSatisfied(Model i)
Check if a model satisfies the constraint.
|
boolean |
isSatisfied(ReconfigurationPlan p)
Check if a plan satisfies the constraint.
|
String |
restrictionToString()
Pretty string for a restriction
|
boolean |
setContinuous(boolean b)
Indicates if the restriction provided by the constraint is continuous.
|
public SatConstraint(Collection<VM> v, Collection<Node> n, boolean c)
v
- the involved VMsn
- the involved nodesc
- true
to indicate a continuous restrictionpublic Collection<VM> getInvolvedVMs()
public Collection<Node> getInvolvedNodes()
public boolean isSatisfied(Model i)
i
- the model to checktrue
iff the constraint is not violatedpublic boolean isSatisfied(ReconfigurationPlan p)
p
- the plan to inspecttrue
iff the plan satisfies the constraintpublic boolean setContinuous(boolean b)
b
- true
to ask for a continuous satisfaction, false
for a discrete satisfaction.true
iff the parameter has been consideredpublic boolean isContinuous()
true
for a continuous restrictionpublic SatConstraintChecker<?> getChecker()
SatConstraintChecker
public String restrictionToString()
"continuous"
or "discrete"
depending on the restrictionCopyright © 2015 University of Nice-Sophia Antipolis. All Rights Reserved.