def test_epsilon_nash_without_full_output(self):
     for d in self.game_dicts:
         NE = mclennan_tourky(d['g'],
                              epsilon=d['epsilon'],
                              full_output=False)
         for i in range(d['g'].N):
             ok_(d['lb'] < NE[i][0] < d['ub'])
 def test_mclennan_tourky_invalid_init_length(self):
     mclennan_tourky(self.g, [1])
 def test_mclennan_tourky_invalid_init_type(self):
     mclennan_tourky(self.g, 1)
 def test_mclennan_tourky_invalid_g(self):
     mclennan_tourky(self.bimatrix)
 def test_pure_nash(self):
     for d in self.game_dicts:
         init = (1, ) + (0, ) * (d['g'].N - 1)
         NE, res = mclennan_tourky(d['g'], init=init, full_output=True)
         ok_(res.num_iter == 1)
 def test_convergence_default(self):
     for d in self.game_dicts:
         NE, res = mclennan_tourky(d['g'], full_output=True)
         ok_(res.converged)
Пример #7
0
 def test_epsilon_nash_with_full_output(self):
     for d in self.game_dicts:
         NE, res = \
             mclennan_tourky(d['g'], epsilon=d['epsilon'], full_output=True)
         for i in range(d['g'].N):
             assert_(d['lb'] < NE[i][0] < d['ub'])
Пример #8
0
 def test_mclennan_tourky_invalid_init_type(self):
     mclennan_tourky(self.g, 1)
Пример #9
0
 def test_mclennan_tourky_invalid_init_length(self):
     mclennan_tourky(self.g, [1])
Пример #10
0
 def test_mclennan_tourky_invalid_g(self):
     mclennan_tourky(self.bimatrix)
Пример #11
0
 def test_pure_nash(self):
     for d in self.game_dicts:
         init = (1,) + (0,)*(d['g'].N-1)
         NE, res = mclennan_tourky(d['g'], init=init, full_output=True)
         ok_(res.num_iter==1)
Пример #12
0
 def test_convergence_default(self):
     for d in self.game_dicts:
         NE, res = mclennan_tourky(d['g'], full_output=True)
         ok_(res.converged)
Пример #13
0
 def test_epsilon_nash_without_full_output(self):
     for d in self.game_dicts:
         NE = mclennan_tourky(d['g'], epsilon=d['epsilon'],
                              full_output=False)
         for i in range(d['g'].N):
             ok_(d['lb'] < NE[i][0] < d['ub'])
Пример #14
0
 def test_epsilon_nash(self):
     for d in self.game_dicts:
         NE, res = mclennan_tourky(d["g"], epsilon=d["epsilon"], full_output=True)
         for i in range(d["g"].N):
             ok_(d["lb"] < NE[i][0] < d["ub"])