osbrain icon indicating copy to clipboard operation
osbrain copied to clipboard

Using osBrain for virtual time simulation

Open shahab-valaei opened this issue 4 years ago • 6 comments

Hello, I am considering to use osBrain for my simulation but I need a virtual time simulation, not real-time. Is it possible to add a virtual time for agents in osBrain like discrete event simulation?

Thanks

shahab-valaei avatar Apr 07 '20 13:04 shahab-valaei

osBrain is meant for real-time applications. You could implement some kind of synchronization mechanism between the agents for a "virtual time simulation", but that is not built-in. Depending on your application, that could end up resulting slow, but I cannot tell without more information about the application. :wink:

Peque avatar Apr 07 '20 13:04 Peque

I want to create a simulation to model the organizations involved in disaster management. Each organization is considered as an agent. In this simulation, communication and collaboration between organizations is particularly important as it determines the quality of the disaster management process. Number of agents may be in order of 1000 or more. Do you think osBrain is a good choice? Thanks for your consideration.

shahab-valaei avatar Apr 07 '20 15:04 shahab-valaei

Maybe. Currently agents are based on system processes, which are heavy to spawn, specially on Windows systems. If you have lots of RAM then that may not be a huge deal though.

Another important factor is how they communicate. Do you have an idea on how many messages will be passed during the whole simulation? And the expected duration of the simulation? Knowing whether you need frequent synchronization (i.e.: for "fake time simulation") and whether you will be using 1-to-1 or 1-to-many communication patterns can greatly affect your performance too.

You can always do a quick test yourself and see how it goes. Don't forget to report back! :wink:

Peque avatar Apr 07 '20 16:04 Peque

In this simulation agents are in two main clusters. Some of them have 1-to-1 and others have 1-to-many communication patterns. The number of message may be around 10000 for whole simulation in each run and total time of simulation is around 6 month (4320 hours). I want to do a test but I don't know how to use frequent synchronization for virtual time simulation. I would appreciate it if you could show me some guidelines or introduce some resources to help me doing that. Thanks a lot

shahab-valaei avatar Apr 07 '20 21:04 shahab-valaei

Initially, as a very dirty approximation, you could simply launch a step and see how much it takes to run (measure a couple of times). Measure until you see no CPU/communication activity. Then run a whole simulation by simply running one step after another leaving enough "sleep" time (i.e.: take the highest time you measured and multiply by some factor). That is no real synchronization method, but could help you setting up a proof of concept to see if osBrain fits your needs.

If you want real synchronization, you need to find the last agent(s) that are expected to perform any actions during one step. Make sure those agents report back to the one deciding when a new step needs to be run.

Peque avatar Apr 08 '20 07:04 Peque

@shahab7494 Maybe you will be interested in this discussion: https://github.com/opensistemas-hub/osbrain/issues/356

Peque avatar May 25 '20 07:05 Peque