Skip to content

Commit

Permalink
Rename to BehaviorContingencies
Browse files Browse the repository at this point in the history
  • Loading branch information
tturocy committed Nov 7, 2024
1 parent 116891f commit 373b652
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/games/behavpure.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ MixedBehaviorProfile<Rational> PureBehaviorProfile::ToMixedBehaviorProfile() con
}

//========================================================================
// class BehaviorProfileIterator
// class BehaviorContingencies
//========================================================================

BehaviorProfileIterator::BehaviorProfileIterator(const BehaviorSupportProfile &p_support,
const std::list<GameAction> &p_frozen)
BehaviorContingencies::BehaviorContingencies(const BehaviorSupportProfile &p_support,
const std::list<GameAction> &p_frozen)
: m_atEnd(false), m_support(p_support), m_profile(p_support.GetGame()), m_frozen(p_frozen)
{
for (auto player : m_support.GetGame()->GetPlayers()) {
Expand All @@ -136,7 +136,7 @@ BehaviorProfileIterator::BehaviorProfileIterator(const BehaviorSupportProfile &p
}
}

void BehaviorProfileIterator::operator++()
void BehaviorContingencies::operator++()
{
for (auto infoset = m_activeInfosets.crbegin(); infoset != m_activeInfosets.crend(); ++infoset) {
if (m_currentBehav.at(*infoset) < m_support.NumActions(*infoset)) {
Expand Down
4 changes: 2 additions & 2 deletions src/games/behavpure.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ template <> inline std::string PureBehaviorProfile::GetPayoff(const GamePlayer &
return lexical_cast<std::string>(GetPayoff<Rational>(m_efg->GetRoot(), p_player));
}

class BehaviorProfileIterator {
class BehaviorContingencies {
private:
bool m_atEnd;
BehaviorSupportProfile m_support;
Expand All @@ -92,7 +92,7 @@ class BehaviorProfileIterator {
/// @name Lifecycle
//@{
/// Construct a new iterator on the support, holding the action fixed
BehaviorProfileIterator(const BehaviorSupportProfile &, const std::list<GameAction> & = {});
BehaviorContingencies(const BehaviorSupportProfile &, const std::list<GameAction> & = {});
//@}

/// @name Iteration and data access
Expand Down
2 changes: 1 addition & 1 deletion src/games/behavspt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ bool BehaviorSupportProfile::Dominates(const GameAction &a, const GameAction &b,
bool equal = true;

if (!p_conditional) {
for (BehaviorProfileIterator iter(*this, {a}); !iter.AtEnd(); iter++) {
for (BehaviorContingencies iter(*this, {a}); !iter.AtEnd(); iter++) {
auto ap = (*iter).GetPayoff<Rational>(a);
auto bp = (*iter).GetPayoff<Rational>(b);

Expand Down
2 changes: 1 addition & 1 deletion src/solvers/enumpure/enumpure.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ inline List<MixedBehaviorProfile<Rational>> EnumPureAgentSolver::Solve(const Gam
{
List<MixedBehaviorProfile<Rational>> solutions;
BehaviorSupportProfile support(p_game);
for (auto citer = BehaviorProfileIterator(BehaviorSupportProfile(p_game)); !citer.AtEnd();
for (auto citer = BehaviorContingencies(BehaviorSupportProfile(p_game)); !citer.AtEnd();
citer++) {
if ((*citer).IsAgentNash()) {
MixedBehaviorProfile<Rational> profile = (*citer).ToMixedBehaviorProfile();
Expand Down

0 comments on commit 373b652

Please sign in to comment.