UtilizationModelAbstract

public abstract class UtilizationModelAbstract implements UtilizationModel

An abstract implementation of UtilizationModel.

Author:Manoel Campos da Silva Filho

Fields

ALMOST_ZERO

public static final double ALMOST_ZERO

A constant which indicates that values lower or equal to this value will be considered as zero.

Constructors

UtilizationModelAbstract

public UtilizationModelAbstract()

UtilizationModelAbstract

public UtilizationModelAbstract(Unit unit)

Methods

getSimulation

public Simulation getSimulation()

getUnit

public Unit getUnit()

getUtilization

public double getUtilization()

setSimulation

public UtilizationModel setSimulation(Simulation simulation)

setUnit

protected final UtilizationModel setUnit(Unit unit)

Sets the Unit in which the resource utilization is defined.

Parameters:
  • unitUnit to set

validateUtilizationField

protected void validateUtilizationField(String fieldName, double fieldValue)

Checks if a given field has a valid value, considering that the minimum value is zero.

Parameters:
  • fieldName – the name of the field to display at the Exception when the value is invalid
  • fieldValue – the current value of the field

validateUtilizationField

protected void validateUtilizationField(String fieldName, double fieldValue, double minValue)