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

Using osBrain for virtual time simulation #355

Open
shahab-valaei opened this issue Apr 7, 2020 · 6 comments
Open

Using osBrain for virtual time simulation #355

shahab-valaei opened this issue Apr 7, 2020 · 6 comments
Labels
Projects
Milestone

Comments

@shahab-valaei
Copy link

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

@Peque
Copy link
Member

Peque commented Apr 7, 2020

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. 😉

@Peque Peque added the question label Apr 7, 2020
@Peque Peque added this to the 0.7.0 milestone Apr 7, 2020
@shahab-valaei
Copy link
Author

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.

@Peque
Copy link
Member

Peque commented Apr 7, 2020

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! 😉

@shahab-valaei
Copy link
Author

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

@Peque
Copy link
Member

Peque commented Apr 8, 2020

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
Copy link
Member

Peque commented May 25, 2020

@shahab7494 Maybe you will be interested in this discussion: #356

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development
Awaiting triage
Development

No branches or pull requests

2 participants