A simple study is: Ant life modeling
I am creating an OO structure that sees a class for Anthill, a class for Ant, and a class for the entire simulator.
Now I'm brainstorming on how to make ants βaliveβ ...
I know that there are projects like this just started, but I'm brainstorming, I'm not looking for a dish just ready to eat .
Sincerely, I have to do some tests to understand "better", AFAIK threads, in Python, use less memory than Processes.
The βantsβ should do when you start the simulation, simply: move in a random direction if they find food β eat / bring an anthill if they find another Ant from another ant hill that transports food β attack β collect food β do what what needs to be done .... and so on ... this means that I have to "share" information between ants and the entire environment.
so I rewrite: Is it better to create a process / thread for each Ant or something else?
EDIT: In relation to my question βwhich is better,β I would support all the smart answers I received, and also add a comment to them. After my tests, I will accept the best answer.
source share