Skip to content

Commit

Permalink
Merge pull request #209 from jhtschultz:efg_game_fix
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 310435376
Change-Id: I5e65d21f060f51289d6b8f3c209c5380db798b44
open_spiel@google.com authored and open_spiel@google.com committed May 11, 2020
2 parents cfb9a28 + c346238 commit e13c994
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions open_spiel/games/efg_game.cc
Original file line number Diff line number Diff line change
@@ -14,10 +14,12 @@

#include "open_spiel/games/efg_game.h"

#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <fstream>

#include "open_spiel/abseil-cpp/absl/algorithm/container.h"
#include "open_spiel/abseil-cpp/absl/strings/numbers.h"
#include "open_spiel/abseil-cpp/absl/strings/str_cat.h"
#include "open_spiel/abseil-cpp/absl/strings/str_split.h"
@@ -434,6 +436,7 @@ void EFGGame::ParseChanceNode(Node* parent, Node* child, int depth) {
chance_outcomes++;
}
SPIEL_CHECK_GT(child->actions.size(), 0);
absl::c_sort(child->action_ids);
SPIEL_CHECK_TRUE(Near(prob_sum, 1.0));
SPIEL_CHECK_TRUE(NextToken() == "}");
SPIEL_CHECK_TRUE(absl::SimpleAtoi(NextToken(), &child->outcome_number));
@@ -516,6 +519,7 @@ void EFGGame::ParsePlayerNode(Node* parent, Node* child, int depth) {
actions++;
}
SPIEL_CHECK_GT(child->actions.size(), 0);
absl::c_sort(child->action_ids);
max_actions_ = std::max(max_actions_, actions);
SPIEL_CHECK_TRUE(NextToken() == "}");
SPIEL_CHECK_TRUE(absl::SimpleAtoi(NextToken(), &child->outcome_number));

0 comments on commit e13c994

Please sign in to comment.