Class PowerMeter

java.lang.Object
org.cloudsimplus.core.CloudSimEntity
org.cloudsimplus.power.PowerMeter
All Implemented Interfaces:
Comparable<SimEntity>, Runnable, Identifiable, Nameable, SimEntity

public class PowerMeter extends CloudSimEntity
Periodically measures the current power usage of one or more PowerAware entities, according to a defined
invalid reference
interval
, storing the results. PowerAware entities include Hosts and Datacenters.
Since:
CloudSim Plus 6.0.0
See Also:
  • invalid reference
    #getPowerMeasurements()
  • Constructor Details

    • PowerMeter

      public PowerMeter(Simulation simulation, PowerAware<? extends PowerModel> powerAwareEntity)
      Initializes a PowerMeter to periodically measure power consumption of a single PowerAware entity.
      Parameters:
      simulation - the simulation instance the Entity is related to
      powerAwareEntity - an entity to have its power consumption measured
    • PowerMeter

      public PowerMeter(Simulation simulation, List<? extends PowerAware<? extends PowerModel>> powerAwareEntities)
      Initializes a PowerMeter to periodically measure the combined power consumption of a list of PowerAware entities.

      If you want to compute power consumption individually for each entity, check PowerMeter(Simulation, PowerAware).

      Parameters:
      simulation - the simulation instance the Entity is related to
      powerAwareEntities - a list of entities to have their combined power consumption measured
    • PowerMeter

      public PowerMeter(Simulation simulation, @NonNull @NonNull Supplier<List<? extends PowerAware<? extends PowerModel>>> powerAwareEntitiesSupplier)
      Initializes a PowerMeter with a function that supplies a list of PowerAware entities to have their combined power consumption periodically measured. This is useful if the list of entities varies during the simulation run.

      If you want to compute power consumption individually for each entity, check PowerMeter(Simulation, PowerAware).

      Parameters:
      simulation - the simulation instance the Entity is related to
      powerAwareEntitiesSupplier - a Supplier that provides a list of entities to have their combined power consumption measured
  • Method Details

    • startInternal

      protected void startInternal()
      Description copied from class: CloudSimEntity
      Defines the logic to be performed by the entity when the simulation starts.
      Specified by:
      startInternal in class CloudSimEntity
    • processEvent

      public void processEvent(SimEvent evt)
      Description copied from interface: SimEntity
      Processes events or services that are available for the entity. This method is invoked, by the CloudSimPlus class, whenever there is an event in the deferred queue that needs to be processed by the entity.
      Parameters:
      evt - information about the event just happened
    • setMeasurementInterval

      public PowerMeter setMeasurementInterval(double measurementInterval)
      Sets the time interval to collect power measurements.
      Parameters:
      measurementInterval - the value to set (in seconds)
      Returns:
      this object