Buenas, en (ingles asi seguimos internacionales :-) )
The model I am preparing reproduces the construction of some physic events. Depending on different conditions which are simulated these events take different times to get constructed. So for example if I simulate for 10 virtual seconds the model can build 100 events or 10.000, depending on the conditions (which are randomly simulated).
For getting appropriate average of these construction times, I am interested in simulating until there is a certain number of events constructed (lets say 5000 events constructed). That can happen at different simulated times, so is it possible to stop the simulation when a condition is met?
I have seen that PowerDEVS offer the option to simulate a certain number of steps (DEVS iterations). But I cannot know how many simulations step it will take to construct 5000 events.
I noticed that there is a public setFinalTime in the RootSimulator class. Is it possible to get this instance from within an atomic model? will it work setting that final time to the current time to finish the simulation?
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey, there is no easy way to change the final simulation time.
One nasty way is do that, call the setFinalTime during the simulation. You can set a global pointer in the main function and set it from there.
What you can easily do is run the simulation time with final time 1e15 (infinity) and just have a block call exit (the Unix syscall) when the finalization condition is met. You could write to a file/log the results before doing so.
Let me know how it goes!
Fede
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Buenas, en (ingles asi seguimos internacionales :-) )
The model I am preparing reproduces the construction of some physic events. Depending on different conditions which are simulated these events take different times to get constructed. So for example if I simulate for 10 virtual seconds the model can build 100 events or 10.000, depending on the conditions (which are randomly simulated).
For getting appropriate average of these construction times, I am interested in simulating until there is a certain number of events constructed (lets say 5000 events constructed). That can happen at different simulated times, so is it possible to stop the simulation when a condition is met?
I have seen that PowerDEVS offer the option to simulate a certain number of steps (DEVS iterations). But I cannot know how many simulations step it will take to construct 5000 events.
I noticed that there is a public setFinalTime in the RootSimulator class. Is it possible to get this instance from within an atomic model? will it work setting that final time to the current time to finish the simulation?
Thanks!
Hey, there is no easy way to change the final simulation time.
One nasty way is do that, call the setFinalTime during the simulation. You can set a global pointer in the main function and set it from there.
What you can easily do is run the simulation time with final time 1e15 (infinity) and just have a block call exit (the Unix syscall) when the finalization condition is met. You could write to a file/log the results before doing so.
Let me know how it goes!
Fede