public abstract class
ResourceManageableAbstractextends ResourceAbstract implements ResourceManageable¶
A class that represents simple resources such as RAM, CPU, Bandwidth or Pe. It stores, for instance, the resource capacity and amount of free available resource.
The class is abstract just to ensure there will be an specific subclass for each kind of resource, allowing to differentiate, for example, a RAM Resource from a BW Resource. The VM class also relies on this differentiation for generically getting a required resource.
Author: Uros Cibej, Anthony Sulistio, Manoel Campos da Silva Filho
protected final boolean
Sets the given amount as available resource.
- newAvailableResource – the new amount of available resource to set
availableResource > 0 and availableResource <= capacity, false otherwise
Sum a given amount (negative or positive) of available (free) resource to the total available resource.
- amountToSum – the amount to sum in the current total available resource. If given a positive number, increases the total available resource; otherwise, decreases the total available resource.
true if the total available resource was changed; false otherwise