In [80]:
%pylab inline
In [98]:
%run ../game_theory.py
In [99]:
a_pd = BimatrixTwoStrategyGame(-1.0,-1.0, -4.0,0.0, 0.0, -4.0, -3.0,-3.0)
In [100]:
a_pd.expected_payoff((1.0, 1.0))
Out[100]:
In [101]:
a_pd.expected_payoff((0.0, 0.0))
Out[101]:
In [102]:
a_pd.plot_payoff_space()
Out[102]:
In [103]:
a_pd.find_unique_equilibrium()
Out[103]:
In [116]:
(0.0, 0.0) == (0, 0)
Out[116]:
In [104]:
a_pd.find_risk_dominant_equilibrium()
In [105]:
a_coordination_game = BimatrixTwoStrategyGame(1.0,1.0, 0.0,0.0, 0.0, 0.0, 1.0,1.0)
In [106]:
a_coordination_game.plot_payoff_space()
Out[106]:
In [107]:
candidates = a_coordination_game.find_nash()
for i in candidates:
print i, np.abs(i[0] - i[1])
In [108]:
a_coordination_game.find_unique_equilibrium()
Out[108]:
In [108]:
In [109]:
print a_coordination_game
In [110]:
battel = BimatrixTwoStrategyGame.battleofthesexes()
In [111]:
print battel
In [112]:
battel.plot_payoff_space()
Out[112]:
In [113]:
battel.find_nash()
Out[113]:
In [96]:
battel.find_unique_equilibrium()
In [12]:
pennies = BimatrixTwoStrategyGame.matchingpennies()
In [13]:
pennies.plot_payoff_space()
Out[13]:
In [14]:
pennies.find_nash()
Out[14]:
In [ ]: