@@ -67,23 +67,28 @@ void GameSequenceForm::BuildSequences()
6767}
6868
6969void GameSequenceForm::FillTableau (const GameNode &n, const Rational &prob,
70- std::map<GamePlayer, GameSequence> &p_currentSequences)
70+ std::map<GamePlayer, GameSequence> &p_currentSequences,
71+ std::map<GamePlayer, Rational> p_cumPayoff)
7172{
7273 if (n->GetOutcome ()) {
7374 for (auto player : m_support.GetGame ()->GetPlayers ()) {
74- GetPayoffEntry (p_currentSequences, player) +=
75- prob * n->GetOutcome ()->GetPayoff <Rational>(player);
75+ p_cumPayoff[player] += n->GetOutcome ()->GetPayoff <Rational>(player);
76+ // GetPayoffEntry(p_currentSequences, player) +=
77+ // prob * n->GetOutcome()->GetPayoff<Rational>(player);
7678 }
7779 }
7880 if (!n->GetInfoset ()) {
7981 GetTerminalProb (p_currentSequences) += prob;
82+ for (auto player : m_support.GetGame ()->GetPlayers ()) {
83+ GetPayoffEntry (p_currentSequences, player) += prob * p_cumPayoff[player];
84+ }
8085 return ;
8186 }
8287 if (n->GetPlayer ()->IsChance ()) {
8388 for (auto action : n->GetInfoset ()->GetActions ()) {
8489 FillTableau (n->GetChild (action),
8590 prob * static_cast <Rational>(n->GetInfoset ()->GetActionProb (action)),
86- p_currentSequences);
91+ p_currentSequences, p_cumPayoff );
8792 }
8893 }
8994 else {
@@ -92,7 +97,7 @@ void GameSequenceForm::FillTableau(const GameNode &n, const Rational &prob,
9297 for (auto action : m_support.GetActions (n->GetInfoset ())) {
9398 m_constraints[{n->GetInfoset (), action}] = -1 ;
9499 p_currentSequences[n->GetPlayer ()] = m_correspondence.at (action);
95- FillTableau (n->GetChild (action), prob, p_currentSequences);
100+ FillTableau (n->GetChild (action), prob, p_currentSequences, p_cumPayoff );
96101 }
97102 p_currentSequences[n->GetPlayer ()] = tmp_sequence;
98103 }
@@ -108,10 +113,12 @@ void GameSequenceForm::FillTableau()
108113 m_terminalProb = NDArray<Rational>(dim, dim.size ());
109114
110115 std::map<GamePlayer, GameSequence> currentSequence;
116+ std::map<GamePlayer, Rational> cumPayoff;
111117 for (auto player : GetPlayers ()) {
112118 currentSequence[player] = m_sequences[player].front ();
119+ cumPayoff[player] = Rational (0 );
113120 }
114- FillTableau (m_support.GetGame ()->GetRoot (), Rational (1 ), currentSequence);
121+ FillTableau (m_support.GetGame ()->GetRoot (), Rational (1 ), currentSequence, cumPayoff );
115122}
116123
117124} // end namespace Gambit
0 commit comments