Class PowerMeter

java.lang.Object
org.cloudbus.cloudsim.core.CloudSimEntity
org.cloudbus.cloudsim.power.PowerMeter
All Implemented Interfaces:
Cloneable, 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 interval, storing the results.
Since:
CloudSim Plus 6.0.0
See Also:
  • 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, 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 CloudSim class whenever there is an event in the deferred queue, which needs to be processed by the entity.
      Parameters:
      evt - information about the event just happened
    • setName

      public PowerMeter setName(String name)
      Description copied from interface: SimEntity
      Sets the Entity name.
      Specified by:
      setName in interface SimEntity
      Overrides:
      setName in class CloudSimEntity
      Parameters:
      name - the new name
      Returns:
    • getPowerMeasurements

      public List<PowerMeasurement> getPowerMeasurements()
      Gets the list of all measurements collected up to now. Each entry is a measurement collected in the defined measurementInterval. If you provided a list of entities on the class constructor, a entry is the combined measurement for those entities.
      Returns:
    • getMeasurementInterval

      public double getMeasurementInterval()
      Gets the time interval to collect power measurements.
      Returns:
    • setMeasurementInterval

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