Skip to content

Commit

Permalink
Remove C++ call to set chance probability individually.
Browse files Browse the repository at this point in the history
  • Loading branch information
tturocy committed Sep 8, 2023
1 parent 7633cd3 commit 6573217
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
6 changes: 5 additions & 1 deletion src/games/file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -827,8 +827,12 @@ void ParseChanceNode(GameParserState &p_state,
infoset->SetLabel(label);
for (int act = 1; act <= actions.Length(); act++) {
infoset->GetAction(act)->SetLabel(actions[act]);
infoset->SetActionProb(act, Number(probs[act]));
}
Array<Number> prob_numbers(probs.size());
for (int act = 1; act <= actions.Length(); act++) {
prob_numbers[act] = Number(probs[act]);
}
p_game->SetChanceProbs(infoset, prob_numbers);
}
else {
// TODO: Verify actions match up to previous specifications
Expand Down
1 change: 0 additions & 1 deletion src/games/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ class GameInfosetRep : public GameObject {

virtual bool Precedes(GameNode) const = 0;

virtual void SetActionProb(int i, const Number &p_value) = 0;
virtual const Number &GetActionProb(int i) const = 0;
virtual void Reveal(GamePlayer) = 0;

Expand Down
6 changes: 0 additions & 6 deletions src/games/gametree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,6 @@ void GameTreeInfosetRep::RemoveAction(int which)
}
}

void GameTreeInfosetRep::SetActionProb(int act, const Number &p_value)
{
m_probs[act] = p_value;
m_efg->ClearComputedValues();
}

void GameTreeInfosetRep::RemoveMember(GameTreeNodeRep *p_node)
{
m_members.Remove(m_members.Find(p_node));
Expand Down
1 change: 0 additions & 1 deletion src/games/gametree.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ class GameTreeInfosetRep : public GameInfosetRep {

bool Precedes(GameNode) const override;

void SetActionProb(int i, const Number &p_value) override;
const Number &GetActionProb(int i) const override { return m_probs[i]; }

void Reveal(GamePlayer) override;
Expand Down

0 comments on commit 6573217

Please sign in to comment.