/action_space_reduction

Action space reduction for reinforcement learning via constraint programming

Primary LanguageC++

Action Space Reduction

Action space reduction for reinforcement learning via constraint programming.

Cloning this repository

Clone this repository with the recursive option to import its submodules.

git clone --recursive https://github.com/richoux/action_space_reduction

You may need to type the following command after cloning:

git submodule update --recursive

How to install

Submodules are not taken into account for the moment.

You have to:

  • install GHOST
  • install protobuf for C++
  • install protobuf for python with
pip install protobuf==3.20.1
  • clone the gym-microrts fork somewhere with
git clone --recursive https://github.com/richoux/gym-microrts
  • install gym-microrts
  • Create protobuf files with
protoc -I=./protobuf_code --cpp_out=./protobuf_code --python_out=your_path_to/gym-microrts/experiments/ ./protobuf_code/asr.proto
  • Compile the action_space_reduction model with Just type
make

How to run

Run the action_space_reduction model first:

./bin/action_space_reduction

Then run in an other terminal the python ppo_gridnet

cd your_path_to/gym-microrts/experiments/
python ppo_gridnet.py

You should only have some prints in both terminals to check the communication between action_space_reduction and ppo_gridnet.py is correct. Then, ppo_gridnet.py will start learning as usual.