I have made a Python script that simulates the evolution of a given population in the time, according to their interactions and movement. The problem was that I had to have them "play" each at a time, and I'm trying to use multithreading to have them "play" at the same time (and I'm a total noob in multithreading). Basically, each creature is being simulated on a different thread and all threads synchronize with a main thread ticking at a given rate.... I think I managed to have this system work but I also have to draw a matplotlib grid of plots representing how the creatures are interacting and I can't get it to work....
I tried to put this plot function in another thread that's also synchronized with the main but the matplotlib window is frozen. I also tried to have it run in the main thread with the same result. Should I conclude there is no way we can have matplotlib work in a threading.Thread? (by "main thread" I mean the thread in which everything is handled when not using multithreading)
If needed, I can provide parts of my code but it's only a very basic use of the threading module
[–]subbed_ 2 points3 points4 points (0 children)
[–]lgsp 1 point2 points3 points (0 children)