From 325bd45dbc9c44d346d81ceed5625294681e7a9d Mon Sep 17 00:00:00 2001 From: Ted Turocy Date: Fri, 13 Sep 2024 11:49:11 +0100 Subject: [PATCH] Remove unneeded tracking of previous information set. --- src/solvers/enumpoly/sfg.cc | 11 ++++------- src/solvers/enumpoly/sfg.h | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/solvers/enumpoly/sfg.cc b/src/solvers/enumpoly/sfg.cc index 56ff16e3b..bacfbf039 100644 --- a/src/solvers/enumpoly/sfg.cc +++ b/src/solvers/enumpoly/sfg.cc @@ -57,7 +57,6 @@ Sfg::Sfg(const BehaviorSupportProfile &S) : support(S), m_dim(support.GetGame()- SF = NDArray(m_dim, support.GetGame()->NumPlayers()); PureSequenceProfile parent; - std::map last_infoset; for (auto player : support.GetGame()->GetPlayers()) { m_sequenceColumns[player] = {{nullptr, 1}}; @@ -68,14 +67,13 @@ Sfg::Sfg(const BehaviorSupportProfile &S) : support(S), m_dim(support.GetGame()- E.at(player)(1, 1) = Rational(1); parent[player] = sequences.at(player).front(); - last_infoset[player] = nullptr; } - MakeSequenceForm(support.GetGame()->GetRoot(), Rational(1), one, last_infoset, parent); + MakeSequenceForm(support.GetGame()->GetRoot(), Rational(1), one, parent); } void Sfg::MakeSequenceForm(const GameNode &n, const Rational &prob, const Array &seq, - std::map iset, PureSequenceProfile parent) + PureSequenceProfile parent) { if (n->GetOutcome()) { for (int pl = 1; pl <= seq.Length(); pl++) { @@ -89,12 +87,11 @@ void Sfg::MakeSequenceForm(const GameNode &n, const Rational &prob, const Array< for (auto action : n->GetInfoset()->GetActions()) { MakeSequenceForm(n->GetChild(action), prob * static_cast(n->GetInfoset()->GetActionProb(action)), seq, - iset, parent); + parent); } } else { int pl = n->GetPlayer()->GetNumber(); - iset[n->GetPlayer()] = n->GetInfoset(); E.at(n->GetPlayer())(infoset_row[n->GetPlayer()][n->GetInfoset()], seq[pl]) = Rational(1); std::shared_ptr myparent(parent[n->GetPlayer()]); @@ -111,7 +108,7 @@ void Sfg::MakeSequenceForm(const GameNode &n, const Rational &prob, const Array< } snew[pl] = m_sequenceColumns[n->GetPlayer()][action]; E.at(n->GetPlayer())(infoset_row[n->GetPlayer()][n->GetInfoset()], snew[pl]) = Rational(-1); - MakeSequenceForm(n->GetChild(action), prob, snew, iset, parent); + MakeSequenceForm(n->GetChild(action), prob, snew, parent); } } } diff --git a/src/solvers/enumpoly/sfg.h b/src/solvers/enumpoly/sfg.h index ccff90b79..764e0ba1e 100644 --- a/src/solvers/enumpoly/sfg.h +++ b/src/solvers/enumpoly/sfg.h @@ -65,7 +65,7 @@ class Sfg { std::map> m_actionParents; void MakeSequenceForm(const GameNode &, const Rational &, const Array &, - std::map, PureSequenceProfile); + PureSequenceProfile); void ComputeNumSequences(const GameNode &, std::map &);