-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Implementing a synchronous simulation #205
Comments
Hello @pkoperek
Thank you. Really appreciated.
Probably what you're looking for is the CloudSim.terminateAt() method. It enables you to keep the simulation running until a defined time in seconds. Check KeepSimulationRunningExample.java.
This can be achieved using lots of CloudSim Plus event listeners available across multiple classes, as can be seen in the listeners package. There are some examples available here. You can schedule more cloudlets or other actions easily. Just check the examples here.
I think the examples I mentioned enable you to perform what you need. If not, give me more details and I'll try to help you.
I think it's great. A lot of new algorithms may come up from this approach.
I saw you've created a python gateway for CloudSim Plus. It's really great. I just didn't see how to use it, or some examples. Finally, I'll be thankful if you could include a link to http://cloudsimplus.org in your repositories that mention CloudSim Plus. If you need anything that I can help, feel free to keep in touch. |
You may also be interested in CloudSim Plus Automation, a tool that enables creating simulation scenarios from a YAML file and executing in CloudSim Plus. |
Hi @manoelcampos ! Thanks for the information - need to read through it. I'm just starting with the project - as you might have noticed right now it is just a rather ugly hack which works under very specific conditions :). I'll add some more info in the next few days (i'll make sure to include link to you project). Thanks and regards. |
Hi @manoelcampos , I had a look at the example you pointed to. What I'm looking for is something slightly different. In simulation.terminateAt(TIME_TO_TERMINATE_SIMULATION); and then in order to interact with the simulation, you use listeners. What I'm looking for on the other hand is to do something similar to this: CloudSim cloudsim = new CloudSim();
// prepare simulation objects
cloudsim.startRunning(); // set running to true internally
while(cloudsim.isRunning()) {
cloudsim.pause(cloudsim.clock() + 1.0);
cloudsim.resume();
} I think part of the issue is how the event loop works: I think it jumps between distant events of the simulation if nothing happens between them. In the example from README the processing is like this:
Does that make sense to you? If yes, what would be your recommended way of implementing this? I came up with two approaches:
What do you think? Cheers, |
Hello @pkoperek I can see a couple of scenarios this feature can be used. It will provide more freedom to the researcher in the way to interact with the simulation and collect data. It's an alternative to listeners, making data collection even easier. For large scale simulations, too many listeners might reduce simulation performance and I've been tackling performance issues for a while. Could you present some other utilization scenarios? About the utilization of this feature, I think it would be like below: CloudSim cloudsim = new CloudSim();
// prepare simulation objects
cloudsim.startSync();
while(cloudsim.isRunning()) {
cloudsim.runFor(1.0); //run for 1 second
// perform any desired operations, such as data collection
}
cloudsim.finalizeSimulation(); The issue here is the requirement to call I think it's a nice feature and we can move on to include it in CloudSim Plus. I'm going to review your PR and give you some feedback. Thanks for contributing. |
#205 Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
#205 Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Hi!
First of all - I find Cloud Sim Plus very useful - thanks for the great work you're doing!
I plan to use it in a new project and was wondering if the scenario I'm considering could be implemented with use of APIs which the library already exposes, or there would have to be some extensions done.
Detailed information about how the feature should work
I would like to use Cloud Sim Plus environment in a "synchronous" way:
Is that currently possible? If not, where is the best place to start implementing this?
An example scenario where this feature should be used
Using the simulation as an environment for Reinforcement Learning agents where they can observe and interact with simulated cloud resources.
A brief explanation of why you think this feature is useful
I'm doing some research in this area - such mode of execution would be super useful to me.
How to use this feature
This feature basically enables you to run your simulation inside a loop and collect any data you want after each step, as shown in the code snippet below:
The SynchronousSimulationExample1 provides a complete example.
The text was updated successfully, but these errors were encountered: