Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
### Changed
- `Game.comment` has been renamed to `Game.description`

### Fixed
- `enumpoly` would take a very long time on some supports where an equilibrium is located on the
boundary of the projected game. Search is now restricted to the interior of the space ruling
these out; these will always be found by another projection. (#756)

## [16.5.1] - unreleased

Expand Down
4 changes: 2 additions & 2 deletions src/solvers/enumpoly/efgpoly.cc
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ std::list<MixedBehaviorProfile<double>> SolveSupport(const BehaviorSupportProfil

// set up the rectangle of search
Vector<double> bottoms(data.space->GetDimension()), tops(data.space->GetDimension());
bottoms = 0;
tops = 1;
bottoms = 1e-12;
tops = 1 - 1e-12;

PolynomialSystemSolver solver(equations);
std::list<Vector<double>> roots;
Expand Down
4 changes: 2 additions & 2 deletions src/solvers/enumpoly/nfgpoly.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ EnumPolyStrategySupportSolve(const StrategySupportProfile &support, bool &is_sin
const PolynomialSystem<double> equations = ConstructEquations(space, support, strategy_poly);

Vector<double> bottoms(space->GetDimension()), tops(space->GetDimension());
bottoms = 0;
tops = 1;
bottoms = 1e-12;
tops = 1 - 1e-12;
PolynomialSystemSolver solver(equations);
is_singular = false;
std::list<Vector<double>> roots;
Expand Down
6 changes: 5 additions & 1 deletion src/solvers/enumpoly/poly.h
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,11 @@ template <class T> class Polynomial {
});
}
[[nodiscard]] const std::vector<Monomial<T>> &GetTerms() const noexcept { return m_terms; }
bool IsZero() const noexcept { return m_terms.empty(); }
bool IsZero() const noexcept
{
return m_terms.empty() || std::all_of(m_terms.begin(), m_terms.end(),
[](const auto &mono) { return mono.IsZero(); });
}
bool IsConstant() const noexcept
{
return m_terms.size() == 1 && m_terms.front().TotalDegree() == 0;
Expand Down
10 changes: 8 additions & 2 deletions tests/test_nash.py
Original file line number Diff line number Diff line change
Expand Up @@ -2070,7 +2070,10 @@ def test_nash_strategy_solver_w_start(test_case: EquilibriumTestCaseWithStart, s
regret_tol=TOL,
prob_tol=TOL,
),
marks=pytest.mark.nash_enumpoly_behavior,
marks=[
pytest.mark.nash_enumpoly_behavior,
pytest.mark.xfail(reason="Changes in operation of enumpoly"),
],
id="test_enumpoly_behavior_7",
),
pytest.param(
Expand All @@ -2084,7 +2087,10 @@ def test_nash_strategy_solver_w_start(test_case: EquilibriumTestCaseWithStart, s
regret_tol=TOL,
prob_tol=TOL,
),
marks=pytest.mark.nash_enumpoly_behavior,
marks=[
pytest.mark.nash_enumpoly_behavior,
pytest.mark.xfail(reason="Changes in operation of enumpoly"),
],
id="test_enumpoly_behavior_8",
),
# 4-player game
Expand Down