Class VmScalingAbstract

java.lang.Object
org.cloudsimplus.autoscaling.VmScalingAbstract
All Implemented Interfaces:
VmScaling
Direct Known Subclasses:
HorizontalVmScalingSimple, VerticalVmScalingSimple

public abstract class VmScalingAbstract
extends Object
implements VmScaling
A base class for implementing HorizontalVmScaling and VerticalVmScaling.
Since:
CloudSim Plus 1.1.0
Author:
Manoel Campos da Silva Filho
  • Constructor Details

    • VmScalingAbstract

      protected VmScalingAbstract()
  • Method Details

    • getVm

      public Vm getVm()
      Description copied from interface: VmScaling
      Gets the Vm that this Load Balancer is linked to.
      Specified by:
      getVm in interface VmScaling
      Returns:
    • setVm

      public final VmScaling setVm​(Vm vm)
      Description copied from interface: VmScaling
      Sets a Vm to this Load Balancer. The broker will call this Load Balancer in order to balance load when its Vm is over utilized.

      When the VmScaling is assigned to a Vm, the Vm sets itself to the VmScaling object, creating an association between the two objects.

      Specified by:
      setVm in interface VmScaling
      Parameters:
      vm - the Vm to set
      Returns:
    • isTimeToCheckPredicate

      protected boolean isTimeToCheckPredicate​(double time)
      Checks if it is time to evaluate weather the Vm is under or overloaded.
      Parameters:
      time - current simulation time
      Returns:
      true if it's time to check weather the Vm is over and underloaded, false otherwise
    • requestUpScaling

      protected abstract boolean requestUpScaling​(double time)
      Performs the actual request to scale the Vm up or down, depending if it is over or underloaded, respectively. This method is automatically called by VmScaling.requestUpScalingIfPredicateMatches(org.cloudsimplus.listeners.VmHostEventInfo) when it is verified that the Vm is over or underloaded.
      Parameters:
      time - current simulation time
      Returns:
      true if the request was actually sent, false otherwise
    • setLastProcessingTime

      protected void setLastProcessingTime​(double lastProcessingTime)
      Sets the last time the scheduler checked for VM overload.
      Parameters:
      lastProcessingTime - the processing time to set