コード例 #1
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'])
コード例 #2
0
 def test_mclennan_tourky_invalid_init_length(self):
     mclennan_tourky(self.g, [1])
コード例 #3
0
 def test_mclennan_tourky_invalid_init_type(self):
     mclennan_tourky(self.g, 1)
コード例 #4
0
 def test_mclennan_tourky_invalid_g(self):
     mclennan_tourky(self.bimatrix)
コード例 #5
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)
コード例 #6
0
 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"])