UtilizationModelStochastic

public class UtilizationModelStochastic extends UtilizationModelAbstract

Implements a model, according to which a Cloudlet generates random resource utilization every time frame.

Author:Anton Beloglazov, Manoel Campos da Silva Filho

Constructors

UtilizationModelStochastic

public UtilizationModelStochastic()

Instantiates a new utilization model stochastic that defines the resource utilization in percentage.

UtilizationModelStochastic

public UtilizationModelStochastic(Unit unit)

Instantiates a new utilization model stochastic where the resource utilization is defined in the given unit.

Parameters:
  • unit – the Unit that determines how the resource is used (for instance, if resource usage is defined in percentage of the Vm resource or in absolute values)

UtilizationModelStochastic

public UtilizationModelStochastic(Unit unit, long seed)

Instantiates a new utilization model stochastic using a given seed and where the resource utilization is defined in the given unit.

Parameters:
  • unit – the Unit that determines how the resource is used (for instance, if resource usage is defined in percentage of the Vm resource or in absolute values)
  • seed – the seed to generate the pseudo random utilization values

UtilizationModelStochastic

public UtilizationModelStochastic(long seed)

Instantiates a new utilization model stochastic.

Parameters:
  • seed – the seed to generate the pseudo random utilization values

Methods

getHistory

protected Map<Double, Double> getHistory()

Gets the utilization history map, where each key is a time and each value is the resource utilization in that time.

Returns:the utilization history

getRandomGenerator

public ContinuousDistribution getRandomGenerator()

Gets the random number generator.

Returns:the random number generator

getUtilization

public double getUtilization(double time)

loadHistory

public void loadHistory(String filename)

Load an utilization history from a file.

Parameters:
  • filename – the filename
Throws:
  • IOException – when the file cannot be accessed

saveHistory

public void saveHistory(String filename)

Save the utilization history to a file.

Parameters:
  • filename – the filename
Throws:
  • IOException – when the file cannot be accessed

setHistory

protected final void setHistory(Map<Double, Double> history)

Sets the utilization history map, where each key is a time and each value is the resource utilization in that time.

Parameters:
  • history – the history to set

setRandomGenerator

public final void setRandomGenerator(ContinuousDistribution randomGenerator)

Sets the random number generator.

Parameters:
  • randomGenerator – the new random number generator