This project is an implementation of the classic cat versus mouse problem. I have created 3 possible game instances:
- the mouse is an intelligent agent (must be trained) and the cat is a sentinel and is part of the environment
- the mouse is a smart agent and there are 2 sentry cats (you can choose two game modes for cats 'misto' or 'verticale'
- both agents are intelligent
The two instances with sentinel cats (1 and 2) are in the appropriate directory gattoSentinella
.
It is possible to use a fill percentage for obstacles (See directly in the code to understand how it works).
All implementations are pre-trained and to test them just run the main.py
file of each subdirectory (for instances with sentinel cat) or of the root directory (both intelligent agents).
To start the train instead use the learning.py
file and change the parameters as you want.
Examples for starting the tests:
gattoSentinella/gattoSingolo
-> execute themain.py
file by entering the mode in mode to decide whether to start it with obstacles or not.gattoSentinella/gattoDoppio
, execute themain.py
file choosing the mode in cat2_mode (the models have been pre-trained with pct_obstacles = 0.04 so you need to retrain if you change the percentage)- both smart agents, use the main.py file in the root directory. Choose the modes in cat_mode ('classic' or 'knowcCheese') and set map_mode ('' or 'walls', if you use walls there is more difficulty for the topo agent). The gestione_loop variable is used to tell the system how to manage deadlock situations (See code and comments to understand how it works)
pip install virtualenv
virtualenv rl
source rl/bin/activate
pip install -r utils/requirements.txt
For other explanation see the report in the report/
dir.
For any problem or help open an issues or contact me: [email protected]