|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthu.mta.sztaki.lpds.cloud.simulator.iaas.constraints.ResourceConstraints
hu.mta.sztaki.lpds.cloud.simulator.iaas.constraints.AlterableResourceConstraints
public class AlterableResourceConstraints
Provides an implementation of a resource constraints class that allows in place alterations on its instances
Field Summary | |
---|---|
private double |
requiredCPUs
|
private long |
requiredMemory
|
private boolean |
requiredProcessingIsMinimum
|
private double |
requiredProcessingPower
|
private double |
totalProcessingPower
|
Constructor Summary | |
---|---|
AlterableResourceConstraints(double cpu,
double processing,
boolean isMinimum,
long memory)
The main constructor to define alterable resource constraints |
|
AlterableResourceConstraints(double cpu,
double processing,
long memory)
A constructor to define resource constraints with exact amount of resources to start with |
|
AlterableResourceConstraints(ResourceConstraints toCopy)
Allows to make an arbitrary resourceconstraints object into an alterable one |
Method Summary | |
---|---|
void |
add(List<ResourceConstraints> toAdd)
Allows multiple RC objects to be added to this one with variable parameter length This operation expects a list of RC objects thus it is optimally used when the RC objects are stored in a List anyways. |
void |
add(ResourceConstraints... toAdd)
Allows multiple RC objects to be added to this one with variable parameter length This operation is good when the RC objects are held in an array. |
static AlterableResourceConstraints |
getNoResources()
An easy way to get alterable constraints with zero resources - as a basis for calculations with RCs |
double |
getRequiredCPUs()
Allows to query how many CPUs this constraints object represent |
long |
getRequiredMemory()
Allows to query how much memory this constraints object represent |
double |
getRequiredProcessingPower()
Allows to query the performance of a single CPU core represented by this constraints object represent |
double |
getTotalProcessingPower()
The total processing power of all cores represented by this constraints object: total=cpus*processingpower |
boolean |
isRequiredProcessingIsMinimum()
Determines if the specified amounts of resources are minimally or exactly required. |
void |
multiply(double times)
Allows to increase/decrease the amount of cpu cores and required memory by this constraints object linearly |
private void |
simpleAddition(ResourceConstraints singleAdd)
Allows a single resource constraints object to be added to this one WARNING: this is for internal purposes only. |
void |
singleAdd(ResourceConstraints toAdd)
Allows a single resource constraints object to be added to this one |
void |
subtract(ResourceConstraints what)
Subtracts another RC object from this one |
private void |
updateTotal()
the total processing field is updated with this function. |
Methods inherited from class hu.mta.sztaki.lpds.cloud.simulator.iaas.constraints.ResourceConstraints |
---|
compareTo, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private double requiredCPUs
private double requiredProcessingPower
private boolean requiredProcessingIsMinimum
private long requiredMemory
private double totalProcessingPower
Constructor Detail |
---|
public AlterableResourceConstraints(double cpu, double processing, long memory)
cpu
- number of coresprocessing
- per core processing power in instructions/tickmemory
- number of bytespublic AlterableResourceConstraints(double cpu, double processing, boolean isMinimum, long memory)
cpu
- number of coresprocessing
- per core processing power in instructions/tickisMinimum
- memory
- number of bytespublic AlterableResourceConstraints(ResourceConstraints toCopy)
toCopy
- the other resource constraints to copyMethod Detail |
---|
public static AlterableResourceConstraints getNoResources()
public void multiply(double times)
times
- the number of times the cpu/memory count should be multipliedprivate void simpleAddition(ResourceConstraints singleAdd)
singleAdd
- the other resource constraints object to be added to this onepublic void singleAdd(ResourceConstraints toAdd)
toAdd
- the other resource constraints object to be addedpublic void add(ResourceConstraints... toAdd)
toAdd
- several resource constraints objects to be addedpublic void add(List<ResourceConstraints> toAdd)
toAdd
- A list of several resource constraints objects to be addedpublic void subtract(ResourceConstraints what)
what
- the other party to subtractprivate void updateTotal()
public double getRequiredCPUs()
ResourceConstraints
getRequiredCPUs
in class ResourceConstraints
public double getRequiredProcessingPower()
ResourceConstraints
getRequiredProcessingPower
in class ResourceConstraints
public boolean isRequiredProcessingIsMinimum()
ResourceConstraints
isRequiredProcessingIsMinimum
in class ResourceConstraints
public long getRequiredMemory()
ResourceConstraints
getRequiredMemory
in class ResourceConstraints
public double getTotalProcessingPower()
ResourceConstraints
getTotalProcessingPower
in class ResourceConstraints
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |