MultiAgentDecisionProcess  Release 0.2.1
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:
+ Collaboration diagram for TransitionObservationIndependentMADPDiscrete:

Public Member Functions

void AddAction (Index agentI, std::string name)
 Adds an action with a particular name for the specified agent.
void AddAgent (std::string name="unspec.")
 Adds one agent with an optional name.
void AddObservation (Index agentI, std::string name)
 Adds an Observation with a particular name for the specified agent.
void AddState (Index agentI, std::string name)
 Adds a state with a particular name for the specified agent.
void CreateCentralizedFullModels ()
void CreateCentralizedSparseModels ()
const ActionGetAction (Index agentI, Index a) const
 Get a pointer to action a of agentI.
MultiAgentDecisionProcessDiscreteGetIndividualMADPD (Index agentI) const
 Returns a pointer to agentsI's individual model.
double GetInitialStateProbability (Index sI) const
 returns the prob.
virtual const
StateDistributionVector
GetISD () const
 returns the initial state distribution.
const JointActionGetJointAction (Index i) const
 Returns a pointer to joint action i.
const JointActionDiscreteGetJointActionDiscrete (Index i) const
 return a ref to the i-th joint action (a JointActionDiscrete).
const JointObservationGetJointObservation (Index i) const
 Get a pointer to the i-th joint observation.
size_t GetNrActions (Index agentI) const
 return the number of actions of agent agentI
const std::vector< size_t > & GetNrActions () const
 returns a vector with the number of actions for each agent.
size_t GetNrJointActions () const
 return the number of joint actions.
size_t GetNrJointObservations () const
 Get the number of joint observations.
size_t GetNrJointStates () const
size_t GetNrObservations (Index agentI) const
 return the number of observations of agent agentI
const std::vector< size_t > & GetNrObservations () const
 Returns a vector with the number of observations for each agent.
size_t GetNrStates (Index agI) const
 Returns the number of local states for agent i.
size_t GetNrStates () const
 returns the number of (joint) states.
const ObservationGetObservation (Index agentI, Index o) const
 Get a pointer to observation o of agentI.
ObservationModelDiscreteGetObservationModelDiscretePtr () const
 Returns a pointer to the underlying observation model.
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).
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.
const StateGetState (const std::vector< Index > &sIs) const
TGetGetTGet () const
TransitionModelDiscreteGetTransitionModelDiscretePtr () const
 Returns a pointer to the underlying transition model.
double GetTransitionProbability (Index sI, Index jaI, Index sucSI) const
 returns probability of joint transition (the product of the probabilities of the individual transitions)
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.
Index IndividualToJointActionIndices (const Index *AI_ar) const
 Returns the joint action index that corresponds to the array of specified individual action indices.
Index IndividualToJointActionIndices (Index *IndexArray) const
 converts individual to joint actions.
Index IndividualToJointObservationIndices (const std::vector< Index > &indivObsIndices) const
 returns the joint index for indivObsIndices
Index IndividualToJointStateIndices (const std::vector< Index > &indivStateIndices) const
 returns the joint index for indivStateIndices
bool Initialize ()
const std::vector< Index > & JointToIndividualActionIndices (Index jaI) const
 Returns the joint action index that corresponds to the array of specified individual action indices.
const std::vector< Index > & JointToIndividualObservationIndices (Index joI) const
 returns the individual indices for joint observation joI.
const std::vector< Index > & JointToIndividualStateIndices (Index jointSI) const
 returns a vector of individual (local) state indices corresponding to joint state index jointSI.
void Print () const
 Prints information regarding this TransitionObservationIndependentMADPDiscrete.
void PrintActionSets () const
 Prints the action set for each agent.
void PrintJointActionSet () const
 Prints the set of joint actions.
Index SampleInitialState (void) const
 Samples an initial state.
std::vector< Index > SampleInitialStates (void) const
Index SampleJointObservation (Index jaI, Index sucI) const
 Returns a joint observation, sampled according to the observation probabilities.
std::vector< Index > SampleJointObservation (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.
std::vector< Index > SampleSuccessorState (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.
void SetNrActions (Index agentI, size_t nr)
 Sets the number of actions for the specified agent.
void SetNrAgents (size_t n)
 Sets the number of agents to n.
void SetNrObservations (Index agentI, size_t nr)
 Sets the number of Observations for the specified agent.
void SetNrStates (Index agentI, size_t nr)
 Sets the number of states for the specified agent.
void SetSparse (bool sparse)
std::string SoftPrint () const
 SoftPrints information regarding this TransitionObservationIndependentMADPDiscrete.
std::string SoftPrintActionSets () const
 SoftPrints the action set for each agent.
std::string SoftPrintJointActionSet () const
 SoftPrints the set of joint actions.
std::string SoftPrintState (Index sI) const
 TransitionObservationIndependentMADPDiscrete (std::string name="received unspec. by TransitionObservationIndependentMADPDiscrete", std::string descr="received unspec.by TransitionObservationIndependentMADPDiscrete", std::string pf="received unspec. by TransitionObservationIndependentMADPDiscrete")
 TransitionObservationIndependentMADPDiscrete (const TransitionObservationIndependentMADPDiscrete &)
virtual ~TransitionObservationIndependentMADPDiscrete ()
 Destructor.
- Public Member Functions inherited from MultiAgentDecisionProcess
size_t GetNrAgents () const
 Returns the number of agents in this MultiAgentDecisionProcess.
std::string GetProblemFile () const
 Returns the name of the problem file.
std::string GetUnixName () const
 Returns a name which can be in unix path, by default the base part of the problem filename.
 MultiAgentDecisionProcess (size_t nrAgents, std::string name="received unspec. by MultiAgentDecisionProcess", std::string description="received unspec. by MultiAgentDecisionProcess", std::string pf="received unspec. by MultiAgentDecisionProcess")
 Constructor.
 MultiAgentDecisionProcess (std::string name="received unspec. by MultiAgentDecisionProcess", std::string description="received unspec. by MultiAgentDecisionProcess", std::string pf="received unspec. by MultiAgentDecisionProcess")
 Default Constructor without specifying the number of agents.
void SetUnixName (std::string unixName)
 Sets the name which can be used inin unix paths.
virtual ~MultiAgentDecisionProcess ()
 Destructor.
- Public Member Functions inherited from MultiAgentDecisionProcessInterface
virtual ~MultiAgentDecisionProcessInterface ()
 Destructor.
- Public Member Functions inherited from NamedDescribedEntity
std::string GetDescription () const
 Get the description of the NamedDescribedEntity.
std::string GetName () const
 Get the name of the NamedDescribedEntity.
 NamedDescribedEntity (std::string name=std::string("undefined"), std::string description=std::string("undefined"))
 (default) Constructor
 NamedDescribedEntity (const NamedDescribedEntity &)
 copy constructor.
void PrintBrief () const
 Prints the name (by default).
void SetDescription (std::string description)
 Set the description.
void SetName (std::string name)
 Set the name.
virtual std::string SoftPrintBrief () const
 Returns the name (if not reimplemented).
virtual ~NamedDescribedEntity ()
 Destructor.
- Public Member Functions inherited from MultiAgentDecisionProcessDiscreteInterface
virtual
MultiAgentDecisionProcessDiscreteInterface
Clone () const =0
 Returns a pointer to a copy of this class.
virtual ~MultiAgentDecisionProcessDiscreteInterface ()
 Destructor. Can't make a virt.destr. pure abstract!

Protected Member Functions

bool GetSparse () const
virtual bool SetInitialized (bool b)
 Sets _m_initialized to b.

Private Member Functions

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

Private Attributes

size_t * _m_actionStepSize
 The stepsize array - used for indiv->joint index calculation.
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.
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>
std::map< Index, std::vector
< Index > > * 
_m_indivStateIndicesMap
bool _m_initialized
 Boolean to indicate whether this MADPDiscrete has been initialized.
StateDistributionVector_m_initialStateDistribution
 The vector containing the initial state distr over joint states.
std::map< Index,
JointActionDiscrete * > * 
_m_jointActionMap
std::vector
< JointActionDiscrete * > 
_m_jointActionVec
 The vector storing the joint actions.
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
bool _m_noJointModels
 Boolean indicating whether joint models should be generated.
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.
size_t _m_nrJointActions
 the number of joint actions.
size_t _m_nrJointObservations
size_t _m_nrJointStates
ObservationModelDiscrete_m_p_oModel
TransitionModelDiscrete_m_p_tModel
bool _m_sparse
 Boolean that indicates whether models should be stored sparsely.

Additional Inherited Members

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

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).

Definition at line 55 of file TransitionObservationIndependentMADPDiscrete.h.

Constructor & Destructor Documentation

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

Destructor.

Definition at line 73 of file TransitionObservationIndependentMADPDiscrete.cpp.

References _m_individualMADPDs, and _m_jointActionVec.

Member Function Documentation

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

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

Definition at line 173 of file TransitionObservationIndependentMADPDiscrete.cpp.

References _m_individualMADPDs.

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

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

Definition at line 187 of file TransitionObservationIndependentMADPDiscrete.cpp.

References _m_individualMADPDs.

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

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

Definition at line 159 of file TransitionObservationIndependentMADPDiscrete.cpp.

References _m_individualMADPDs.

size_t TransitionObservationIndependentMADPDiscrete::ConstructJointObservationsRecursively ( Index  curAgentI,
JointObservationDiscrete jo,
Index  joI 
)
private
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.

Definition at line 353 of file TransitionObservationIndependentMADPDiscrete.h.

References GetAction(), and GetIndividualMADPD().

Referenced by GetAction().

double TransitionObservationIndependentMADPDiscrete::GetInitialStateProbability ( Index  sI) const
inlinevirtual

returns the prob.

of state sI according to the initial state distribution.

Implements MultiAgentDecisionProcessDiscreteInterface.

Definition at line 341 of file TransitionObservationIndependentMADPDiscrete.h.

References _m_initialStateDistribution.

const StateDistributionVector * TransitionObservationIndependentMADPDiscrete::GetISD ( ) const
virtual

returns the initial state distribution.

Implements MultiAgentDecisionProcessDiscreteInterface.

Definition at line 1038 of file TransitionObservationIndependentMADPDiscrete.cpp.

References _m_initialStateDistribution, and _m_noJointModels.

Referenced by CreateISD().

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

Returns a pointer to joint action i.

Implements MultiAgentDecisionProcessDiscreteInterface.

Definition at line 357 of file TransitionObservationIndependentMADPDiscrete.h.

References GetJointActionDiscrete().

const JointObservation * TransitionObservationIndependentMADPDiscrete::GetJointObservation ( Index  i) const
virtual
size_t TransitionObservationIndependentMADPDiscrete::GetNrActions ( Index  agentI) const
inlinevirtual
const std::vector<size_t>& TransitionObservationIndependentMADPDiscrete::GetNrActions ( ) const
inlinevirtual
size_t TransitionObservationIndependentMADPDiscrete::GetNrJointActions ( ) const
virtual

return the number of joint actions.

Implements MultiAgentDecisionProcessDiscreteInterface.

Definition at line 1071 of file TransitionObservationIndependentMADPDiscrete.cpp.

References _m_initialized, and _m_nrJointActions.

Referenced by SoftPrint().

size_t TransitionObservationIndependentMADPDiscrete::GetNrJointObservations ( ) const
virtual

Get the number of joint observations.

Implements MultiAgentDecisionProcessDiscreteInterface.

Definition at line 1079 of file TransitionObservationIndependentMADPDiscrete.cpp.

References _m_initialized, and _m_nrJointObservations.

Referenced by SoftPrint().

size_t TransitionObservationIndependentMADPDiscrete::GetNrJointStates ( ) const

Definition at line 1063 of file TransitionObservationIndependentMADPDiscrete.cpp.

References _m_initialized, and _m_nrJointStates.

Referenced by GetNrStates(), and SoftPrint().

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

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

Implements MultiAgentDecisionProcessDiscreteInterface.

Definition at line 365 of file TransitionObservationIndependentMADPDiscrete.h.

References _m_nrIndivObs.

Referenced by CreateJointObservations(), IndividualToJointObservationIndices(), and JointToIndividualObservationIndicesNoCache().

size_t TransitionObservationIndependentMADPDiscrete::GetNrStates ( Index  agI) const
inline

Returns the number of local states for agent i.

Definition at line 227 of file TransitionObservationIndependentMADPDiscrete.h.

References _m_individualMADPDs.

size_t TransitionObservationIndependentMADPDiscrete::GetNrStates ( ) const
inlinevirtual

returns the number of (joint) states.

Implements MultiAgentDecisionProcessDiscreteInterface.

Definition at line 332 of file TransitionObservationIndependentMADPDiscrete.h.

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.

Definition at line 372 of file TransitionObservationIndependentMADPDiscrete.h.

References GetIndividualMADPD(), and GetObservation().

Referenced by GetObservation().

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.

Definition at line 384 of file TransitionObservationIndependentMADPDiscrete.h.

References _m_p_oModel.

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
OGet * TransitionObservationIndependentMADPDiscrete::GetOGet ( ) const
virtual
bool TransitionObservationIndependentMADPDiscrete::GetSparse ( ) const
inlineprotected
const State * TransitionObservationIndependentMADPDiscrete::GetState ( Index  i) const
virtual
TGet * TransitionObservationIndependentMADPDiscrete::GetTGet ( ) const
virtual
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.

Definition at line 381 of file TransitionObservationIndependentMADPDiscrete.h.

References _m_p_tModel.

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
Index TransitionObservationIndependentMADPDiscrete::IndividualToJointActionIndices ( const std::vector< Index > &  indivActionIndices) const
virtual

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

Implements MultiAgentDecisionProcessDiscreteInterface.

Definition at line 661 of file TransitionObservationIndependentMADPDiscrete.cpp.

References _m_initialized, _m_nrIndivActions, and IndexTools::IndividualToJointIndices().

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.

Definition at line 249 of file TransitionObservationIndependentMADPDiscrete.h.

References _m_actionStepSize, _m_nr_agents, and IndexTools::IndividualToJointIndicesArrayStepSize().

Index TransitionObservationIndependentMADPDiscrete::IndividualToJointActionIndices ( Index *  IndexArray) const

converts individual to joint actions.

Definition at line 653 of file TransitionObservationIndependentMADPDiscrete.cpp.

References _m_nrIndivActions, and IndexTools::IndividualToJointIndicesArray().

Index TransitionObservationIndependentMADPDiscrete::IndividualToJointObservationIndices ( const std::vector< Index > &  indivObsIndices) const
virtual
Index TransitionObservationIndependentMADPDiscrete::IndividualToJointStateIndices ( const std::vector< Index > &  indivStateIndices) const

returns the joint index for indivStateIndices

Definition at line 772 of file TransitionObservationIndependentMADPDiscrete.cpp.

References _m_nrIndivStates, and IndexTools::IndividualToJointIndices().

Referenced by SampleInitialState(), and SampleSuccessorState().

bool TransitionObservationIndependentMADPDiscrete::Initialize ( )
inline

Definition at line 164 of file TransitionObservationIndependentMADPDiscrete.h.

References SetInitialized().

const std::vector<Index>& TransitionObservationIndependentMADPDiscrete::JointToIndividualActionIndices ( Index  jaI) const
inlinevirtual

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

returns a vector of indices to indiv. action indicies corr. to joint action index jaI.

Implements MultiAgentDecisionProcessDiscreteInterface.

Definition at line 247 of file TransitionObservationIndependentMADPDiscrete.h.

References _m_jointToIndActionCache.

Referenced by GetObservationProbability(), TOIFactoredRewardDecPOMDPDiscrete::GetReward(), TOICompactRewardDecPOMDPDiscrete::GetReward(), TOIDecPOMDPDiscrete::GetReward(), GetTransitionProbability(), SampleJointObservation(), SampleSuccessorState(), and TOIDecPOMDPDiscrete::SetReward().

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.

Definition at line 265 of file TransitionObservationIndependentMADPDiscrete.h.

References _m_jointToIndObsCache.

Referenced by GetObservationProbability().

vector< Index > TransitionObservationIndependentMADPDiscrete::JointToIndividualObservationIndicesNoCache ( Index  joI) const
private
const std::vector< Index > & TransitionObservationIndependentMADPDiscrete::JointToIndividualStateIndices ( Index  jointSI) const
void TransitionObservationIndependentMADPDiscrete::Print ( ) const
inline

Prints information regarding this TransitionObservationIndependentMADPDiscrete.

Reimplemented from MultiAgentDecisionProcess.

Reimplemented in TOIDecPOMDPDiscrete.

Definition at line 284 of file TransitionObservationIndependentMADPDiscrete.h.

References SoftPrint().

void TransitionObservationIndependentMADPDiscrete::PrintActionSets ( ) const
inline

Prints the action set for each agent.

Definition at line 272 of file TransitionObservationIndependentMADPDiscrete.h.

References SoftPrintActionSets().

void TransitionObservationIndependentMADPDiscrete::PrintJointActionSet ( ) const
inline

Prints the set of joint actions.

Definition at line 277 of file TransitionObservationIndependentMADPDiscrete.h.

References SoftPrintJointActionSet().

Index TransitionObservationIndependentMADPDiscrete::SampleInitialState ( void  ) const
virtual
vector< Index > TransitionObservationIndependentMADPDiscrete::SampleInitialStates ( void  ) const
Index TransitionObservationIndependentMADPDiscrete::SampleJointObservation ( Index  jaI,
Index  sucI 
) const
virtual

Returns a joint observation, sampled according to the observation probabilities.

Implements MultiAgentDecisionProcessDiscreteInterface.

Definition at line 995 of file TransitionObservationIndependentMADPDiscrete.cpp.

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

vector< Index > TransitionObservationIndependentMADPDiscrete::SampleJointObservation ( const std::vector< Index > &  aIs,
const std::vector< Index > &  sucIs 
) const
Index TransitionObservationIndependentMADPDiscrete::SampleSuccessorState ( Index  sI,
Index  jaI 
) const
virtual

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

Implements MultiAgentDecisionProcessDiscreteInterface.

Definition at line 975 of file TransitionObservationIndependentMADPDiscrete.cpp.

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

vector< Index > TransitionObservationIndependentMADPDiscrete::SampleSuccessorState ( const std::vector< Index > &  sIs,
const std::vector< Index > &  aIs 
) const
bool TransitionObservationIndependentMADPDiscrete::SetInitialized ( bool  b)
protectedvirtual
void TransitionObservationIndependentMADPDiscrete::SetISD ( const std::vector< double > &  v)

Sets the initial state distribution to v.

Definition at line 211 of file TransitionObservationIndependentMADPDiscrete.cpp.

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.

Definition at line 166 of file TransitionObservationIndependentMADPDiscrete.cpp.

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.

Definition at line 180 of file TransitionObservationIndependentMADPDiscrete.cpp.

References _m_individualMADPDs.

Referenced by TOIDecMDPDiscrete::CreateStateObservations().

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

Sets the number of states for the specified agent.

Definition at line 153 of file TransitionObservationIndependentMADPDiscrete.cpp.

References _m_individualMADPDs.

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

SoftPrints the set of joint actions.

Definition at line 831 of file TransitionObservationIndependentMADPDiscrete.cpp.

References _m_initialized, and _m_jointActionVec.

Referenced by PrintJointActionSet(), and SoftPrint().

string TransitionObservationIndependentMADPDiscrete::SoftPrintState ( Index  sI) const
virtual

Member Data Documentation

size_t* TransitionObservationIndependentMADPDiscrete::_m_actionStepSize
private

The stepsize array - used for indiv->joint index calculation.

Definition at line 86 of file TransitionObservationIndependentMADPDiscrete.h.

Referenced by IndividualToJointActionIndices(), and 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.

Definition at line 77 of file TransitionObservationIndependentMADPDiscrete.h.

Referenced by AddAction(), AddAgent(), AddObservation(), AddState(), GetIndividualMADPD(), GetNrStates(), 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>

Definition at line 94 of file TransitionObservationIndependentMADPDiscrete.h.

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

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.

Definition at line 104 of file TransitionObservationIndependentMADPDiscrete.h.

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

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

Definition at line 97 of file TransitionObservationIndependentMADPDiscrete.h.

Referenced by CreateJointStates(), and GetState().

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
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() )

Definition at line 90 of file TransitionObservationIndependentMADPDiscrete.h.

Referenced by CreateJointStates(), IndividualToJointStateIndices(), and JointToIndividualStateIndices().

size_t TransitionObservationIndependentMADPDiscrete::_m_nrJointActions
private
size_t TransitionObservationIndependentMADPDiscrete::_m_nrJointObservations
private
size_t TransitionObservationIndependentMADPDiscrete::_m_nrJointStates
private
bool TransitionObservationIndependentMADPDiscrete::_m_sparse
private

Boolean that indicates whether models should be stored sparsely.

Definition at line 63 of file TransitionObservationIndependentMADPDiscrete.h.

Referenced by AddAgent(), GetOGet(), GetSparse(), GetTGet(), SetNrAgents(), SetSparse(), and TransitionObservationIndependentMADPDiscrete().


The documentation for this class was generated from the following files: