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.2.tar.gz
(5.4 kB
view hashes)
Built Distribution
Close
Hashes for game_resolver-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0313be95d9edd6f5a8f4f90e168d73e55da4af07e32ca40006a19e6b70bb9cb |
|
MD5 | a6a483083c14b7e34a343a289b269812 |
|
BLAKE2b-256 | 5d2abc87836eece854b5d7256d2030cd92ac61ae619c9426441168fe1f48852d |