Beispiel #1
0
 def testEquilibriumSelectionPD(self):
     a_pd = BimatrixTwoStrategyGame(
         -1.0, -1.0, -4.0, 0.0, 0.0, -4.0, -3.0, -3.0)
     # equilibrium is unique
     self.assertEqual(len(a_pd.find_nash()), 1)
     # D,D
     self.assertTrue(a_pd.find_unique_equilibrium() == (0.0, 0.0))
     # no risk dominant
     try:
         a_pd.find_risk_dominant_equilibrium(atol=10e-3)
     except NoEquilibriumSelected:
         self.assertTrue(True)
     else:
         self.assertTrue(False)
Beispiel #2
0
 def testEquilibriumSelectionCoordinationGame(self):
     a_coordination_game = BimatrixTwoStrategyGame(
         1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0)
     self.assertEqual(len(a_coordination_game.find_nash()), 3)
     self.assertEqual(
         a_coordination_game.find_unique_equilibrium(), (0.5, 0.5))