MultiAgentDecisionProcess
TransitionObservationIndependentMADPDiscrete Class Reference

TransitionObservationIndependentMADPDiscrete is an base class that defines the primary properties of a Transition and Observation independent decision process. More...

#include <TransitionObservationIndependentMADPDiscrete.h>

Inheritance diagram for TransitionObservationIndependentMADPDiscrete:
[legend]

Public Member Functions

void AddAction (Index agentI, const std::string &name)
 Adds an action with a particular name for the specified agent. More...
 
void AddAgent (const std::string &name="unspec.")
 Adds one agent with an optional name. More...
 
void AddObservation (Index agentI, const std::string &name)
 Adds an Observation with a particular name for the specified agent. More...
 
void AddState (Index agentI, const std::string &name)
 Adds a state with a particular name for the specified agent. More...
 
void CreateCentralizedSparseTransitionModel ()
 
const ActionGetAction (Index agentI, Index a) const
 Get a pointer to action a of agentI. More...
 
MultiAgentDecisionProcessDiscreteGetIndividualMADPD (Index agentI) const
 Returns a pointer to agentsI's individual model. More...
 
double GetInitialStateProbability (Index sI) const
 returns the prob. More...
 
virtual StateDistributionVectorGetISD () const
 returns the initial state distribution. More...
 
const JointActionGetJointAction (Index i) const
 Returns a pointer to joint action i. More...
 
const JointActionDiscreteGetJointActionDiscrete (Index i) const
 return a ref to the i-th joint action (a JointActionDiscrete). More...
 
const JointObservationGetJointObservation (Index i) const
 Get a pointer to the i-th joint observation. More...
 
size_t GetNrActions (Index agentI) const
 return the number of actions of agent agentI More...
 
const std::vector< size_t > & GetNrActions () const
 returns a vector with the number of actions for each agent. More...
 
size_t GetNrJointActions () const
 return the number of joint actions. More...
 
size_t GetNrJointActions (const Scope &agScope) const
 Get the number of joint actions the agents in agScope can form. More...
 
size_t GetNrJointObservations () const
 Get the number of joint observations. More...
 
size_t GetNrJointStates () const
 
size_t GetNrObservations (Index agentI) const
 return the number of observations of agent agentI More...
 
const std::vector< size_t > & GetNrObservations () const
 Returns a vector with the number of observations for each agent. More...
 
size_t GetNrStates (Index agI) const
 Returns the number of local states for agent i. More...
 
size_t GetNrStates () const
 returns the number of (joint) states. More...
 
const ObservationGetObservation (Index agentI, Index o) const
 Get a pointer to observation o of agentI. More...
 
ObservationModelDiscreteGetObservationModelDiscretePtr () const
 Returns a pointer to the underlying observation model. More...
 
double GetObservationProbability (Index jaI, Index sucSI, Index joI) const
 Returns the probability of the joint observation joI (the product of the individual observation probabilities, which depend only on local states). More...
 
double GetObservationProbability (const std::vector< Index > &aIs, const std::vector< Index > &sucSIs, const std::vector< Index > &oIs) const
 
OGetGetOGet () const
 
const StateGetState (Index i) const
 Returns a pointer to state i. More...
 
const StateGetState (const std::vector< Index > &sIs) const
 
TGetGetTGet () const
 
TransitionModelDiscreteGetTransitionModelDiscretePtr () const
 Returns a pointer to the underlying transition model. More...
 
double GetTransitionProbability (Index sI, Index jaI, Index sucSI) const
 returns probability of joint transition (the product of the probabilities of the individual transitions) More...
 
double GetTransitionProbability (const std::vector< Index > &sIs, const std::vector< Index > &aIs, const std::vector< Index > &sucSIs) const
 
Index IndividualToJointActionIndices (const std::vector< Index > &indivActionIndices) const
 Returns the joint action index that corresponds to the vector of specified individual action indices. More...
 
Index IndividualToJointActionIndices (const Index *AI_ar) const
 Returns the joint action index that corresponds to the array of specified individual action indices. More...
 
Index IndividualToJointActionIndices (const std::vector< Index > &ja_e, const Scope &agSC) const
 indiv->joint for a restricted set (Scope) of agents More...
 
Index IndividualToJointActionIndices (Index *IndexArray) const
 converts individual to joint actions. More...
 
Index IndividualToJointObservationIndices (const std::vector< Index > &indivObsIndices) const
 returns the joint index for indivObsIndices More...
 
Index IndividualToJointStateIndices (const std::vector< Index > &indivStateIndices) const
 returns the joint index for indivStateIndices More...
 
bool Initialize ()
 
const std::vector< Index > & JointToIndividualActionIndices (Index jaI) const
 returns a vector of indices to indiv. More...
 
std::vector< IndexJointToIndividualActionIndices (Index ja_e, const Scope &agSC) const
 joint->indiv for a restricted set (Scope) of agents More...
 
const std::vector< Index > & JointToIndividualObservationIndices (Index joI) const
 returns the individual indices for joint observation joI. More...
 
const std::vector< Index > & JointToIndividualStateIndices (Index jointSI) const
 returns a vector of individual (local) state indices corresponding to joint state index jointSI. More...
 
Index JointToRestrictedJointActionIndex (Index jaI, const Scope &agSc_e) const
 Converts a global joint action index jaI to a restricted joint action index ja_e, for agents scope agSc_e Returns a vector of indices to indiv. More...
 
void Print () const
 Prints information regarding this TransitionObservationIndependentMADPDiscrete. More...
 
void PrintActionSets () const
 Prints the action set for each agent. More...
 
void PrintJointActionSet () const
 Prints the set of joint actions. More...
 
Index SampleInitialState () const
 Samples an initial state. More...
 
std::vector< IndexSampleInitialStates () const
 
Index SampleJointObservation (Index jaI, Index sucI) const
 Returns a joint observation, sampled according to the observation probabilities. More...
 
std::vector< IndexSampleJointObservation (const std::vector< Index > &aIs, const std::vector< Index > &sucIs) const
 
Index SampleSuccessorState (Index sI, Index jaI) const
 returns a successor state index sampled according to the transition probabilities. More...
 
std::vector< IndexSampleSuccessorState (const std::vector< Index > &sIs, const std::vector< Index > &aIs) const
 
void SetISD (const std::vector< double > &v)
 Sets the initial state distribution to v. More...
 
void SetNrActions (Index agentI, size_t nr)
 Sets the number of actions for the specified agent. More...
 
void SetNrAgents (size_t n)
 Sets the number of agents to n. More...
 
void SetNrObservations (Index agentI, size_t nr)
 Sets the number of Observations for the specified agent. More...
 
void SetNrStates (Index agentI, size_t nr)
 Sets the number of states for the specified agent. More...
 
void SetSparse (bool sparse)
 
std::string SoftPrint () const
 SoftPrints information regarding this TransitionObservationIndependentMADPDiscrete. More...
 
std::string SoftPrintActionSets () const
 SoftPrints the action set for each agent. More...
 
std::string SoftPrintJointActionSet () const
 SoftPrints the set of joint actions. More...
 
std::string SoftPrintState (Index sI) const
 
 TransitionObservationIndependentMADPDiscrete (const std::string &name="received unspec. by TransitionObservationIndependentMADPDiscrete", const std::string &descr="received unspec.by TransitionObservationIndependentMADPDiscrete", const std::string &pf="received unspec. by TransitionObservationIndependentMADPDiscrete", bool cacheFlatModels=false)
 
 TransitionObservationIndependentMADPDiscrete (const TransitionObservationIndependentMADPDiscrete &)
 
virtual ~TransitionObservationIndependentMADPDiscrete ()
 Destructor. More...
 
- Public Member Functions inherited from MultiAgentDecisionProcess
void AddAgent (std::string name)
 Add a new agent with name "name" to the MADP. More...
 
Index GetAgentIndexByName (const std::string &s) const
 Returns the index of an agent given its name, if it exists. More...
 
std::string GetAgentNameByIndex (Index i) const
 Returns the name of the agent at the given index. More...
 
const ScopeGetAllAgentScope () const
 
std::string GetDescription () const
 
std::string GetName () const
 
size_t GetNrAgents () const
 Returns the number of agents in this MultiAgentDecisionProcess. More...
 
std::string GetProblemFile () const
 Returns the name of the problem file. More...
 
std::string GetUnixName () const
 Returns a name which can be in unix path, by default the base part of the problem filename. More...
 
 MultiAgentDecisionProcess (size_t nrAgents, const std::string &name="received unspec. by MultiAgentDecisionProcess", const std::string &description="received unspec. by MultiAgentDecisionProcess", const std::string &pf="received unspec. by MultiAgentDecisionProcess")
 Constructor. More...
 
 MultiAgentDecisionProcess (const std::string &name="received unspec. by MultiAgentDecisionProcess", const std::string &description="received unspec. by MultiAgentDecisionProcess", const std::string &pf="received unspec. by MultiAgentDecisionProcess")
 Default Constructor without specifying the number of agents. More...
 
void Print () const
 
void SetDescription (const std::string &description)
 
void SetName (const std::string &name)
 
void SetNrAgents (size_t nrAgents)
 Sets the number of agents. More...
 
void SetUnixName (std::string unixName)
 Sets the name which can be used inin unix paths. More...
 
std::string SoftPrint () const
 Prints some information on the MultiAgentDecisionProcess. More...
 
virtual ~MultiAgentDecisionProcess ()
 Destructor. More...
 
- Public Member Functions inherited from MultiAgentDecisionProcessInterface
virtual ~MultiAgentDecisionProcessInterface ()
 Destructor. More...
 
- Public Member Functions inherited from MultiAgentDecisionProcessDiscreteInterface
virtual
MultiAgentDecisionProcessDiscreteInterface
Clone () const =0
 Returns a pointer to a copy of this class. More...
 
virtual bool GetEventObservability () const
 Whether observation models are P(o|s,a) or P(o|s,a,s'). More...
 
virtual double GetObservationProbability (Index sI, Index jaI, Index sucSI, Index joI) const
 
virtual Index IndividualToJointObservationIndices (const std::vector< Index > &jo_e, const Scope &agSC) const
 indiv->joint for a restricted set (Scope) of agents More...
 
virtual std::vector< IndexJointToIndividualObservationIndices (Index jo_e, const Scope &agSC) const
 joint->indiv for a restricted set (Scope) of agents More...
 
virtual Index JointToRestrictedJointObservationIndex (Index joI, const Scope &agSc_e) const
 Converts a global joint observation index joI to a restricted joint observation index jo_e, for agents scope agSc_e Returns a vector of indices to indiv. More...
 
virtual Index SampleJointObservation (Index sI, Index jaI, Index sucI) const
 
virtual ~MultiAgentDecisionProcessDiscreteInterface ()
 Destructor. More...
 

Protected Member Functions

void CreateCentralizedFullModels ()
 
void CreateCentralizedObservationTransitionModel ()
 
void CreateCentralizedSparseModels ()
 
bool GetSparse () const
 
virtual bool SetInitialized (bool b)
 Sets _m_initialized to b. More...
 

Private Member Functions

size_t ConstructJointObservationsRecursively (Index curAgentI, JointObservationDiscrete &jo, Index joI)
 
void CreateISD ()
 
void CreateJointActions ()
 Recursively constructs all the joint actions. More...
 
size_t CreateJointActionsRecursively (Index curAgentI, JointActionDiscrete &ja, Index jaI)
 
void CreateJointObservations ()
 
void CreateJointStates ()
 This function generates the joint -> individual state index cache. More...
 
std::vector< IndexJointToIndividualActionIndicesNoCache (Index jaI) const
 
std::vector< IndexJointToIndividualObservationIndicesNoCache (Index joI) const
 

Private Attributes

std::vector< size_t > _m_actionStepSize
 
size_t * _m_actionStepSizeArray
 
std::vector
< MultiAgentDecisionProcessDiscrete * > 
_m_individualMADPDs
 In a transition-observation independent MADP, each agent has a set of local states and observations together with an individual transition and observation model. More...
 
std::vector< std::vector
< ObservationDiscrete > > 
_m_indivObs
 
std::vector< std::vector< Index > > _m_indivStateIndices
 The vector storing the individual state indices for each joint index: _m_indivStateIndices[jointStateIndex] = vector<Index> More...
 
std::map< Index, std::vector
< Index > > * 
_m_indivStateIndicesMap
 
bool _m_initialized
 Boolean to indicate whether this MADPDiscrete has been initialized. More...
 
StateDistributionVector_m_initialStateDistribution
 The vector containing the initial state distr over joint states. More...
 
std::map< Index,
JointActionDiscrete * > * 
_m_jointActionMap
 
std::vector
< JointActionDiscrete * > 
_m_jointActionVec
 The vector storing the joint actions. More...
 
bool _m_jointIndicesCached
 Boolean indicating whether joint indices have been cached. More...
 
bool _m_jointModelsGenerated
 Boolean indicating whether joint models have been generated. More...
 
std::vector
< JointObservationDiscrete * > 
_m_jointObs
 
std::map< Index,
JointObservationDiscrete * > * 
_m_jointObsMap
 
std::vector< State * > _m_jointStates
 
std::map< std::vector< Index >
, State * > * 
_m_jointStatesMap
 
std::vector< std::vector< Index > > _m_jointToIndActionCache
 
std::vector< std::vector< Index > > _m_jointToIndObsCache
 
size_t _m_nr_agents
 
std::vector< size_t > _m_nrIndivActions
 
std::vector< size_t > _m_nrIndivObs
 
std::vector< size_t > _m_nrIndivStates
 Vector that stores the number of individual states. More...
 
size_t _m_nrJointActions
 the number of joint actions. More...
 
size_t _m_nrJointObservations
 
size_t _m_nrJointStates
 
std::vector< size_t > _m_observationStepSize
 
ObservationModelDiscrete_m_p_oModel
 
TransitionModelDiscrete_m_p_tModel
 
bool _m_sparse
 Boolean that indicates whether models should be stored sparsely. More...
 
std::vector< size_t > _m_stateStepSize
 

Additional Inherited Members

- Protected Attributes inherited from MultiAgentDecisionProcess
std::vector< Agent_m_agents
 Vector containing Agent objects, which are indexed named entities. More...
 
Scope _m_allAgentsScope
 Scope containing all agents - usefull sometimes. More...
 
size_t _m_nrAgents
 The number of agents participating in the MADP. More...
 
std::string _m_problemFile
 String holding the filename of the problem file to be parsed - if applicable. More...
 
std::string _m_unixName
 String for the unix name of the MADP. More...
 

Detailed Description

TransitionObservationIndependentMADPDiscrete is an base class that defines the primary properties of a Transition and Observation independent decision process.

It implements the transition and observation model by assigning a regular (1-agent) MultiAgentDecisionProcessDiscrete for each agent: the agents local model. This class is responsible for constructing the joint actions and observations (upon which rewards will typically be based).

Constructor & Destructor Documentation

TransitionObservationIndependentMADPDiscrete::TransitionObservationIndependentMADPDiscrete ( const std::string &  name = "received unspec. by TransitionObservationIndependentMADPDiscrete",
const std::string &  descr = "received unspec.by TransitionObservationIndependentMADPDiscrete",
const std::string &  pf = "received unspec. by TransitionObservationIndependentMADPDiscrete",
bool  cacheFlatModels = false 
)
TransitionObservationIndependentMADPDiscrete::TransitionObservationIndependentMADPDiscrete ( const TransitionObservationIndependentMADPDiscrete )
TransitionObservationIndependentMADPDiscrete::~TransitionObservationIndependentMADPDiscrete ( )
virtual

Destructor.

References _m_individualMADPDs, and _m_jointActionVec.

Member Function Documentation

void TransitionObservationIndependentMADPDiscrete::AddAction ( Index  agentI,
const std::string &  name 
)

Adds an action with a particular name for the specified agent.

References _m_individualMADPDs.

void TransitionObservationIndependentMADPDiscrete::AddAgent ( const std::string &  name = "unspec.")
void TransitionObservationIndependentMADPDiscrete::AddObservation ( Index  agentI,
const std::string &  name 
)

Adds an Observation with a particular name for the specified agent.

References _m_individualMADPDs.

void TransitionObservationIndependentMADPDiscrete::AddState ( Index  agentI,
const std::string &  name 
)

Adds a state with a particular name for the specified agent.

References _m_individualMADPDs.

size_t TransitionObservationIndependentMADPDiscrete::ConstructJointObservationsRecursively ( Index  curAgentI,
JointObservationDiscrete jo,
Index  joI 
)
private
void TransitionObservationIndependentMADPDiscrete::CreateCentralizedSparseModels ( )
protected
void TransitionObservationIndependentMADPDiscrete::CreateISD ( )
private
void TransitionObservationIndependentMADPDiscrete::CreateJointActions ( )
private
size_t TransitionObservationIndependentMADPDiscrete::CreateJointActionsRecursively ( Index  curAgentI,
JointActionDiscrete ja,
Index  jaI 
)
private
void TransitionObservationIndependentMADPDiscrete::CreateJointStates ( )
private
const Action* TransitionObservationIndependentMADPDiscrete::GetAction ( Index  agentI,
Index  a 
) const
inlinevirtual

Get a pointer to action a of agentI.

Implements MultiAgentDecisionProcessDiscreteInterface.

References GetIndividualMADPD().

double TransitionObservationIndependentMADPDiscrete::GetInitialStateProbability ( Index  sI) const
virtual
StateDistributionVector * TransitionObservationIndependentMADPDiscrete::GetISD ( ) const
virtual

returns the initial state distribution.

Implements MultiAgentDecisionProcessDiscreteInterface.

References _m_initialStateDistribution, and _m_jointModelsGenerated.

Referenced by CreateISD().

const JointAction* TransitionObservationIndependentMADPDiscrete::GetJointAction ( Index  i) const
inlinevirtual

Returns a pointer to joint action i.

Implements MultiAgentDecisionProcessDiscreteInterface.

References GetJointActionDiscrete().

const JointObservation * TransitionObservationIndependentMADPDiscrete::GetJointObservation ( Index  i) const
virtual
size_t TransitionObservationIndependentMADPDiscrete::GetNrActions ( Index  agentI) const
inlinevirtual

return the number of actions of agent agentI

Implements MultiAgentDecisionProcessDiscreteInterface.

References GetIndividualMADPD(), and MultiAgentDecisionProcessDiscrete::GetNrActions().

const std::vector<size_t>& TransitionObservationIndependentMADPDiscrete::GetNrActions ( ) const
inlinevirtual
size_t TransitionObservationIndependentMADPDiscrete::GetNrJointActions ( ) const
inlinevirtual

return the number of joint actions.

Implements MultiAgentDecisionProcessDiscreteInterface.

Referenced by CreateCentralizedSparseTransitionModel(), and SoftPrint().

size_t TransitionObservationIndependentMADPDiscrete::GetNrJointActions ( const Scope agScope) const
virtual

Get the number of joint actions the agents in agScope can form.

Implements MultiAgentDecisionProcessDiscreteInterface.

References GetNrActions(), IndexTools::RestrictIndividualIndicesToScope(), and VectorTools::VectorProduct().

size_t TransitionObservationIndependentMADPDiscrete::GetNrJointObservations ( ) const
inlinevirtual

Get the number of joint observations.

Implements MultiAgentDecisionProcessDiscreteInterface.

Referenced by SoftPrint().

size_t TransitionObservationIndependentMADPDiscrete::GetNrJointStates ( ) const
inline

Referenced by GetNrStates(), and SoftPrint().

size_t TransitionObservationIndependentMADPDiscrete::GetNrObservations ( Index  agentI) const
inlinevirtual

return the number of observations of agent agentI

Implements MultiAgentDecisionProcessDiscreteInterface.

References GetIndividualMADPD(), and MultiAgentDecisionProcessDiscrete::GetNrObservations().

const std::vector<size_t>& TransitionObservationIndependentMADPDiscrete::GetNrObservations ( ) const
inlinevirtual

Returns a vector with the number of observations for each agent.

Implements MultiAgentDecisionProcessDiscreteInterface.

Referenced by CreateJointObservations(), and JointToIndividualObservationIndicesNoCache().

size_t TransitionObservationIndependentMADPDiscrete::GetNrStates ( Index  agI) const
inline

Returns the number of local states for agent i.

size_t TransitionObservationIndependentMADPDiscrete::GetNrStates ( ) const
inlinevirtual

returns the number of (joint) states.

Implements MultiAgentDecisionProcessDiscreteInterface.

References GetNrJointStates().

Referenced by TOIDecMDPDiscrete::CreateStateObservations().

const Observation* TransitionObservationIndependentMADPDiscrete::GetObservation ( Index  agentI,
Index  o 
) const
inlinevirtual

Get a pointer to observation o of agentI.

Implements MultiAgentDecisionProcessDiscreteInterface.

References GetIndividualMADPD().

ObservationModelDiscrete* TransitionObservationIndependentMADPDiscrete::GetObservationModelDiscretePtr ( ) const
inlinevirtual

Returns a pointer to the underlying observation model.

If speed is required (for instance when looping through all states) the pointer can be requested by an algorithm. It can than obtain a pointer to the actual implementation type by runtime type identification. (i.e., using typeid and dynamic_cast).

Implements MultiAgentDecisionProcessDiscreteInterface.

Referenced by CreateCentralizedObservationTransitionModel().

double TransitionObservationIndependentMADPDiscrete::GetObservationProbability ( Index  jaI,
Index  sucSI,
Index  joI 
) const
virtual
double TransitionObservationIndependentMADPDiscrete::GetObservationProbability ( const std::vector< Index > &  aIs,
const std::vector< Index > &  sucSIs,
const std::vector< Index > &  oIs 
) const
inline
OGet* TransitionObservationIndependentMADPDiscrete::GetOGet ( ) const
inlinevirtual
bool TransitionObservationIndependentMADPDiscrete::GetSparse ( ) const
inlineprotected
const State* TransitionObservationIndependentMADPDiscrete::GetState ( Index  i) const
inlinevirtual
TGet* TransitionObservationIndependentMADPDiscrete::GetTGet ( ) const
inlinevirtual
TransitionModelDiscrete* TransitionObservationIndependentMADPDiscrete::GetTransitionModelDiscretePtr ( ) const
inlinevirtual

Returns a pointer to the underlying transition model.

If speed is required (for instance when looping through all states) the pointer can be requested by an algorithm. It can than obtain a pointer to the actual implementation type by runtime type identification. (i.e., using typeid and dynamic_cast).

Implements MultiAgentDecisionProcessDiscreteInterface.

Referenced by CreateCentralizedSparseTransitionModel().

double TransitionObservationIndependentMADPDiscrete::GetTransitionProbability ( Index  sI,
Index  jaI,
Index  sucSI 
) const
virtual
double TransitionObservationIndependentMADPDiscrete::GetTransitionProbability ( const std::vector< Index > &  sIs,
const std::vector< Index > &  aIs,
const std::vector< Index > &  sucSIs 
) const
inline
Index TransitionObservationIndependentMADPDiscrete::IndividualToJointActionIndices ( const std::vector< Index > &  indivActionIndices) const
inlinevirtual

Returns the joint action index that corresponds to the vector of specified individual action indices.

Implements MultiAgentDecisionProcessDiscreteInterface.

References IndexTools::IndividualToJointIndicesStepSize().

Referenced by CreateCentralizedObservationTransitionModel(), CreateCentralizedSparseTransitionModel(), and JointToRestrictedJointActionIndex().

Index TransitionObservationIndependentMADPDiscrete::IndividualToJointActionIndices ( const Index AI_ar) const
inlinevirtual

Returns the joint action index that corresponds to the array of specified individual action indices.

Implements MultiAgentDecisionProcessDiscreteInterface.

References IndexTools::IndividualToJointIndicesArrayStepSize().

Index TransitionObservationIndependentMADPDiscrete::IndividualToJointActionIndices ( const std::vector< Index > &  ja_e,
const Scope agSC 
) const
inlinevirtual
Index TransitionObservationIndependentMADPDiscrete::IndividualToJointActionIndices ( Index IndexArray) const
inline

converts individual to joint actions.

References IndexTools::IndividualToJointIndicesArray().

Index TransitionObservationIndependentMADPDiscrete::IndividualToJointObservationIndices ( const std::vector< Index > &  indivObsIndices) const
inlinevirtual
Index TransitionObservationIndependentMADPDiscrete::IndividualToJointStateIndices ( const std::vector< Index > &  indivStateIndices) const
inline
bool TransitionObservationIndependentMADPDiscrete::Initialize ( )
inline

References SetInitialized().

const std::vector<Index>& TransitionObservationIndependentMADPDiscrete::JointToIndividualActionIndices ( Index  jaI) const
inlinevirtual
std::vector<Index> TransitionObservationIndependentMADPDiscrete::JointToIndividualActionIndices ( Index  ja_e,
const Scope agSC 
) const
inlinevirtual
vector< Index > TransitionObservationIndependentMADPDiscrete::JointToIndividualActionIndicesNoCache ( Index  jaI) const
private
const std::vector<Index>& TransitionObservationIndependentMADPDiscrete::JointToIndividualObservationIndices ( Index  joI) const
inlinevirtual

returns the individual indices for joint observation joI.

Implements MultiAgentDecisionProcessDiscreteInterface.

Referenced by GetObservationProbability().

vector< Index > TransitionObservationIndependentMADPDiscrete::JointToIndividualObservationIndicesNoCache ( Index  joI) const
private
Index TransitionObservationIndependentMADPDiscrete::JointToRestrictedJointActionIndex ( Index  jaI,
const Scope agSc_e 
) const
inlinevirtual

Converts a global joint action index jaI to a restricted joint action index ja_e, for agents scope agSc_e Returns a vector of indices to indiv.

action indicies corr. to joint action index jaI.

Implements MultiAgentDecisionProcessDiscreteInterface.

References IndividualToJointActionIndices(), JointToIndividualActionIndices(), and IndexTools::RestrictIndividualIndicesToScope().

void TransitionObservationIndependentMADPDiscrete::Print ( ) const
inline

Prints information regarding this TransitionObservationIndependentMADPDiscrete.

References SoftPrint().

void TransitionObservationIndependentMADPDiscrete::PrintActionSets ( ) const
inline

Prints the action set for each agent.

References SoftPrintActionSets().

void TransitionObservationIndependentMADPDiscrete::PrintJointActionSet ( ) const
inline

Prints the set of joint actions.

References SoftPrintJointActionSet().

Index TransitionObservationIndependentMADPDiscrete::SampleInitialState ( ) const
inlinevirtual
Index TransitionObservationIndependentMADPDiscrete::SampleJointObservation ( Index  jaI,
Index  sucI 
) const
inlinevirtual
std::vector<Index> TransitionObservationIndependentMADPDiscrete::SampleJointObservation ( const std::vector< Index > &  aIs,
const std::vector< Index > &  sucIs 
) const
inline
Index TransitionObservationIndependentMADPDiscrete::SampleSuccessorState ( Index  sI,
Index  jaI 
) const
inlinevirtual

returns a successor state index sampled according to the transition probabilities.

Implements MultiAgentDecisionProcessDiscreteInterface.

References IndividualToJointStateIndices(), JointToIndividualActionIndices(), and JointToIndividualStateIndices().

Referenced by PlanningUnitTOIDecPOMDPDiscrete::SampleSuccessorState().

std::vector<Index> TransitionObservationIndependentMADPDiscrete::SampleSuccessorState ( const std::vector< Index > &  sIs,
const std::vector< Index > &  aIs 
) const
inline
void TransitionObservationIndependentMADPDiscrete::SetISD ( const std::vector< double > &  v)

Sets the initial state distribution to v.

References _m_initialStateDistribution, and _m_nrJointStates.

Referenced by CreateISD().

void TransitionObservationIndependentMADPDiscrete::SetNrActions ( Index  agentI,
size_t  nr 
)

Sets the number of actions for the specified agent.

References _m_individualMADPDs.

void TransitionObservationIndependentMADPDiscrete::SetNrAgents ( size_t  n)
void TransitionObservationIndependentMADPDiscrete::SetNrObservations ( Index  agentI,
size_t  nr 
)

Sets the number of Observations for the specified agent.

References _m_individualMADPDs.

Referenced by TOIDecMDPDiscrete::CreateStateObservations().

void TransitionObservationIndependentMADPDiscrete::SetNrStates ( Index  agentI,
size_t  nr 
)

Sets the number of states for the specified agent.

References _m_individualMADPDs.

void TransitionObservationIndependentMADPDiscrete::SetSparse ( bool  sparse)
string TransitionObservationIndependentMADPDiscrete::SoftPrintActionSets ( ) const
string TransitionObservationIndependentMADPDiscrete::SoftPrintJointActionSet ( ) const

SoftPrints the set of joint actions.

References _m_initialized, and _m_jointActionVec.

Referenced by PrintJointActionSet(), and SoftPrint().

string TransitionObservationIndependentMADPDiscrete::SoftPrintState ( Index  sI) const
virtual

Member Data Documentation

std::vector<size_t> TransitionObservationIndependentMADPDiscrete::_m_actionStepSize
private

Referenced by SetInitialized().

size_t* TransitionObservationIndependentMADPDiscrete::_m_actionStepSizeArray
private

Referenced by SetInitialized().

std::vector<MultiAgentDecisionProcessDiscrete*> TransitionObservationIndependentMADPDiscrete::_m_individualMADPDs
private

In a transition-observation independent MADP, each agent has a set of local states and observations together with an individual transition and observation model.

We model this as each agent having its own MultiAgentDecisionProcessDiscrete. This is the vector that contains a pointer to each agent's MultiAgentDecisionProcessDiscrete.

Referenced by AddAction(), AddAgent(), AddObservation(), AddState(), CreateCentralizedObservationTransitionModel(), CreateCentralizedSparseTransitionModel(), SetInitialized(), SetNrActions(), SetNrAgents(), SetNrObservations(), SetNrStates(), SetSparse(), and ~TransitionObservationIndependentMADPDiscrete().

std::vector<std::vector<ObservationDiscrete> > TransitionObservationIndependentMADPDiscrete::_m_indivObs
private
std::vector< std::vector<Index> > TransitionObservationIndependentMADPDiscrete::_m_indivStateIndices
private

The vector storing the individual state indices for each joint index: _m_indivStateIndices[jointStateIndex] = vector<Index>

Referenced by CreateISD(), CreateJointStates(), GetObservationProbability(), and GetTransitionProbability().

std::map< Index, std::vector<Index> >* TransitionObservationIndependentMADPDiscrete::_m_indivStateIndicesMap
private
StateDistributionVector* TransitionObservationIndependentMADPDiscrete::_m_initialStateDistribution
private

The vector containing the initial state distr over joint states.

Referenced by GetInitialStateProbability(), GetISD(), SetISD(), and TransitionObservationIndependentMADPDiscrete().

std::map<Index, JointActionDiscrete*>* TransitionObservationIndependentMADPDiscrete::_m_jointActionMap
private
std::vector<JointActionDiscrete*> TransitionObservationIndependentMADPDiscrete::_m_jointActionVec
private
bool TransitionObservationIndependentMADPDiscrete::_m_jointIndicesCached
private
bool TransitionObservationIndependentMADPDiscrete::_m_jointModelsGenerated
private
std::vector<JointObservationDiscrete*> TransitionObservationIndependentMADPDiscrete::_m_jointObs
private
std::map<Index, JointObservationDiscrete*>* TransitionObservationIndependentMADPDiscrete::_m_jointObsMap
private
std::vector<State*> TransitionObservationIndependentMADPDiscrete::_m_jointStates
private

Referenced by CreateJointStates().

std::map<std::vector<Index>, State*>* TransitionObservationIndependentMADPDiscrete::_m_jointStatesMap
private
std::vector<std::vector<Index> > TransitionObservationIndependentMADPDiscrete::_m_jointToIndActionCache
private
std::vector<std::vector<Index> > TransitionObservationIndependentMADPDiscrete::_m_jointToIndObsCache
private
size_t TransitionObservationIndependentMADPDiscrete::_m_nr_agents
private

Referenced by SetInitialized().

std::vector<size_t> TransitionObservationIndependentMADPDiscrete::_m_nrIndivActions
private
std::vector<size_t> TransitionObservationIndependentMADPDiscrete::_m_nrIndivObs
private
std::vector<size_t> TransitionObservationIndependentMADPDiscrete::_m_nrIndivStates
private

Vector that stores the number of individual states.

(Created by CreateJointStates() )

Referenced by CreateJointStates(), and SetInitialized().

size_t TransitionObservationIndependentMADPDiscrete::_m_nrJointActions
private
size_t TransitionObservationIndependentMADPDiscrete::_m_nrJointObservations
private
std::vector<size_t> TransitionObservationIndependentMADPDiscrete::_m_observationStepSize
private

Referenced by SetInitialized().

bool TransitionObservationIndependentMADPDiscrete::_m_sparse
private

Boolean that indicates whether models should be stored sparsely.

Referenced by AddAgent(), SetInitialized(), SetNrAgents(), SetSparse(), and TransitionObservationIndependentMADPDiscrete().

std::vector<size_t> TransitionObservationIndependentMADPDiscrete::_m_stateStepSize
private

Referenced by SetInitialized().