No project description provided
Project description
game_resolver
This library is internal library for nishino-lab(The University of Tokyo)
http://www.css.t.u-tokyo.ac.jp
Run Sample Game
This library has three type sample games(prisoner, battle of sex, cournot).
from game_resolver.games.custom_game import Prisoner
from game_resolver.nash_equilibrium import NashEquilibrium
prisoner = Prisoner()
ne = NashEquilibrium()
eq = e.get_equilibrium(g)
for i in eq:
print(i)
Run your own game
A Nash equilibrium can be solved by representing the problem to be solved in the Game class.
from game_resolver.games.custom_game import CustomGame
from game_resolver.nash_equilibrium import NashEquilibrium
player_num = 2
action_list = ["Cooperate", "Defect"]
all_player_action_list = [
("Cooperate", "Cooperate"),
("Cooperate", "Defect"),
("Defect", "Cooperate"),
("Defect", "Defect")
]
payoff_list = [
[3, 0, 5, 1],
[3, 5, 0, 1]
]
your_own_game = CustomGame("volunteer_dilenma",
player_num,
action_list,
all_player_action_list,
payoff_list)
e = NashEquilibrium()
eq = e.get_equilibrium(your_own_game)
for i in eq:
print(i)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
game_resolver-0.2.1.tar.gz
(5.6 kB
view hashes)
Built Distribution
Close
Hashes for game_resolver-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7118805c4f677a414f10770938f243dcae89857aabf600a47deb08f4d41164f1 |
|
MD5 | 889a5b61811dd23d6a3a0992471fa3bc |
|
BLAKE2b-256 | ce616c06ff5f2feaaccfde56379d704416a5f2e6c5fb1c8a7d90cd3857d32649 |