Skip to content

Commit fe48dc9

Browse files
committed
Use GetPayoff instead of deriv just for clarity
1 parent 61150ac commit fe48dc9

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/games/game.cc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -459,12 +459,10 @@ template <class Container, class T> auto make_filter_iterator(const Container &c
459459
template <class T> T MixedStrategyProfile<T>::GetRegret(const GameStrategy &p_strategy) const
460460
{
461461
CheckVersion();
462-
const GamePlayer player = p_strategy->GetPlayer();
463-
T payoff = GetPayoffDeriv(player->GetNumber(), p_strategy);
464-
T best_other_payoff = maximize_function(filter_range(player->GetStrategies(), p_strategy),
465-
[this, player](const GameStrategy &p_strategy) -> T {
466-
return GetPayoffDeriv(player->GetNumber(), p_strategy);
467-
});
462+
T payoff = GetPayoff(p_strategy);
463+
T best_other_payoff = maximize_function(
464+
filter_range(p_strategy->GetPlayer()->GetStrategies(), p_strategy),
465+
[this](const GameStrategy &p_strategy) -> T { return GetPayoff(p_strategy); });
468466
return std::max(best_other_payoff - payoff, static_cast<T>(0));
469467
}
470468

0 commit comments

Comments
 (0)