abhisheknaik96 / MultiAgentTORCS

The multi-agent version of TORCS for developing control algorithms for fully autonomous driving in the cluttered, multi-agent settings of everyday life.
141 stars 32 forks source link

resetting in multi agent setting #11

Open Anshu1245 opened 4 years ago

Anshu1245 commented 4 years ago

While using say two clients from within a single program, after completing the first episode successfully, the environment doesn't reset simply by calling the reset method twice for both the clients.

that is, ob1, client1 = env.reset(client=client1, relaunch=True) ob2, client2 = env.reset(client=client2, relaunch=True), doesn't work.

Neither does ob1, client1 = env.reset(client=client1, relaunch=True) command = 'kill {}'.format(client2.serverPID) os.system(command) client2 = snakeoil3.Client(p=port[1], vision=False) # Open new UDP in vtorcs client2.MAX_STEPS = np.inf client2.get_servers_input(0) # Get the initial input from torcs obs2 = client2.S.d # Get the current full-observation from torcs ob2 = env.make_observation(obs2)

And both clients cannot be run from different consoles independently as their observations are required together. Not so sure about socket programming. Some help would be greatly appreciated!

abhisheknaik96 commented 4 years ago

Can you elaborate what your use-case is? It seems you are trying to run multiple learning agents from within the same console?

P.S.: Also check out the new repo for this project!