Skip to content

Commit 0e03de1

Browse files
committed
Merge branch 'master' into integrate_llm
# Conflicts: # src/games/game.h # src/games/gametree.cc # src/games/gametree.h
2 parents fbda433 + c8c2046 commit 0e03de1

19 files changed

+188
-216
lines changed

src/games/behavmixed.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void MixedBehaviorProfile<T>::RealizationProbs(const MixedStrategyProfile<T> &mp
9494
{
9595
T prob;
9696

97-
for (int i = 1; i <= node->children.size(); i++) {
97+
for (int i = 1; i <= node->m_children.size(); i++) {
9898
if (node->GetPlayer() && !node->GetPlayer()->IsChance()) {
9999
if (node->GetPlayer() == player) {
100100
if (actions[node->GetInfoset()->GetNumber()] == i) {
@@ -113,10 +113,10 @@ void MixedBehaviorProfile<T>::RealizationProbs(const MixedStrategyProfile<T> &mp
113113
}
114114
}
115115
else { // n.GetPlayer() == 0
116-
prob = T(node->infoset->GetActionProb(i));
116+
prob = T(node->m_infoset->GetActionProb(node->m_infoset->GetAction(i)));
117117
}
118118

119-
GameTreeNodeRep *child = node->children[i];
119+
GameTreeNodeRep *child = node->m_children[i];
120120

121121
map_bvals[child] = prob * map_bvals[node];
122122
map_nvals[child] += map_bvals[child];
@@ -335,7 +335,7 @@ template <class T> T MixedBehaviorProfile<T>::GetActionProb(const GameAction &ac
335335
if (action->GetInfoset()->GetPlayer()->IsChance()) {
336336
GameTreeInfosetRep *infoset =
337337
dynamic_cast<GameTreeInfosetRep *>(action->GetInfoset().operator->());
338-
return static_cast<T>(infoset->GetActionProb(action->GetNumber()));
338+
return static_cast<T>(infoset->GetActionProb(action));
339339
}
340340
else if (!m_support.Contains(action)) {
341341
return T(0);

src/games/game.cc

+11-11
Original file line numberDiff line numberDiff line change
@@ -161,33 +161,33 @@ void GamePlayerRep::MakeReducedStrats(GameTreeNodeRep *n, GameTreeNodeRep *nn)
161161
}
162162

163163
if (n->NumChildren() > 0) {
164-
if (n->infoset->m_player == this) {
165-
if (n->infoset->flag == 0) {
164+
if (n->m_infoset->m_player == this) {
165+
if (n->m_infoset->flag == 0) {
166166
// we haven't visited this infoset before
167-
n->infoset->flag = 1;
167+
n->m_infoset->flag = 1;
168168
for (i = 1; i <= n->NumChildren(); i++) {
169-
GameTreeNodeRep *m = n->children[i];
169+
GameTreeNodeRep *m = n->m_children[i];
170170
n->whichbranch = m;
171-
n->infoset->whichbranch = i;
171+
n->m_infoset->whichbranch = i;
172172
MakeReducedStrats(m, nn);
173173
}
174-
n->infoset->flag = 0;
174+
n->m_infoset->flag = 0;
175175
}
176176
else {
177177
// we have visited this infoset, take same action
178-
MakeReducedStrats(n->children[n->infoset->whichbranch], nn);
178+
MakeReducedStrats(n->m_children[n->m_infoset->whichbranch], nn);
179179
}
180180
}
181181
else {
182182
n->ptr = nullptr;
183183
if (nn != nullptr) {
184184
n->ptr = nn->m_parent;
185185
}
186-
n->whichbranch = n->children[1];
187-
if (n->infoset) {
188-
n->infoset->whichbranch = 0;
186+
n->whichbranch = n->m_children[1];
187+
if (n->m_infoset) {
188+
n->m_infoset->whichbranch = 0;
189189
}
190-
MakeReducedStrats(n->children[1], n->children[1]);
190+
MakeReducedStrats(n->m_children[1], n->m_children[1]);
191191
}
192192
}
193193
else if (nn) {

src/games/game.h

-3
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ class GameInfosetRep : public GameObject {
208208

209209
virtual bool Precedes(GameNode) const = 0;
210210

211-
virtual const Number &GetActionProb(int i) const = 0;
212211
virtual const Number &GetActionProb(const GameAction &) const = 0;
213212
virtual void Reveal(GamePlayer) = 0;
214213
};
@@ -550,8 +549,6 @@ class GameRep : public BaseGameRep {
550549
virtual Array<GameInfoset> GetInfosets() const = 0;
551550
/// Returns an array with the number of information sets per personal player
552551
virtual Array<int> NumInfosets() const = 0;
553-
/// Returns the act'th action in the game (numbered globally)
554-
virtual GameAction GetAction(int act) const = 0;
555552
/// Sort the information sets for each player in a canonical order
556553
virtual void SortInfosets() {}
557554
//@}

src/games/gameagg.h

-2
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ class GameAGGRep : public GameRep {
9393
Array<GameInfoset> GetInfosets() const override { throw UndefinedException(); }
9494
/// Returns an array with the number of information sets per personal player
9595
Array<int> NumInfosets() const override { throw UndefinedException(); }
96-
/// Returns the act'th action in the game (numbered globally)
97-
GameAction GetAction(int act) const override { throw UndefinedException(); }
9896
//@}
9997

10098
/// @name Outcomes

src/games/gamebagg.h

-2
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ class GameBAGGRep : public GameRep {
9494
Array<GameInfoset> GetInfosets() const override { throw UndefinedException(); }
9595
/// Returns an array with the number of information sets per personal player
9696
Array<int> NumInfosets() const override { throw UndefinedException(); }
97-
/// Returns the act'th action in the game (numbered globally)
98-
GameAction GetAction(int act) const override { throw UndefinedException(); }
9997
//@}
10098

10199
/// @name Outcomes

src/games/gametable.h

-2
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ class GameTableRep : public GameExplicitRep {
8282
Array<GameInfoset> GetInfosets() const override { throw UndefinedException(); }
8383
/// Returns an array with the number of information sets per personal player
8484
Array<int> NumInfosets() const override { throw UndefinedException(); }
85-
/// Returns the act'th action in the game (numbered globally)
86-
GameAction GetAction(int act) const override { throw UndefinedException(); }
8785
//@}
8886

8987
/// @name Nodes

0 commit comments

Comments
 (0)