@@ -98,30 +98,16 @@ MixedBehaviorProfile<Rational> PureBehaviorProfile::ToMixedBehaviorProfile() con
9898// class BehaviorContingencies
9999// ========================================================================
100100
101- BehaviorContingencies::BehaviorContingencies (const BehaviorSupportProfile &p_support,
102- const std::set<GameInfoset> &p_reachable,
103- const std::vector<GameAction> &p_frozen)
104- : m_support(p_support), m_frozen(p_frozen)
101+ BehaviorContingencies::BehaviorContingencies (const BehaviorSupportProfile &p_support)
102+ : m_support(p_support)
105103{
106- if (!p_reachable.empty ()) {
107- for (const auto &infoset : p_reachable) {
108- m_activeInfosets.push_back (infoset);
109- }
110- }
111- else {
112- for (const auto &player : m_support.GetGame ()->GetPlayers ()) {
113- for (const auto &infoset : player->GetInfosets ()) {
114- if (p_support.IsReachable (infoset)) {
115- m_activeInfosets.push_back (infoset);
116- }
104+ for (const auto &player : m_support.GetGame ()->GetPlayers ()) {
105+ for (const auto &infoset : player->GetInfosets ()) {
106+ if (p_support.IsReachable (infoset)) {
107+ m_reachableInfosets.push_back (infoset);
117108 }
118109 }
119110 }
120- for (const auto &action : m_frozen) {
121- m_activeInfosets.erase (std::find_if (
122- m_activeInfosets.begin (), m_activeInfosets.end (),
123- [action](const GameInfoset &infoset) { return infoset == action->GetInfoset (); }));
124- }
125111}
126112
127113BehaviorContingencies::iterator::iterator (BehaviorContingencies *p_cont, bool p_end)
@@ -136,15 +122,12 @@ BehaviorContingencies::iterator::iterator(BehaviorContingencies *p_cont, bool p_
136122 m_profile.SetAction (*m_currentBehav[infoset]);
137123 }
138124 }
139- for (const auto &action : m_cont->m_frozen ) {
140- m_profile.SetAction (action);
141- }
142125}
143126
144127BehaviorContingencies::iterator &BehaviorContingencies::iterator::operator ++()
145128{
146- for (auto infoset = m_cont->m_activeInfosets .crbegin ();
147- infoset != m_cont->m_activeInfosets .crend (); ++infoset) {
129+ for (auto infoset = m_cont->m_reachableInfosets .crbegin ();
130+ infoset != m_cont->m_reachableInfosets .crend (); ++infoset) {
148131 ++m_currentBehav[*infoset];
149132 if (m_currentBehav.at (*infoset) != m_cont->m_support .GetActions (*infoset).end ()) {
150133 m_profile.SetAction (*m_currentBehav[*infoset]);
0 commit comments