From 9c10a48d66a04c703800e31883ea09784e7107bd Mon Sep 17 00:00:00 2001 From: Theodore Turocy Date: Tue, 28 Jul 2026 13:55:01 -0400 Subject: [PATCH] Added missing guards against games of imperfect recall in enumpoly. Closes #1006. --- src/solvers/enumpoly/efgpoly.cc | 5 +++++ src/solvers/enumpoly/nfgpoly.cc | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/solvers/enumpoly/efgpoly.cc b/src/solvers/enumpoly/efgpoly.cc index 99cd21e35..3a0e1029e 100644 --- a/src/solvers/enumpoly/efgpoly.cc +++ b/src/solvers/enumpoly/efgpoly.cc @@ -227,6 +227,11 @@ EnumPolyBehaviorSolve(const Game &p_game, int p_stopAfter, double p_maxregret, BehaviorCallbackType p_onEquilibrium, EnumPolyEventCallbackType p_onEvent) { + if (!p_game->IsPerfectRecall()) { + throw UndefinedException( + "Computing equilibria of games with imperfect recall is not supported."); + } + const double scale = p_game->GetMaxPayoff() - p_game->GetMinPayoff(); if (scale != 0.0) { p_maxregret *= scale; diff --git a/src/solvers/enumpoly/nfgpoly.cc b/src/solvers/enumpoly/nfgpoly.cc index 3eff45f54..4340d734b 100644 --- a/src/solvers/enumpoly/nfgpoly.cc +++ b/src/solvers/enumpoly/nfgpoly.cc @@ -143,6 +143,11 @@ EnumPolyStrategySolve(const Game &p_game, int p_stopAfter, double p_maxregret, StrategyCallbackType p_onEquilibrium, EnumPolyEventCallbackType p_onEvent) { + if (!p_game->IsPerfectRecall()) { + throw UndefinedException( + "Computing equilibria of games with imperfect recall is not supported."); + } + const double scale = p_game->GetMaxPayoff() - p_game->GetMinPayoff(); if (scale != 0.0) { p_maxregret *= scale;