I need to implement a scenario, the scenario composes of 3 groups, two if them with 7 agents each and the last one with 2 agents. each agent contains medium size database.
I thought of 3 ways to implement it:
- creating a thread for each agent and one of the whole scenario (there is a main thread too), pros: best possible simulation, cons: normal systems (2 cores) will take too long to run it as there can be 18 threads.
- creating a thread for each group and within the group, each thread runs over the static agents and updates the according to the world in a fixed order. pro: less threads, e.g. game+main+3=5, better to run over normal systems (2 core), cons: losing liveness that makes the simulation less real.
- using the game thread to do the same like in previous suggestions but over the entire static agents. e.g. 2 threads. pros: excellent performance on normal systems. cons: worst possible simulation.
- making the game thread static and reduce the number of threads.
- create a algorithm that according to the number cores I select the group's size
- in cases of 2 and 3, the environment that the agents receive is constant, e.g. if agent a as preformed a action, then agent B that follows see the environment before the action was preformed.
thanks in advance.


