Thesis Project 2018-2019 Code: Escaping the State of Nature
Players capture territory in a gridlike environment and can choose to cultivate their land or invade other players' territory for some bonus reward, but also accrue penalties when being invaded themselves.
- Download the primary dependencies with
pip install -r requirements.txt
- Set the desired game parameters in
params.py
and then run trials with
python state_of_nature.py Q Q -3 Q -4 Q -s 4 -t 3 -hp -w
You'll need to login with a plot.ly account to write graphs
- Find matrix game Q-networks in
assets/
with
python play_matrix_game.py
Q-Learning vs Q-Learning Average Score
Q-Learning vs HQ-Learning Collective Score
Q-Learning vs HQ-Learning Action Breakdown
Comparative Collective Invasions
Comparative Successful Defers
C | D | |
---|---|---|
C | (R = 0.459, R = 0.459) | (S = 0.426, T = 0.446) |
D | (T = 0.446, S = 0.426) | (P = 0.455, P = 0.455) |
Criteria:
- R > P
- R > S
- 2R > T + S
- T > R or P > S
Fear = P - S (+0.029), Greed = T - R (-0.013)
If both Fear and Greed exist in the Civilization Game social dilemma, it represents a Prisoner's Dilemma matrix game. If just Fear, then a Stag Hunt.