hu.mta.sztaki.lpds.cloud.simulator.iaas.constraints
Class ConstantConstraints

java.lang.Object
  extended by hu.mta.sztaki.lpds.cloud.simulator.iaas.constraints.ResourceConstraints
      extended by hu.mta.sztaki.lpds.cloud.simulator.iaas.constraints.ConstantConstraints
All Implemented Interfaces:
Comparable<ResourceConstraints>

public class ConstantConstraints
extends ResourceConstraints

Defines the non-mutable main resource constraints representation

Author:
"Gabor Kecskemeti, Distributed and Parallel Systems Group, University of Innsbruck (c) 2013" "Gabor Kecskemeti, Laboratory of Parallel and Distributed Systems, MTA SZTAKI (c) 2012"

Field Summary
static ConstantConstraints noResources
          Provides easy access to the one and original zero constraints
private  double requiredCPUs
           
private  long requiredMemory
           
private  boolean requiredProcessingIsMinimum
           
private  double requiredProcessingPower
           
private  double totalProcessingPower
           
 
Constructor Summary
ConstantConstraints(double cpu, double processing, boolean isMinimum, long memory)
          The main constructor to define resource constraints
ConstantConstraints(double cpu, double processing, long memory)
          A constructor to define resource constraints with exact amount of resources
ConstantConstraints(ResourceConstraints toCopy)
          Allows to make an arbitrary resourceconstraints object into a constant one
 
Method Summary
 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.
 
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

noResources

public static final ConstantConstraints noResources
Provides easy access to the one and original zero constraints


requiredCPUs

private final double requiredCPUs

requiredProcessingPower

private final double requiredProcessingPower

requiredProcessingIsMinimum

private final boolean requiredProcessingIsMinimum

requiredMemory

private final long requiredMemory

totalProcessingPower

private final double totalProcessingPower
Constructor Detail

ConstantConstraints

public ConstantConstraints(double cpu,
                           double processing,
                           long memory)
A constructor to define resource constraints with exact amount of resources

Parameters:
cpu - number of cores
processing - per core processing power in instructions/tick
memory - number of bytes

ConstantConstraints

public ConstantConstraints(double cpu,
                           double processing,
                           boolean isMinimum,
                           long memory)
The main constructor to define resource constraints

Parameters:
cpu - number of cores
processing - per core processing power in instructions/tick
isMinimum -
  • true if the constraints define an absolute minimum (i.e., the constraints object could represent any exact constraints object with at least as much memory/processors)
  • false if the constraints defined here are exactly defined no difference from them are accepted.
memory - number of bytes

ConstantConstraints

public ConstantConstraints(ResourceConstraints toCopy)
Allows to make an arbitrary resourceconstraints object into a constant one

Parameters:
toCopy - the other resource constraints to copy
Method Detail

getRequiredCPUs

public double getRequiredCPUs()
Description copied from class: ResourceConstraints
Allows to query how many CPUs this constraints object represent

Specified by:
getRequiredCPUs in class ResourceConstraints
Returns:
the amount of CPU cores represented by the object

getRequiredProcessingPower

public double getRequiredProcessingPower()
Description copied from class: ResourceConstraints
Allows to query the performance of a single CPU core represented by this constraints object represent

Specified by:
getRequiredProcessingPower in class ResourceConstraints
Returns:
the performance of a CPU core in instructions/tick

isRequiredProcessingIsMinimum

public boolean isRequiredProcessingIsMinimum()
Description copied from class: ResourceConstraints
Determines if the specified amounts of resources are minimally or exactly required.

Specified by:
isRequiredProcessingIsMinimum in class ResourceConstraints
Returns:
  • true if the specified amount of resources could be over-fulfilled
  • false if the object represents an exact amount of resources

getRequiredMemory

public long getRequiredMemory()
Description copied from class: ResourceConstraints
Allows to query how much memory this constraints object represent

Specified by:
getRequiredMemory in class ResourceConstraints
Returns:
the amount in bytes

getTotalProcessingPower

public double getTotalProcessingPower()
Description copied from class: ResourceConstraints
The total processing power of all cores represented by this constraints object: total=cpus*processingpower

Specified by:
getTotalProcessingPower in class ResourceConstraints
Returns:
the total processing power in instructions/tick


Copyright © 2012–2015 University of Innsbruck & MTA SZTAKI. All rights reserved.