Closes #45
Redesigns Power Module to enable any Host and VM to have power capacity.
Enables power-aware simulations using regular classes such as
`DatacenterSimple`, `HostSimple` and `VmSimple`.
This way, it automatically allows creating simulations that are both
network- and power-aware by using the network versions of such classes.
- Merges PowerDatacenter into the DatacenterSimple and removes the first one.
Removes useless prints and code.
- Adds PowerSupply interface to concentrate all power consumption data
and operations, enabling any Host to get such an information,
including the PowerModel.
- Merges the PowerHost into the HostSimple and removes the first one.
- Adds VmUtilizationHistory class to store resource utilization history
by a given VM.
- Removes PowerVm and adds an attribute of this class
inside the Vm, in order to store utilization data.
The VmUtilizationHistory.enabled
attribute allows enabling/disabling the data collection
(which is disabled by default to save memory)
- Moves StateHistory from HostDynamicWorkloadSimple to HostSimple
and adds attribute stateHistoryEnabled to allow
enabling or disabling collection and storage of such states
(it is disabled by default).
- Renamed package org.cloudbus.cloudsim.allocationpolicies.power to
org.cloudbus.cloudsim.allocationpolicies.migration and removed
the prefix Power from its classes and interfaces, since these
allocation policies aren't used just for power-aware simulations
anymore, but to enable VM migrations in general.
- Refactors VmAllocationPolicy implementations, mainly
the VmAllocationPolicyAbstract and VmAllocationPolicySimple.
Code duplication between different classes was fixed.
Methods were moved to upper levels to provide a common
implementation for several classes.
Changed the method `Host findHostForVm(final Vm vm)
to `Optional<Host> findHostForVm(final Vm vm)`, making it
to return an Optional to explicitly indicate that a suitable Host
may not be found for a given VM.
The method was defined as protected abstract in the
VmAllocationPolicyAbstract and it's the single method
initially required to be implemented by subclasses of
VmAllocationPolicyAbstract.
These changes pave the way to close issue #76.
- Refactors migration examples and prints CPU utilization and
power usage in MigrationExample2_PowerUsage.
- Exchanges all references from PowerVm to VmSimple
- Exchanged all references from PowerHost to HostSimple
- Exchanged all references from PowerDatacenter to DatacenterSimple
Signed-off-by:
Manoel Campos <manoelcampos@gmail.com>