public class ResourceCapacity extends SatConstraint
The restriction provided by the constraint can be either discrete or continuous. If it is discrete, the constraint only considers the model obtained as the end of the reconfiguration process.
If the restriction is continuous, then the total resource usage must never exceed the given amount, in the source model, during the reconfiguration and at the end.
Constructor and Description |
---|
ResourceCapacity(Node n,
String rc,
int amount)
Make a new discrete constraint on a single node.
|
ResourceCapacity(Node n,
String rc,
int amount,
boolean continuous)
Make a new constraint on a single node.
|
ResourceCapacity(Set<Node> nodes,
String rc,
int amount)
Make a new constraint with a discrete restriction.
|
ResourceCapacity(Set<Node> nodes,
String rc,
int amount,
boolean continuous)
Make a new constraint.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
getAmount()
Get the amount of resources
|
SatConstraintChecker<ResourceCapacity> |
getChecker()
Get the validator used to check if a plan satisfies the constraint.
|
String |
getResource()
Get the resource identifier.
|
int |
hashCode() |
String |
toString() |
getInvolvedNodes, getInvolvedVMs, isContinuous, isSatisfied, isSatisfied, restrictionToString, setContinuous
public ResourceCapacity(Node n, String rc, int amount)
n
- the n involved in the constraintrc
- the resource identifieramount
- the maximum amount of resource consumed by all the VMs running on the given nodes. >= 0public ResourceCapacity(Node n, String rc, int amount, boolean continuous)
n
- the n involved in the constraintrc
- the resource identifieramount
- the maximum amount of resource consumed by all the VMs running on the given nodes. >= 0continuous
- true
for a continuous restriction.public ResourceCapacity(Set<Node> nodes, String rc, int amount)
nodes
- the nodes involved in the constraintrc
- the resource identifieramount
- the maximum amount of resource consumed by all the VMs running on the given nodes. >= 0public ResourceCapacity(Set<Node> nodes, String rc, int amount, boolean continuous)
nodes
- the nodes involved in the constraintrc
- the resource identifieramount
- the maximum amount of resource consumed by all the VMs running on the given nodes. >= 0continuous
- true
for a continuous restriction.public String getResource()
public int getAmount()
public boolean equals(Object o)
equals
in class SatConstraint
public int hashCode()
hashCode
in class SatConstraint
public SatConstraintChecker<ResourceCapacity> getChecker()
SatConstraint
getChecker
in class SatConstraint
SatConstraintChecker
Copyright © 2015 University of Nice-Sophia Antipolis. All Rights Reserved.