Adapted from Minimalistic Gridworld Environment (MiniGrid)
Install Python >= 3.5 and clone this project:
$ git clone https://github.com/DVSimon/295bEnv.git
$ cd 295bEnv
Set up the virtual environment:
$ python3 -m venv env
$ source env/bin/activate
Install project dependencies:
$ pip3 install -r requirements.txt
Observation-based Q-Learning simulation and training
./QL-obs.py
Location-based DQN training
./DQN-loc.py
Observation-based DQN training
./DQN-obs.py
Manually control agents with keyboard input
./manual_control.py
- Navigate to config.yml file
- grid_size determines the height and width of the grid environment including the outer walls
- obstacles decides the # of obstacles to be placed into the environment (randomized)
- agents decides the # of agents within environment
- obs_radius decides the agents surrounding visibility of grid
- reward_type of 0 decides to use generic +1, -1 reward formula
- reward_type of 1 decides to use custom reward formula based on times visited
- seed decides the seed for generation for reproducability
- These parameters only affect the Q-learning algorithm implementation itself, not DQN
- Set grid_render to True
- Set grid_obs_render to True
- Set obs_render to True
- Set sleep to desired time (in seconds)
- Set regression_type to null/lin/quad/exp
-
DQN_loc.py script is location based DQN implementation.
Each agent takes action one by one.
Entire Image of Environment is fed to Neural Network(NN).
NN outputs single value of optimum action for that each agents one by one.
-
DQN_obs.py script is observation based DQN implementation
Each agent's observation space is fed to NN.
NN outputs action value for each agents individually & simultaneously.