Skip to content

Commit

Permalink
placing the tolerance constant on the top of the file
Browse files Browse the repository at this point in the history
  • Loading branch information
rezunli96 committed Oct 14, 2023
1 parent 5354206 commit 40aad58
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion open_spiel/python/algorithms/stackelberg_lp_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
from open_spiel.python.egt.utils import game_payoffs_array
import pyspiel

EPS = 1e-6

# game instances based on Conitzer & Sandholm'06 paper
game0 = pyspiel.create_matrix_game([[2, 4], [1, 3]], [[1, 0], [0, 1]])
commit_strategy0 = np.array([0.5, 0.5])
Expand Down Expand Up @@ -60,7 +62,7 @@ def test_simple_games(self, game, commit_strategy, commit_value):
leader_nash_value = eq[0].reshape(1,
-1).dot(p_mat[0]).dot(eq[1].reshape(
-1, 1))
self.assertGreaterEqual(leader_eq_value-leader_nash_value, -1e-6)
self.assertGreaterEqual(leader_eq_value-leader_nash_value, -EPS)


if __name__ == "__main__":
Expand Down

0 comments on commit 40aad58

Please sign in to comment.