Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the combination of specialised Datacenters, Hosts, VMs and Cloudlets to enable such objects to be both power- and network-aware. #45

manoelcampos opened this issue Dec 14, 2016 · 0 comments


Copy link

@manoelcampos manoelcampos commented Dec 14, 2016


Interfaces such as Datacenter, Host, Vm and Cloudlet have different implementing classes that provide specialised behaviour such as either network-enabled or power-aware objects. However, using inheritance to implement different kinds of such objects limits the use of just one kind of object at a given simulation. For instance, it is not possible to have a network and power-aware kind of Host. The only way would be creating a new NetworkPowerHost class that join the behaviour of both hosts.

Detailed information about how the feature should work

There must be just the basic DatacenterSimple, HostSimple, VmSimple and CloudletSimple classes. The complementary behaviour must be provided using composition instead of inheritance. This way, any object will be allowed to have multiple behaviours, such as network or power consumption. New behaviours would even be added at runtime when an object is instantiated.

An example scenario where this feature should be used

It would be possible to build a simulation that aims to assess the power consumption of network-enabled objects such as Datacenters, Hosts and VMs.

A brief explanation of why you think this feature is useful

This feature will move CloudSim Plus to a next level, allowing the composition of different behaviours for simulation objects and then the modelling of even more realistic simulation scenarios.
It will allow defining different behaviour classes such as Network, Power and so on that could be mixed together in any way and number.

Examples Included

More Information

CloudSim Plus 2.0.0 Release Notes

@manoelcampos manoelcampos modified the milestone: CloudSim Plus 2.0 Dec 14, 2016
manoelcampos added a commit that referenced this issue Apr 20, 2018
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.
  Duplicated code between different classes were 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
  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 manoelcampos self-assigned this Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant