Class PowerMeter
java.lang.Object
org.cloudsimplus.core.CloudSimEntity
org.cloudsimplus.power.PowerMeter
- All Implemented Interfaces:
Comparable<SimEntity>,Runnable,Identifiable,Nameable,SimEntity
Periodically measures the current power usage of one or more
, storing the results.
PowerAware entities include
PowerAware entities,
according to a defined
invalid reference
interval
Hosts and Datacenters.- Since:
- CloudSim Plus 6.0.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cloudsimplus.core.SimEntity
SimEntity.State -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionPowerMeter(Simulation simulation, @NonNull Supplier<List<? extends PowerAware<? extends PowerModel>>> powerAwareEntitiesSupplier) Initializes aPowerMeterwith a function that supplies a list ofPowerAwareentities to have their combined power consumption periodically measured.PowerMeter(Simulation simulation, List<? extends PowerAware<? extends PowerModel>> powerAwareEntities) Initializes aPowerMeterto periodically measure the combined power consumption of a list ofPowerAwareentities.PowerMeter(Simulation simulation, PowerAware<? extends PowerModel> powerAwareEntity) Initializes aPowerMeterto periodically measure power consumption of a singlePowerAwareentity. -
Method Summary
Modifier and TypeMethodDescriptionvoidprocessEvent(SimEvent evt) Processes events or services that are available for the entity.setMeasurementInterval(double measurementInterval) Sets the time interval to collect power measurements.protected voidDefines the logic to be performed by the entity when the simulation starts.Methods inherited from class org.cloudsimplus.core.CloudSimEntity
cancelEvent, compareTo, getNextEvent, getNextEvent, isAlive, isFinished, isStarted, pause, run, run, schedule, schedule, schedule, schedule, schedule, schedule, scheduleFirst, scheduleFirst, scheduleFirstNow, scheduleFirstNow, scheduleNow, scheduleNow, selectEvent, send, send, sendNow, sendNow, setEventBuffer, setId, setName, shutdown, start, waitForEventMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cloudsimplus.core.Identifiable
getIdMethods inherited from interface org.cloudsimplus.core.SimEntity
getShutdownTime, getSimulation, getStartTime, getState, schedule, setState
-
Constructor Details
-
PowerMeter
Initializes aPowerMeterto periodically measure power consumption of a singlePowerAwareentity.- Parameters:
simulation- the simulation instance the Entity is related topowerAwareEntity- an entity to have its power consumption measured
-
PowerMeter
public PowerMeter(Simulation simulation, List<? extends PowerAware<? extends PowerModel>> powerAwareEntities) Initializes aPowerMeterto periodically measure the combined power consumption of a list ofPowerAwareentities.If you want to compute power consumption individually for each entity, check
PowerMeter(Simulation, PowerAware).- Parameters:
simulation- the simulation instance the Entity is related topowerAwareEntities- 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 aPowerMeterwith a function that supplies a list ofPowerAwareentities 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 topowerAwareEntitiesSupplier- aSupplierthat provides a list of entities to have their combined power consumption measured
-
-
Method Details
-
startInternal
protected void startInternal()Description copied from class:CloudSimEntityDefines the logic to be performed by the entity when the simulation starts.- Specified by:
startInternalin classCloudSimEntity
-
processEvent
Description copied from interface:SimEntityProcesses events or services that are available for the entity. This method is invoked, by theCloudSimPlusclass, 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
Sets the time interval to collect power measurements.- Parameters:
measurementInterval- the value to set (in seconds)- Returns:
- this object
-