# Running 2 NEAT nets on the same observations

So i have been playing around with neat-python. I made a program, applying neat, to play pinball on the Atari 2600. The code for that can be found in the file test2.py here

Now based on that, I would like to do the same, but on a 2 player game. I have already set up the environment to play a 2 player game, which PONG using OpenAI Retro.

What I have no clue how to do, is run 2 nets at the same time, on the same observation. The way that neat-python works, is you get the observation from a single function that goes through each genome and runs the environment.

How would you create 2 eval_genome functions that can take in the same observation real-time? This means that they train based off of the same images and environmenrs.

Help?

• I'm not sure how to do this as I haven't played with neat-python before but I'm honestly curious, why do you want to do this? To compare the resulting network structures or something else? – Jaden Travnik Mar 20 '19 at 14:01
• I am planning to study the interactions between agents trained together. I want to see if they can develop cooperative behavior. This problem with neat is annoying though... – niallmandal Mar 20 '19 at 16:41
• Does anyone know how to solve this – niallmandal Mar 21 '19 at 16:19

I'm not familiar with neat-python, but I have implemented NEAT to do openai tasks. If there is a class for initializing a population, you could just use that and have 2 objects like population1 and population2 and call them in the same loop.