MultiAgentDecisionProcess
|
BG_FactorGraphCreator will create a FG from a BG. More...
#include <BG_FactorGraphCreator.h>
Public Types | |
enum | BGFactorGraph_t { AgentTypeIndependence, AgentIndependence, TypeIndependence } |
Public Member Functions | |
BG_FactorGraphCreator (const boost::shared_ptr< const BayesianGameCollaborativeGraphical > &bg, BGFactorGraph_t type=AgentTypeIndependence, int verbosity=2, bool exploitSparseness=false) | |
(default) Constructor More... | |
BG_FactorGraphCreator (const BG_FactorGraphCreator &a) | |
Copy constructor. More... | |
const libDAI::FactorGraph * | CreateFG () |
actually creates the FG More... | |
BGFactorGraph_t | GetBGFactorGraph_t () const |
const libDAI::FactorGraph * | GetFG () |
returns a pointer to the FG More... | |
Index | GetVariableIndexForAgentType (Index agI, Index typeI) const |
BG_FactorGraphCreator & | operator= (const BG_FactorGraphCreator &o) |
Copy assignment operator. More... | |
~BG_FactorGraphCreator () | |
Destructor. More... | |
Static Public Member Functions | |
static std::string | SoftPrint (BGFactorGraph_t bgfg) |
Protected Member Functions | |
void | Construct_AgentBGPolicy_Variables () |
constuct variables for each agent (i.e., no type independence) More... | |
void | Construct_AgentTypePair_Variables () |
construct variables for each (agent-type) pair - values are actions More... | |
void | Construct_JointType_Factors () |
constructs factors for each joint type: type indep. More... | |
void | Construct_LocalJointType_Factors () |
constructs factors for each local joint type: agent+type indep. More... | |
void | Construct_LocalPayoff_Factors () |
constructs factors for each local payoff function: agent indep. More... | |
void | Construct_Payoff_Factor () |
this constructs the strategic game: 1 single factor with agents: no indep. More... | |
const libDAI::FactorGraph * | CreateFG_AgentIndepence () |
const libDAI::FactorGraph * | CreateFG_AgentTypeIndepence () |
const libDAI::FactorGraph * | CreateFG_TypeIndepence () |
double | PerturbationTerm () |
the amount of random perturbation to add to the factors: More... | |
Private Attributes | |
boost::shared_ptr< const BayesianGameCollaborativeGraphical > | _m_bg |
bool | _m_exploitSparse |
Do we want to exploit sparseness of joint type space? More... | |
std::vector< libDAI::Factor > | _m_facs |
libDAI::FactorGraph * | _m_FG |
BGFactorGraph_t | _m_FGt |
std::vector< std::vector< Index > > | _m_var_indices |
std::vector< libDAI::Var > | _m_vars |
int | _m_verbosity |
verbosity level: More... | |
BG_FactorGraphCreator will create a FG from a BG.
Currently only works for CGBG (BayesianGameCollaborativeGraphical)
known bugs: -will fail for CGBGs in which not all agents participate in at least 1 payoff components. (in that case libDAI will not include the variables corresponding to the excluded agent(s) in the graphical model. However, the labels will not be changes, so an out of index exception is thrown)
BG_FactorGraphCreator::BG_FactorGraphCreator | ( | const boost::shared_ptr< const BayesianGameCollaborativeGraphical > & | bg, |
BGFactorGraph_t | type = AgentTypeIndependence , |
||
int | verbosity = 2 , |
||
bool | exploitSparseness = false |
||
) |
(default) Constructor
|
inline |
Copy constructor.
BG_FactorGraphCreator::~BG_FactorGraphCreator | ( | ) |
Destructor.
References _m_FG.
|
protected |
constuct variables for each agent (i.e., no type independence)
There is 1 variable for each agent, the values are BG policies
References _m_bg, _m_vars, and Globals::CastLIndexToIndex().
Referenced by CreateFG_AgentIndepence().
|
protected |
construct variables for each (agent-type) pair - values are actions
an assignment of variables (v3, v8, v14) corresponds to an assignment of joint actions (a1, a2, a3) for a particular joint type. I.e., each (the action taken for each) (agent,type)-pair is a variable of the FG
References _m_bg, _m_var_indices, _m_vars, and _m_verbosity.
Referenced by CreateFG_AgentTypeIndepence(), and CreateFG_TypeIndepence().
|
protected |
constructs factors for each joint type: type indep.
References _m_bg, _m_exploitSparse, _m_facs, _m_var_indices, _m_vars, _m_verbosity, Globals::EqualProbability(), PerturbationTerm(), and PrintTools::SoftPrintVector().
Referenced by CreateFG_TypeIndepence().
|
protected |
constructs factors for each local joint type: agent+type indep.
References _m_bg, _m_exploitSparse, _m_facs, _m_var_indices, _m_vars, _m_verbosity, Globals::EqualProbability(), BayesianGameBase::GetNrAgents(), BayesianGameBase::GetNrJointActions(), BayesianGameBase::GetNrJointTypes(), BayesianGameBase::GetProbability(), BayesianGameIdenticalPayoff::GetUtility(), BayesianGameBase::JointToIndividualActionIndices(), BayesianGameBase::JointToIndividualTypeIndices(), and PrintTools::SoftPrintVector().
Referenced by CreateFG_AgentTypeIndepence().
|
protected |
constructs factors for each local payoff function: agent indep.
References _m_bg, _m_facs, _m_vars, _m_verbosity, Globals::CastLIndexToIndex(), JointPolicyPureVector::GetIndividualPolicies(), JointPolicyPureVector::GetJointActionIndex(), BayesianGameBase::GetNrAgents(), BayesianGameBase::GetNrJointPolicies(), BayesianGameBase::GetNrJointTypes(), BayesianGameBase::GetProbability(), BayesianGameIdenticalPayoff::GetUtility(), JointPolicyPureVector::Increment(), PerturbationTerm(), and PolicyGlobals::TYPE_INDEX.
Referenced by CreateFG_AgentIndepence().
|
protected |
this constructs the strategic game: 1 single factor with agents: no indep.
References _m_bg, _m_facs, _m_var_indices, _m_vars, _m_verbosity, and PrintTools::SoftPrintVector().
const libDAI::FactorGraph * BG_FactorGraphCreator::CreateFG | ( | ) |
actually creates the FG
References _m_FGt, AgentIndependence, AgentTypeIndependence, CreateFG_AgentIndepence(), CreateFG_AgentTypeIndepence(), CreateFG_TypeIndepence(), and TypeIndependence.
Referenced by BGCG_SolverFG::BGCG_SolverFG().
|
protected |
References _m_facs, _m_FG, Construct_AgentBGPolicy_Variables(), and Construct_LocalPayoff_Factors().
Referenced by CreateFG().
|
protected |
References _m_facs, _m_FG, Construct_AgentTypePair_Variables(), and Construct_LocalJointType_Factors().
Referenced by CreateFG().
|
protected |
References _m_facs, _m_FG, Construct_AgentTypePair_Variables(), and Construct_JointType_Factors().
Referenced by CreateFG().
|
inline |
References _m_FGt.
Referenced by BGCG_SolverFG::Solve().
|
inline |
References _m_FGt, _m_var_indices, AgentTypeIndependence, and TypeIndependence.
Referenced by BGCG_SolverFG::ProcessFoundConfigurations_ATI().
|
inline |
Copy assignment operator.
|
inlineprotected |
the amount of random perturbation to add to the factors:
References Globals::PROB_PRECISION.
Referenced by Construct_JointType_Factors(), and Construct_LocalPayoff_Factors().
|
inlinestatic |
References AgentIndependence, AgentTypeIndependence, and TypeIndependence.
Referenced by BGCG_SolverCreator_FG::SoftPrint(), and BGCG_SolverCreator_FG::SoftPrintBrief().
|
private |
|
private |
Do we want to exploit sparseness of joint type space?
Referenced by Construct_JointType_Factors(), and Construct_LocalJointType_Factors().
|
private |
|
private |
|
private |
Referenced by CreateFG(), GetBGFactorGraph_t(), and GetVariableIndexForAgentType().
|
private |
|
private |
|
private |
verbosity level:
Referenced by Construct_AgentTypePair_Variables(), Construct_JointType_Factors(), Construct_LocalJointType_Factors(), Construct_LocalPayoff_Factors(), and Construct_Payoff_Factor().