MultiAgentDecisionProcess
Release 0.2.1
|
BayesianGame is a class that represents a general Bayesian game in which each agent has its own utility function. More...
#include <BayesianGame.h>
Public Member Functions | |
BayesianGame (size_t nrAgents, const std::vector< size_t > &nrActions, const std::vector< size_t > &nrTypes) | |
BayesianGame (const BayesianGame &a) | |
Copy constructor. | |
void | Print () const |
Prints out this BayesianGame. | |
bool | SetInitialized (bool b) |
Sets the initialized status to b. | |
void | SetUtility (const Index agent, const Index jtype, const Index ja, const double u) |
Sets the utility for agent, jtype, ja to u. | |
![]() | |
void | AddProbability (const Index i, const double p) |
Adds p to the probability of joint type i. | |
void | AddProbability (const std::vector< Index > &indIndices, const double p) |
Adds p to the probability of joint type corresponding to the individual type indices (indIndices). | |
virtual bool | AreCachedJointToIndivIndices (const PolicyGlobals::IndexDomainCategory pdc) const |
Check whether certain index conversions are cached. | |
BayesianGameBase () | |
BayesianGameBase (const size_t nrAgents, const std::vector< size_t > &nrActions, const std::vector< size_t > &nrTypes, int verboseness=0) | |
BayesianGameBase (const BayesianGameBase &a) | |
Copy constructor. | |
bool | CacheJointToIndivAOH_Indices () const |
bool | CacheJointToIndivOH_Indices () const |
bool | CacheJointToIndivType_Indices () const |
virtual PolicyGlobals::IndexDomainCategory | GetDefaultIndexDomCat () const |
Return the default IndexDomainCategory for the problem. | |
size_t | GetNrActions (Index agentI) const |
Get the number of invididual actions of a particular agent. | |
const std::vector< size_t > & | GetNrActions () const |
size_t | GetNrAgents () const |
implement the Interface_ProblemToPolicyDiscrete interface: | |
size_t | GetNrJointActions () const |
Get the number of joint actions. | |
LIndex | GetNrJointPolicies () const |
size_t | GetNrJointTypes () const |
LIndex | GetNrPolicies (Index ag) const |
size_t | GetNrPolicyDomainElements (Index agentI, PolicyGlobals::IndexDomainCategory cat, size_t depth=MAXHORIZON) const |
Get the number of elements in the domain of an agent's policy. | |
const std::vector< size_t > & | GetNrTypes () const |
size_t | GetNrTypes (Index agI) const |
virtual double | GetProbability (const Index i) const |
Gets the probability of joint type i. | |
double | GetProbability (const std::vector< Index > &indIndices) |
Gets the probability of joint type corresponding to the individual type indices (indIndices) | |
Index | IndividualToJointActionIndices (const Index *IndArr) const |
Converts individual action indices to a joint action index. | |
Index | IndividualToJointActionIndices (const std::vector< Index > &indices) const |
Converts individual action indices to a joint action index. | |
Index | IndividualToJointTypeIndices (const std::vector< Index > &indices) const |
std::vector< Index > | JointToIndividualActionIndices (Index jaI) const |
std::vector< Index > | JointToIndividualPolicyDomainIndices (Index jdI, PolicyGlobals::IndexDomainCategory cat) const |
implementation of JointToIndividualPolicyDomainIndices | |
const std::vector< Index > & | JointToIndividualPolicyDomainIndicesRef (Index jdI, PolicyGlobals::IndexDomainCategory cat) const |
implementation of JointToIndividualPolicyDomainIndicesRef | |
const std::vector< Index > & | JointToIndividualTypeIndices (Index jTypeI) const |
void | PrintAction (Index agentI, Index actionI) const |
y | |
void | PrintPolicyDomain (Index agentI, Index typeIndex) const |
bool | SanityCheck () const |
virtual void | SanityCheck () |
void | SanityCheckBGBase () |
void | SetProbability (const Index i, const double p) |
Sets the probability of joint type i to p. | |
void | SetProbability (const std::vector< Index > &indIndices, const double p) |
Sets the probability of joint type corresponding to the individual type indices (indIndices) to p. | |
std::string | SoftPrint () const |
Prints a description of this BayesianGameBase to a string. | |
std::string | SoftPrintAction (Index agentI, Index actionI) const |
std::string | SoftPrintPolicyDomainElement (Index agentI, Index typeIndex, PolicyGlobals::IndexDomainCategory cat) const |
~BayesianGameBase () | |
Destructor. | |
![]() | |
LIndex | GetNrJointPolicies (PolicyGlobals::IndexDomainCategory cat, size_t depth=MAXHORIZON) const |
Get the number of joint policies, given the policy's domain. | |
LIndex | GetNrPolicies (Index ag, PolicyGlobals::IndexDomainCategory cat, size_t depth=MAXHORIZON) const |
Get the number of policies for an agent, given the policy's domain. | |
virtual | ~Interface_ProblemToPolicyDiscretePure () |
Destructor. | |
![]() | |
Interface_ProblemToPolicyDiscrete () | |
(default) Constructor | |
virtual | ~Interface_ProblemToPolicyDiscrete () |
Destructor. |
Private Attributes | |
bool | _m_initialized |
private bool to indicate whether this BG is initialized. | |
std::vector< RewardModelMapping > | _m_utilFuncs |
Util functions - in general case 1 for each agent. |
Additional Inherited Members | |
![]() | |
bool | _m_initialized |
private bool to indicate whether this BG is initialized. | |
std::vector< size_t > | _m_nrActions |
the number of actions for each agent | |
size_t | _m_nrAgents |
the number of players (or agents) | |
size_t | _m_nrJA |
the number of joint types: | |
size_t | _m_nrJTypes |
the number of joint actions: | |
std::vector< size_t > | _m_nrTypes |
the number of types for each agent | |
size_t * | _m_stepSizeActions |
an size_t array that caches the stepsize array for actions: | |
size_t * | _m_stepSizeTypes |
an size_t array that caches the stepsize array for types: | |
int | _m_verboseness |
_m_verboseness >0 verbose, <0 is quiet |
BayesianGame is a class that represents a general Bayesian game in which each agent has its own utility function.
This is a self contained class: meaning that it does not depend on any Multi-agent decision problem or Planning unit. This implies that, in order to convert a time-step of a MADP Planning Unit to a Bayesian game, indices of observation(-action) histories have to be converted. This class uses its own indices.
Definition at line 50 of file BayesianGame.h.
BayesianGame::BayesianGame | ( | size_t | nrAgents, |
const std::vector< size_t > & | nrActions, | ||
const std::vector< size_t > & | nrTypes | ||
) |
Definition at line 33 of file BayesianGame.cpp.
References BayesianGameBase::_m_nrAgents, BayesianGameBase::_m_nrJA, BayesianGameBase::_m_nrJTypes, and _m_utilFuncs.
BayesianGame::BayesianGame | ( | const BayesianGame & | a | ) |
Copy constructor.
Definition at line 45 of file BayesianGame.cpp.
void BayesianGame::Print | ( | ) | const |
Prints out this BayesianGame.
Reimplemented from BayesianGameBase.
Definition at line 59 of file BayesianGame.cpp.
References BayesianGameBase::_m_nrAgents, and _m_utilFuncs.
bool BayesianGame::SetInitialized | ( | bool | b | ) |
Sets the initialized status to b.
When setting to true - checks are performed to see if this is a consistent Bayesian Game.
Reimplemented from BayesianGameBase.
Definition at line 52 of file BayesianGame.cpp.
References _m_initialized.
|
inline |
Sets the utility for agent, jtype, ja to u.
Definition at line 83 of file BayesianGame.h.
References _m_utilFuncs.
|
private |
private bool to indicate whether this BG is initialized.
To access the BayesianGameBase initialized bool use: BayesianGameBase::_m_initialized.
Definition at line 56 of file BayesianGame.h.
Referenced by SetInitialized().
|
private |
Util functions - in general case 1 for each agent.
We use RewardModelMapping substituting joint type indices for state indices.
Definition at line 61 of file BayesianGame.h.
Referenced by BayesianGame(), Print(), and SetUtility().