Skip to content

Commit

Permalink
Merge pull request #869 from deepmind:lanctot-patch-34
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 457528731
Change-Id: If90b3a3f5f132a7c134f93243ede27547ddb3b7c
  • Loading branch information
lanctot committed Jun 27, 2022
2 parents 15145eb + 3420e55 commit 6a49b93
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion open_spiel/game_parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
#ifndef OPEN_SPIEL_GAME_PARAMETERS_H_
#define OPEN_SPIEL_GAME_PARAMETERS_H_

#include <iostream>
#include <map>
#include <memory>
#include <string>
#include <utility>

#include "open_spiel/spiel_utils.h"
#include "open_spiel/abseil-cpp/absl/types/optional.h"
#include "open_spiel/spiel_utils.h"

namespace open_spiel {

Expand Down Expand Up @@ -157,6 +158,9 @@ class GameParameter {
case Type::kUnset:
return rhs.type_ == Type::kUnset;
}
std::cerr << "Unrecognized parameter type in operator=="
<< ", returning false." << std::endl;
return false;
}
bool operator!=(const GameParameter& rhs) const { return !(*this == rhs); }

Expand Down
4 changes: 4 additions & 0 deletions open_spiel/games/amazons.cc
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,10 @@ std::string AmazonsState::ActionToString(Player player, Action action) const {
return absl::StrCat(StateToString(PlayerToState(player)),
" Shoot: ", str);
}

std::cerr << "Unhandled case in AmazonState::ActionToString, "
<< "returning empty string." << std::endl;
return "";
}

// Looks okay
Expand Down
3 changes: 2 additions & 1 deletion open_spiel/python/egt/dynamics_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ def test__sum_j_x_j_ln_x_j_over_x_i(self):
expected_2 = np.asarray([expected_0, expected_1, expected_2])
np.testing.assert_array_equal(expected, expected_2)

np.testing.assert_array_equal(expected, _sum_j_x_j_ln_x_j_over_x_i(x))
np.testing.assert_array_almost_equal(expected,
_sum_j_x_j_ln_x_j_over_x_i(x))


class DynamicsTest(parameterized.TestCase):
Expand Down

0 comments on commit 6a49b93

Please sign in to comment.