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
Changes to allow learning for multiple agents together #6
Fixes the issue of opening of multiple TORCS windows, in the beginning of episodes.
Fixes code crash when multiple agents are trained together.
Introduces a new script multi_ddpg, where multiple agents learn using DDPG.
State vector is changed from size 29 to 65, information about the opponents is included. This is the reading of 36 sensors on the vehicle, which correspond to the closest distance of any obstacle in line of that sensor.
Now weights are stored for each agent in the folder weights/port_number after every 300 episode.
Weights of training for 3 agents when trained together are present in weights.
autostart.sh, has been added with extra commented lines for speeding up the TORCS simulator.
How to run:
Run scripts/startTorcs.sh in a separate terminal.
Run multi_ddpg.py in another terminal. Set the number of workers in the file multi_ddpg.py, in TORCS simulator select that many number of scr_server.
In script/autostart.sh change the command "torcs" to "cd path_of_installation & ./torcs" if simply "torcs" does not launch TORCS for you.
ToDo:
Readme to be changed once this PR is merged.
In snakeoil3_gym.py n_fail needs to be adjusted as per the number of agents trained. For 6 agents, 10 was a suitable number.
Some cleanups done previously are lost, need to redo them.
Everytime a new episode starts, there is a redundant start where only the first client connects and rest cannot. This does not create any issues in training, but is not a good user experience, need to work this out.
This PR:
How to run:
ToDo: