Skip to main content

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.3.1.tar.gz (6.7 kB view hashes)

Uploaded Source

Built Distribution

game_resolver-0.3.1-py3-none-any.whl (9.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page