Package org.btrplace.model.constraint
Class Online
java.lang.Object
org.btrplace.model.constraint.SimpleConstraint
org.btrplace.model.constraint.Online
- All Implemented Interfaces:
Constraint
,SatConstraint
@SideConstraint(args="n : nodes", inv="$nodeState(n) = online") public class Online extends SimpleConstraint
A constraint to force a node at being online.
The constraint is only discrete.
- Author:
- Fabien Hermenier
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description boolean
equals(Object o)
OnlineChecker
getChecker()
Get the validator used to check if a plan satisfies the constraint.Collection<Node>
getInvolvedNodes()
Get the nodes involved in the constraint.int
hashCode()
static List<Online>
newOnline(Collection<Node> nodes)
Instantiate discrete constraints for a collection of nodes.static List<Online>
newOnline(Node... nodes)
Instantiate discrete constraints for a collection of nodes.boolean
setContinuous(boolean b)
Indicates if the restriction provided by the constraint is continuous.String
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.btrplace.model.constraint.SatConstraint
getInvolvedVMs, isSatisfied, isSatisfied
-
Constructor Details
-
Online
Make a new constraint.- Parameters:
n
- the node to set online
-
-
Method Details
-
getChecker
Description copied from interface:SatConstraint
Get the validator used to check if a plan satisfies the constraint.- Returns:
- a non-null
SatConstraintChecker
-
toString
-
setContinuous
public boolean setContinuous(boolean b)Description copied from interface:SatConstraint
Indicates if the restriction provided by the constraint is continuous.- Specified by:
setContinuous
in interfaceSatConstraint
- Overrides:
setContinuous
in classSimpleConstraint
- Parameters:
b
-true
to ask for a continuous satisfaction,false
for a discrete satisfaction.- Returns:
true
iff the parameter has been considered
-
equals
-
hashCode
public int hashCode() -
getInvolvedNodes
Description copied from interface:SatConstraint
Get the nodes involved in the constraint.- Returns:
- a set of nodes identifiers that may be empty
-
newOnline
Instantiate discrete constraints for a collection of nodes.- Parameters:
nodes
- the nodes to integrate- Returns:
- the associated list of constraints
-
newOnline
Instantiate discrete constraints for a collection of nodes.- Parameters:
nodes
- the nodes to integrate- Returns:
- the associated list of constraints
-