Skip to content

Commit 466be8b

Browse files
committed
Fix up rebase to latest master.
1 parent 3517eed commit 466be8b

3 files changed

Lines changed: 3 additions & 20 deletions

File tree

src/games/game.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,9 +863,9 @@ class GameRep : public std::enable_shared_from_this<GameRep> {
863863
/// Returns the set of information sets in the game
864864
virtual std::vector<GameInfoset> GetInfosets() const { throw UndefinedException(); }
865865
/// Returns an array with the number of information sets per personal player
866-
virtual Array<int> NumInfosets() const = 0;
866+
virtual Array<int> NumInfosets() const { throw UndefinedException(); }
867867
/// Returns the act'th action in the game (numbered globally)
868-
virtual GameAction GetAction(int act) const = 0;
868+
virtual GameAction GetAction(int act) const { throw UndefinedException(); }
869869
/// Sort the information sets for each player in a canonical order
870870
virtual void SortInfosets() {}
871871
//@}

src/games/gametree.cc

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ void GameTreeRep::DeleteAction(GameAction p_action)
145145
member->m_children.erase(it);
146146
}
147147
ClearComputedValues();
148-
Canonicalize();
149148
}
150149

151150
GameInfoset GameActionRep::GetInfoset() const { return m_infoset->shared_from_this(); }
@@ -193,7 +192,6 @@ void GameTreeRep::SetPlayer(GameInfoset p_infoset, GamePlayer p_player)
193192
p_player->m_infosets.push_back(p_infoset);
194193

195194
ClearComputedValues();
196-
Canonicalize();
197195
}
198196

199197
bool GameInfosetRep::Precedes(GameNode p_node) const
@@ -237,7 +235,6 @@ GameAction GameTreeRep::InsertAction(GameInfoset p_infoset, GameAction p_action
237235
m_numNodes += p_infoset->m_members.size();
238236
// m_numNonterminalNodes stays unchanged when an action is appended to an information set
239237
ClearComputedValues();
240-
Canonicalize();
241238
return action;
242239
}
243240

@@ -284,7 +281,6 @@ void GameTreeRep::Reveal(GameInfoset p_atInfoset, GamePlayer p_player)
284281
}
285282

286283
ClearComputedValues();
287-
Canonicalize();
288284
}
289285

290286
//========================================================================
@@ -422,7 +418,6 @@ void GameTreeRep::DeleteParent(GameNode p_node)
422418

423419
oldParent->Invalidate();
424420
ClearComputedValues();
425-
Canonicalize();
426421
}
427422

428423
void GameTreeRep::DeleteTree(GameNode p_node)
@@ -449,7 +444,6 @@ void GameTreeRep::DeleteTree(GameNode p_node)
449444
node->m_label = "";
450445

451446
ClearComputedValues();
452-
Canonicalize();
453447
}
454448

455449
void GameTreeRep::CopySubtree(GameNodeRep *dest, GameNodeRep *src, GameNodeRep *stop)
@@ -491,7 +485,6 @@ void GameTreeRep::CopyTree(GameNode p_dest, GameNode p_src)
491485
CopySubtree(dest_child->get(), src_child->get(), dest);
492486
}
493487
ClearComputedValues();
494-
Canonicalize();
495488
}
496489
}
497490

@@ -515,7 +508,6 @@ void GameTreeRep::MoveTree(GameNode p_dest, GameNode p_src)
515508
dest->m_outcome = nullptr;
516509

517510
ClearComputedValues();
518-
Canonicalize();
519511
}
520512

521513
Game GameTreeRep::CopySubgame(GameNode p_root) const
@@ -547,7 +539,6 @@ void GameTreeRep::SetInfoset(GameNode p_node, GameInfoset p_infoset)
547539
node->m_infoset = p_infoset.get();
548540

549541
ClearComputedValues();
550-
Canonicalize();
551542
}
552543

553544
GameInfoset GameTreeRep::LeaveInfoset(GameNode p_node)
@@ -578,7 +569,6 @@ GameInfoset GameTreeRep::LeaveInfoset(GameNode p_node)
578569
(*new_act)->SetLabel((*old_act)->GetLabel());
579570
}
580571
ClearComputedValues();
581-
Canonicalize();
582572
return node->m_infoset->shared_from_this();
583573
}
584574

@@ -619,7 +609,6 @@ GameInfoset GameTreeRep::AppendMove(GameNode p_node, GameInfoset p_infoset)
619609
});
620610
m_numNonterminalNodes++;
621611
ClearComputedValues();
622-
Canonicalize();
623612
return node->m_infoset->shared_from_this();
624613
}
625614

@@ -671,7 +660,6 @@ GameInfoset GameTreeRep::InsertMove(GameNode p_node, GameInfoset p_infoset)
671660
m_numNodes += newNode->m_infoset->m_actions.size();
672661
m_numNonterminalNodes++;
673662
ClearComputedValues();
674-
Canonicalize();
675663
return p_infoset;
676664
}
677665

@@ -845,7 +833,7 @@ void GameTreeRep::BuildComputedValues() const
845833
if (m_computedValues) {
846834
return;
847835
}
848-
const_cast<GameTreeRep *>(this)->Canonicalize();
836+
const_cast<GameTreeRep *>(this)->SortInfosets();
849837
for (const auto &player : m_players) {
850838
std::map<GameInfosetRep *, int> behav;
851839
std::map<GameNodeRep *, GameNodeRep *> ptr, whichbranch;

src/games/gametree.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ class GameTreeRep : public GameExplicitRep {
5050

5151
/// @name Managing the representation
5252
//@{
53-
void Canonicalize();
5453
void BuildComputedValues() const override;
5554
void BuildConsistentPlays();
5655
void ClearComputedValues() const;
@@ -114,10 +113,6 @@ class GameTreeRep : public GameExplicitRep {
114113
GameInfoset GetInfoset(int iset) const override;
115114
/// Returns the set of information sets in the game
116115
std::vector<GameInfoset> GetInfosets() const override;
117-
/// Returns an array with the number of information sets per personal player
118-
Array<int> NumInfosets() const override;
119-
/// Returns the act'th action in the game (numbered globally)
120-
GameAction GetAction(int act) const override;
121116
/// Sort the information sets for each player in a canonical order
122117
void SortInfosets() override;
123118
//@}

0 commit comments

Comments
 (0)