I'm trying to create a genetic algorithm that learns how to play Tetris.
But is there a way to creare multiple istance of the game? So that i can create like 200 tetris, wait until all die and do operations instead of creating one instance, wait for the AI to lose, close the game, create a new one and so on?
I have tried with :
import logging
import threading
import time
from game import Game
def thread_function():
Game()
if __name__ == "__main__":
x = threading.Thread(target=thread_function, args=())
x.start()
y = threading.Thread(target=thread_function, args=())
y.start()
z = threading.Thread(target=thread_function, args=())
z.start()
But the result is not 3 istances of the game, but only 1 with weirds thing going on. If i use just one thread everything works fine.