MultiAgentDecisionProcess
DecPOMDPDiscrete Class Reference

DecPOMDPDiscrete represent a discrete DEC-POMDP model. More...

#include <DecPOMDPDiscrete.h>

Inheritance diagram for DecPOMDPDiscrete:
[legend]

Public Member Functions

virtual DecPOMDPDiscreteClone () const
 Returns a pointer to a copy of this class. More...
 
void CreateNewRewardModel ()
 Creates a new reward model. More...
 
void CreateNewRewardModelForAgent (Index agentI)
 implementation of POSGDiscreteInterface More...
 
 DecPOMDPDiscrete (const std::string &name="received unspec. by DecPOMDPDiscrete", const std::string &descr="received unspec. by DecPOMDPDiscrete", const std::string &pf="received unspec. by DecPOMDPDiscrete")
 Default constructor. More...
 
void ExtractMADPDiscrete (MultiAgentDecisionProcessDiscrete *madp)
 Get the MADPDiscrete components from this DecPOMDPDiscrete. More...
 
double GetReward (Index sI, Index jaI) const
 Return the reward for state, joint action indices. More...
 
double GetReward (State *s, JointAction *ja) const
 implements the DecPOMDPInterface More...
 
double GetRewardForAgent (Index agentI, State *s, JointAction *ja) const
 Function that returns the reward for a state and joint action. More...
 
double GetRewardForAgent (Index agentI, Index sI, Index jaI) const
 Return the reward for state, joint action indices. More...
 
RewardModelGetRewardModelPtr () const
 Get a pointer to the reward model. More...
 
RGetGetRGet () const
 
bool SetInitialized (bool b)
 Sets _m_initialized to b. More...
 
void SetReward (Index sI, Index jaI, double r)
 Set the reward for state, joint action indices. More...
 
void SetReward (Index sI, Index jaI, Index sucSI, double r)
 Set the reward for state, joint action , suc. state indices. More...
 
void SetReward (Index sI, Index jaI, Index sucSI, Index joI, double r)
 Set the reward for state, joint action, suc.state, joint obs indices. More...
 
void SetReward (State *s, JointAction *ja, double r)
 implements the DecPOMDPInterface More...
 
void SetRewardForAgent (Index agentI, State *s, JointAction *ja, double r)
 Function that sets the reward for an agent, state and joint action. More...
 
void SetRewardForAgent (Index agentI, Index sI, Index jaI, double r)
 
void SetRewardForAgent (Index agentI, Index sI, Index jaI, Index sucSI, double r)
 Set the reward for state, joint action , suc. state indices. More...
 
void SetRewardForAgent (Index agentI, Index sI, Index jaI, Index sucSI, Index joI, double r)
 Set the reward for state, joint action, suc.state, joint obs indices. More...
 
std::string SoftPrint () const
 Prints some information on the DecPOMDPDiscrete. More...
 
virtual ~DecPOMDPDiscrete ()
 Destructor. More...
 
- Public Member Functions inherited from DecPOMDPDiscreteInterface
virtual ~DecPOMDPDiscreteInterface ()
 import the GetReward function from the base class in current scope. More...
 
- Public Member Functions inherited from DecPOMDPInterface
virtual ~DecPOMDPInterface ()
 Virtual destructor. More...
 
- Public Member Functions inherited from POSGInterface
virtual ~POSGInterface ()
 Virtual destructor. More...
 
- Public Member Functions inherited from MultiAgentDecisionProcessInterface
virtual ~MultiAgentDecisionProcessInterface ()
 Destructor. More...
 
- Public Member Functions inherited from MultiAgentDecisionProcessDiscreteInterface
virtual ~MultiAgentDecisionProcessDiscreteInterface ()
 Destructor. More...
 
- Public Member Functions inherited from MultiAgentDecisionProcessDiscrete
void AddAction (Index AI, const std::string &name, const std::string &description="")
 
void AddObservation (Index AI, const std::string &name, const std::string &description="")
 
void AddState (const std::string &StateName)
 
size_t ConstructJointActions ()
 
size_t ConstructJointObservations ()
 
void CreateNewObservationModel ()
 Creates a new observation model mapping. More...
 
void CreateNewTransitionModel ()
 Creates a new transition model mapping. More...
 
const ActionGetAction (Index agentI, Index a) const
 Return a ref to the a-th action of agent agentI. More...
 
const ActionDiscreteGetActionDiscrete (Index agentI, Index a) const
 
Index GetActionIndexByName (const std::string &a, Index agentI) const
 
bool GetEventObservability () const
 Are we using an event observation model? More...
 
int GetFalseNegativeObs () const
 Gets the index for false negative observations (if any). A negative value means that are none (which is the default case). More...
 
double GetInitialStateProbability (Index sI) const
 
StateDistributionGetISD () const
 Returns the complete initial state distribution. More...
 
const JointActionGetJointAction (Index i) const
 Return a ref to the i-th joint action. More...
 
const JointObservationGetJointObservation (Index i) const
 Return a ref to the i-th joint observation. More...
 
const std::vector< size_t > & GetNrActions () const
 Return the number of actions vector. More...
 
size_t GetNrActions (Index AgentI) const
 Return the number of actions of agent agentI. 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
 Return the number of joint observations. More...
 
const std::vector< size_t > & GetNrObservations () const
 Return the number of observations vector. More...
 
size_t GetNrObservations (Index AgentI) const
 Return the number of observations of agent agentI. More...
 
size_t GetNrStates () const
 Return the number of states. More...
 
const ObservationGetObservation (Index agentI, Index a) const
 Return a ref to the a-th observation of agent agentI. More...
 
const ObservationDiscreteGetObservationDiscrete (Index agentI, Index a) const
 
Index GetObservationIndexByName (const std::string &o, Index agentI) const
 
const ObservationModelDiscreteGetObservationModelDiscretePtr () const
 Returns a pointer to the underlying observation model. More...
 
double GetObservationProbability (Index jaI, Index sucSI, Index joI) const
 Return the probability of joint observation joI: P(joI|jaI,sucSI). More...
 
double GetObservationProbability (Index sI, Index jaI, Index sucSI, Index joI) const
 
OGetGetOGet () const
 
bool GetSparse () const
 Are we using sparse transition and observation models? More...
 
const StateGetState (Index i) const
 Returns a pointer to state i. More...
 
Index GetStateIndexByName (const std::string &s) const
 
TGetGetTGet () const
 
const TransitionModelDiscreteGetTransitionModelDiscretePtr () const
 Returns a pointer to the underlying transition model. More...
 
double GetTransitionProbability (Index sI, Index jaI, Index sucSI) const
 Return the probability of successor state sucSI: P(sucSI|sI,jaI). 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 > &indivActionIndices) const
 Returns the joint action index that corresponds to the vector 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 IndividualToJointObservationIndices (const std::vector< Index > &indivObservationIndices) const
 Returns the joint observation index that corresponds to the vector of specified individual observation indices. More...
 
Index IndividualToJointObservationIndices (const std::vector< Index > &jo_e, const Scope &agSC) const
 indiv->joint for a restricted set (Scope) of agents More...
 
bool Initialize ()
 A function that can be called by other classes in order to request a MultiAgentDecisionProcessDiscrete to (try to) initialize. More...
 
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 a vector of indices to indiv. More...
 
std::vector< IndexJointToIndividualObservationIndices (Index jo_e, const Scope &agSC) const
 joint->indiv for a restricted set (Scope) of agents 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...
 
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...
 
 MultiAgentDecisionProcessDiscrete (const std::string &name="received unspec. by MultiAgentDecisionProcessDiscrete", const std::string &descr="received unspec.by MultiAgentDecisionProcessDiscrete", const std::string &pf="received unspec. by MultiAgentDecisionProcessDiscrete")
 Constructor that sets the. More...
 
 MultiAgentDecisionProcessDiscrete (size_t nrAgents, size_t nrS, const std::string &name="received unspec. by MultiAgentDecisionProcessDiscrete", const std::string &descr="received unspec.by MultiAgentDecisionProcessDiscrete", const std::string &pf="received unspec. by MultiAgentDecisionProcessDiscrete")
 Constructor that sets the. More...
 
 MultiAgentDecisionProcessDiscrete (const MultiAgentDecisionProcessDiscrete &a)
 Copy constructor. More...
 
void Print () const
 Prints some information on the MultiAgentDecisionProcessDiscrete. More...
 
Index SampleInitialState () const
 Sample a state according to the initial state PDF. More...
 
Index SampleJointObservation (Index jaI, Index sucI) const
 Sample an observation. More...
 
Index SampleJointObservation (Index sI, Index jaI, Index sucI) const
 
Index SampleSuccessorState (Index sI, Index jaI) const
 Sample a successor state. More...
 
bool SetActionsInitialized (bool b)
 
void SetEventObservability (bool eventO)
 Indicate whether the observation model is defined over (s',a,s) (an event-driven model) or the standard (s',a) More...
 
void SetFalseNegativeObs (Index falseNegativeObs)
 Sets the index for false negative observations (see above) More...
 
void SetISD (StateDistribution *p)
 
void SetNrActions (Index AI, size_t nrA)
 
void SetNrObservations (Index AI, size_t nrO)
 
void SetNrStates (size_t nrS)
 
void SetObservationModelPtr (ObservationModelDiscrete *ptr)
 Set the obversation model. More...
 
void SetObservationProbability (Index jaI, Index sucSI, Index joI, double p)
 Set the probability of joint observation joI: P(joI|jaI,sucSI). More...
 
void SetObservationProbability (Index sI, Index jaI, Index sucSI, Index joI, double p)
 
bool SetObservationsInitialized (bool b)
 
void SetSparse (bool sparse)
 Indicate whether sparse transition and observation models should be used. More...
 
bool SetStatesInitialized (bool b)
 
void SetTransitionModelPtr (TransitionModelDiscrete *ptr)
 Set the transition model. More...
 
void SetTransitionProbability (Index sI, Index jaI, Index sucSI, double p)
 Set the probability of successor state sucSI: P(sucSI|sI,jaI). More...
 
void SetUniformISD ()
 
std::string SoftPrint () const
 SoftPrints information on the MultiAgentDecisionProcessDiscrete. More...
 
std::string SoftPrintState (Index sI) const
 
 ~MultiAgentDecisionProcessDiscrete ()
 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 DecPOMDP
 DecPOMDP ()
 Default constructor. sets RewardType to REWARD and discount to 1.0. More...
 
double GetDiscount () const
 Returns the discount parameter. More...
 
double GetDiscountForAgent (Index agentI) const
 Returns the discount parameter. More...
 
reward_t GetRewardType () const
 Returns the reward type. More...
 
reward_t GetRewardTypeForAgent (Index agentI) const
 Returns the reward type. More...
 
void SetDiscount (double d)
 Sets the discount parameter to d. More...
 
void SetDiscountForAgent (Index agentI, double d)
 Functions needed for POSGInterface: More...
 
void SetRewardType (reward_t r)
 Sets the reward type to reward_t r. More...
 
void SetRewardTypeForAgent (Index agentI, reward_t r)
 Sets the reward type to reward_t r. More...
 
std::string SoftPrint () const
 SoftPrints some information on the DecPOMDP. More...
 

Static Public Member Functions

static void CompareModels (const DecPOMDPDiscreteInterface &d1, const DecPOMDPDiscreteInterface &d2)
 

Protected Attributes

RewardModel_m_p_rModel
 The reward model used by DecPOMDPDiscrete. More...
 
- 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...
 

Private Attributes

bool _m_initialized
 Boolean that tracks whether this DecPOMDP is initialized. More...
 

Additional Inherited Members

- Protected Member Functions inherited from MultiAgentDecisionProcessDiscrete
bool SetInitialized (bool b)
 Sets _m_initialized to b. More...
 

Detailed Description

DecPOMDPDiscrete represent a discrete DEC-POMDP model.

It implements DecPOMDPDiscreteInterface.

Also it inherits -MultiAgentDecisionProcessDiscrete -DecPOMDP

and thus implements -DecPOMDPInterface -MultiAgentDecisionProcessDiscreteInterface -MultiAgentDecisionProcessInterface

Constructor & Destructor Documentation

DecPOMDPDiscrete::DecPOMDPDiscrete ( const std::string &  name = "received unspec. by DecPOMDPDiscrete",
const std::string &  descr = "received unspec. by DecPOMDPDiscrete",
const std::string &  pf = "received unspec. by DecPOMDPDiscrete" 
)

Default constructor.

Constructor that sets the name, description, and problem file, and subsequently loads this problem file.

References _m_initialized, and _m_p_rModel.

Referenced by Clone().

DecPOMDPDiscrete::~DecPOMDPDiscrete ( )
virtual

Destructor.

References _m_p_rModel, and DEBUG_DPOMDPD.

Member Function Documentation

virtual DecPOMDPDiscrete* DecPOMDPDiscrete::Clone ( ) const
inlinevirtual

Returns a pointer to a copy of this class.

Implements DecPOMDPDiscreteInterface.

References DecPOMDPDiscrete().

void DecPOMDPDiscrete::CreateNewRewardModelForAgent ( Index  agentI)
inline

implementation of POSGDiscreteInterface

References CreateNewRewardModel().

void DecPOMDPDiscrete::ExtractMADPDiscrete ( MultiAgentDecisionProcessDiscrete madp)
double DecPOMDPDiscrete::GetReward ( Index  sI,
Index  jaI 
) const
inlinevirtual

Return the reward for state, joint action indices.

Implements DecPOMDPDiscreteInterface.

References RewardModelDiscreteInterface::Get().

Referenced by GetReward(), GetRewardForAgent(), and SetReward().

double DecPOMDPDiscrete::GetReward ( State s,
JointAction ja 
) const
inlinevirtual

implements the DecPOMDPInterface

Implements DecPOMDPInterface.

References GetReward().

double DecPOMDPDiscrete::GetRewardForAgent ( Index  agentI,
State s,
JointAction ja 
) const
inlinevirtual

Function that returns the reward for a state and joint action.

This should be very generic.

Implements POSGInterface.

References GetReward().

double DecPOMDPDiscrete::GetRewardForAgent ( Index  agentI,
Index  sI,
Index  jaI 
) const
inline

Return the reward for state, joint action indices.

References GetReward().

RewardModel* DecPOMDPDiscrete::GetRewardModelPtr ( ) const
inline
RGet * DecPOMDPDiscrete::GetRGet ( ) const
virtual

Implements DecPOMDPDiscreteInterface.

References _m_p_rModel.

bool DecPOMDPDiscrete::SetInitialized ( bool  b)
void DecPOMDPDiscrete::SetReward ( Index  sI,
Index  jaI,
double  r 
)
inlinevirtual
void DecPOMDPDiscrete::SetReward ( Index  sI,
Index  jaI,
Index  sucSI,
double  r 
)
virtual

Set the reward for state, joint action , suc. state indices.

Implements DecPOMDPDiscreteInterface.

References GetReward(), MultiAgentDecisionProcessDiscrete::GetTransitionProbability(), and SetReward().

void DecPOMDPDiscrete::SetReward ( Index  sI,
Index  jaI,
Index  sucSI,
Index  joI,
double  r 
)
virtual
void DecPOMDPDiscrete::SetReward ( State s,
JointAction ja,
double  r 
)
inlinevirtual

implements the DecPOMDPInterface

Implements DecPOMDPInterface.

References SetReward().

void DecPOMDPDiscrete::SetRewardForAgent ( Index  agentI,
State s,
JointAction ja,
double  r 
)
inlinevirtual

Function that sets the reward for an agent, state and joint action.

This should be very generic.

Implements POSGInterface.

References SetReward().

void DecPOMDPDiscrete::SetRewardForAgent ( Index  agentI,
Index  sI,
Index  jaI,
double  r 
)
inline

References SetReward().

void DecPOMDPDiscrete::SetRewardForAgent ( Index  agentI,
Index  sI,
Index  jaI,
Index  sucSI,
double  r 
)
inline

Set the reward for state, joint action , suc. state indices.

References SetReward().

void DecPOMDPDiscrete::SetRewardForAgent ( Index  agentI,
Index  sI,
Index  jaI,
Index  sucSI,
Index  joI,
double  r 
)
inline

Set the reward for state, joint action, suc.state, joint obs indices.

References SetReward().

Member Data Documentation

bool DecPOMDPDiscrete::_m_initialized
private

Boolean that tracks whether this DecPOMDP is initialized.

Referenced by CreateNewRewardModel(), DecPOMDPDiscrete(), SetInitialized(), and SoftPrint().

RewardModel* DecPOMDPDiscrete::_m_p_rModel
protected