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

Enable simulation to keep running for a specific period of time #130

Closed
manoelcampos opened this Issue May 4, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@manoelcampos
Owner

manoelcampos commented May 4, 2018

CloudSim Plus simulations are automatically finished when there is no more event to process.
However, sometimes we need to keep simulation running for a specific period of time, in order to wait for the dynamic arrival of events, such as the creation of Cloudlets and VMs in runtime.

Even though there is a terminateAt(double time) method to specify when the simulation should be finished, if the framework detects there is no more event to process, the simulation is finished anyway.

Detailed information about how the feature should work

The CloudSim class should be updated to enable setting a termination time using the mentioned method and keep the simulation running even if there is no event to process. In this case, it just keeps waiting for new events or for the termination time to be reached in order to terminate the simulation.

An example scenario where this feature should be used

We can create simulations that keep running for a defined time, enabling the dynamic creation of new objects such as Cloudlets and VMs, even after all Cloudlets in the entire simulation have finished. Using such a feature we can, for instance, create an application to simulate a cloud scenario running for 24 hours. Before this feature, the only way to accomplish that was to avoid the simulation to be idle. With this feature, the simulation may become idle anytime, and yet keep running until the termination time is reached.

A brief explanation of why you think this feature is useful

The feature will allow the creation of more realistic scenarios, mainly when the arrival of Cloudlets and VMs are defined randomly. In such a case, the developer doesn't know the arrival time of objects. Therefore, the only way to wait for such events is enabling the simulation to keep running even if it's idle.

Examples Included

@manoelcampos manoelcampos added the feature label May 4, 2018

@manoelcampos manoelcampos self-assigned this May 4, 2018

manoelcampos added a commit that referenced this issue May 17, 2018

Updates #130
- Postpone DatacenterBroker shutdown to the end of
  the simulation when a termination time is set,
  instead of as soon as all cloudlets finish.
  This way, the broker waits for new Cloudlets
  and VMs submitted during simulation runtime,
  even if the broker is idle.
- Updates DatacenterBrokerSimple to request VM destroy during shutdown.
  In situations such as when a simulation termination time is set,
  the broker was kept alive to wait for new Cloudlets and VMs.
  However, this was causing VM destruction to be ignored when
  the broker was shutdown.
- Removes redundant broker attributes and methods.
- Improves information printed by DatacenterBroker.
- Removes unused code from DatacenterBrokerSimple

Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment