MultiAgentDecisionProcess  Release 0.2.1
TOIFactoredRewardDecPOMDPDiscrete Class Reference

TOIFactoredRewardDecPOMDPDiscrete is a class that represents a transition observation independent Dec-POMDP, in which the reward is the sum of each agent's individual reward plus some shared reward. More...

#include <TOIFactoredRewardDecPOMDPDiscrete.h>

+ Inheritance diagram for TOIFactoredRewardDecPOMDPDiscrete:
+ Collaboration diagram for TOIFactoredRewardDecPOMDPDiscrete:

Public Member Functions

virtual
TOIFactoredRewardDecPOMDPDiscrete
Clone () const
 Returns a pointer to a copy of this class.
double GetIndividualReward (Index indSI, Index indAI, Index agentID) const
double GetReward (Index sI, Index jaI) const
 return the reward for state, joint action indices
double GetReward (const std::vector< Index > &sIs, const std::vector< Index > &aIs) const
TOIFactoredRewardDecPOMDPDiscreteoperator= (const TOIFactoredRewardDecPOMDPDiscrete &o)
void SetIndividualRewardModel (RewardModel *rewardModel, Index agentID)
virtual bool SetInitialized (bool b)
 Sets _m_initialized to b.
std::string SoftPrint () const
 SoftPrints some information on the DecPOMDPDiscrete.
 TOIFactoredRewardDecPOMDPDiscrete (std::string name="received unspec. by TOIFactoredRewardDecPOMDPDiscrete", std::string descr="received unspec. by TOIFactoredRewardDecPOMDPDiscrete", std::string pf="received unspec. by TOIFactoredRewardDecPOMDPDiscrete")
 (default) Constructor
 TOIFactoredRewardDecPOMDPDiscrete (const TOIFactoredRewardDecPOMDPDiscrete &o)
virtual ~TOIFactoredRewardDecPOMDPDiscrete ()
- Public Member Functions inherited from TOIDecPOMDPDiscrete
void CreateNewRewardModel ()
 Creates a new reward model.
void CreateNewRewardModelForAgent (Index agentI)
 implementation of POSGDiscreteInterface
DecPOMDPDiscreteGetIndividualDecPOMDPD (Index agentI) const
double GetReward (State *s, JointAction *ja) const
 implements the DecPOMDPInterface
double GetRewardForAgent (Index agentI, State *s, JointAction *ja) const
 Function that returns the reward for a state and joint action.
double GetRewardForAgent (Index agentI, Index sI, Index jaI) const
 Return the reward for state, joint action indices.
std::vector< double > GetRewards (Index sI, Index jaI) const
RGetGetRGet () const
TOIDecPOMDPDiscreteoperator= (const TOIDecPOMDPDiscrete &o)
 Copy assignment operator.
void Print () const
 Prints some information on the DecPOMDPDiscrete.
void SetIndividualDecPOMDPD (DecPOMDPDiscrete *model, Index agentI)
void SetReward (Index sI, Index jaI, double r)
 Set the reward for state, joint action indices.
void SetReward (const std::vector< Index > &sIs, const std::vector< Index > &aIs, double r)
void SetReward (Index sI, Index jaI, Index sucSI, double r)
 set the reward for state, joint action , suc.
void SetReward (Index sI, Index jaI, Index sucSI, Index joI, double r)
 set the reward for state, joint action, suc.state, joint observation indices
void SetReward (State *s, JointAction *ja, double r)
 implements the DecPOMDPInterface
void SetRewardForAgent (Index agentI, State *s, JointAction *ja, double r)
 Function that sets the reward for an agent, state and joint action.
void SetRewardForAgent (Index agentI, Index sI, Index jaI, double r)
 Set the reward for state, joint action indices.
void SetRewardForAgent (Index agentI, Index sI, Index jaI, Index sucSI, double r)
 Set the reward for state, joint action , suc. state indices.
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.
 TOIDecPOMDPDiscrete (std::string name="received unspec. by TOIDecPOMDPDiscrete", std::string descr="received unspec. by TOIDecPOMDPDiscrete", std::string pf="received unspec. by TOIDecPOMDPDiscrete")
 (default) Constructor
 TOIDecPOMDPDiscrete (const TOIDecPOMDPDiscrete &a)
 Copy constructor.
virtual ~TOIDecPOMDPDiscrete ()
 Destructor.
- Public Member Functions inherited from TransitionObservationIndependentMADPDiscrete
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 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 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 ()
 Destructor. Can't make a virt.destr. pure abstract!
- Public Member Functions inherited from DecPOMDP
 DecPOMDP ()
 Default constructor. sets RewardType to REWARD and discount to 1.0.
double GetDiscount () const
 Returns the discount parameter.
double GetDiscountForAgent (Index agentI) const
 Returns the discount parameter.
reward_t GetRewardType () const
 Returns the reward type.
reward_t GetRewardTypeForAgent (Index agentI) const
 Returns the reward type.
void SetDiscount (double d)
 Sets the discount parameter to d.
void SetDiscountForAgent (Index agentI, double d)
 Functions needed for POSGInterface:
void SetRewardType (reward_t r)
 Sets the reward type to reward_t r.
void SetRewardTypeForAgent (Index agentI, reward_t r)
 Sets the reward type to reward_t r.
- Public Member Functions inherited from DecPOMDPInterface
virtual ~DecPOMDPInterface ()
 Virtual destructor.
- Public Member Functions inherited from POSGInterface
virtual ~POSGInterface ()
 Virtual destructor.
- Public Member Functions inherited from DecPOMDPDiscreteInterface
virtual ~DecPOMDPDiscreteInterface ()
 import the GetReward function from the base class in current scope.
- Public Member Functions inherited from POSGDiscreteInterface
virtual ~POSGDiscreteInterface ()
 Destructor.Can't make a virt.destr. pure abstract!

Protected Attributes

std::vector< RewardModel * > _m_p_rModels
- Protected Attributes inherited from TOIDecPOMDPDiscrete
std::vector< DecPOMDPDiscrete * > _m_individualDecPOMDPDs
 A vector storing pointers to the individual DecPOMDPs.
RewardModelTOISparse_m_p_rModel

Private Attributes

bool _m_initialized
 Boolean that tracks whether this DecPOMDP is initialized.

Additional Inherited Members

- Protected Member Functions inherited from TransitionObservationIndependentMADPDiscrete
bool GetSparse () const

Detailed Description

TOIFactoredRewardDecPOMDPDiscrete is a class that represents a transition observation independent Dec-POMDP, in which the reward is the sum of each agent's individual reward plus some shared reward.

Definition at line 43 of file TOIFactoredRewardDecPOMDPDiscrete.h.

Constructor & Destructor Documentation

TOIFactoredRewardDecPOMDPDiscrete::TOIFactoredRewardDecPOMDPDiscrete ( std::string  name = "received unspec. by TOIFactoredRewardDecPOMDPDiscrete",
std::string  descr = "received unspec. by TOIFactoredRewardDecPOMDPDiscrete",
std::string  pf = "received unspec. by TOIFactoredRewardDecPOMDPDiscrete" 
)

(default) Constructor

Definition at line 35 of file TOIFactoredRewardDecPOMDPDiscrete.cpp.

References _m_initialized.

Referenced by Clone().

TOIFactoredRewardDecPOMDPDiscrete::TOIFactoredRewardDecPOMDPDiscrete ( const TOIFactoredRewardDecPOMDPDiscrete o)

Definition at line 43 of file TOIFactoredRewardDecPOMDPDiscrete.cpp.

TOIFactoredRewardDecPOMDPDiscrete::~TOIFactoredRewardDecPOMDPDiscrete ( )
virtual

Definition at line 48 of file TOIFactoredRewardDecPOMDPDiscrete.cpp.

References _m_p_rModels.

Member Function Documentation

virtual TOIFactoredRewardDecPOMDPDiscrete* TOIFactoredRewardDecPOMDPDiscrete::Clone ( ) const
inlinevirtual

Returns a pointer to a copy of this class.

Reimplemented from TOIDecPOMDPDiscrete.

Definition at line 85 of file TOIFactoredRewardDecPOMDPDiscrete.h.

References TOIFactoredRewardDecPOMDPDiscrete().

double TOIFactoredRewardDecPOMDPDiscrete::GetIndividualReward ( Index  indSI,
Index  indAI,
Index  agentID 
) const

Definition at line 142 of file TOIFactoredRewardDecPOMDPDiscrete.cpp.

References _m_p_rModels.

Referenced by GetReward().

double TOIFactoredRewardDecPOMDPDiscrete::GetReward ( Index  sI,
Index  jaI 
) const
virtual
double TOIFactoredRewardDecPOMDPDiscrete::GetReward ( const std::vector< Index > &  sIs,
const std::vector< Index > &  aIs 
) const
virtual
TOIFactoredRewardDecPOMDPDiscrete & TOIFactoredRewardDecPOMDPDiscrete::operator= ( const TOIFactoredRewardDecPOMDPDiscrete o)

Definition at line 57 of file TOIFactoredRewardDecPOMDPDiscrete.cpp.

void TOIFactoredRewardDecPOMDPDiscrete::SetIndividualRewardModel ( RewardModel rewardModel,
Index  agentID 
)
bool TOIFactoredRewardDecPOMDPDiscrete::SetInitialized ( bool  b)
virtual

Sets _m_initialized to b.

When setting to true, a verification of member elements is performed. (i.e. a check whether all vectors have the correct size and non-zero entries)

Reimplemented from TOIDecPOMDPDiscrete.

Definition at line 67 of file TOIFactoredRewardDecPOMDPDiscrete.cpp.

References _m_initialized, _m_p_rModels, MultiAgentDecisionProcess::GetNrAgents(), and TOIDecPOMDPDiscrete::SetInitialized().

string TOIFactoredRewardDecPOMDPDiscrete::SoftPrint ( ) const
virtual

SoftPrints some information on the DecPOMDPDiscrete.

Reimplemented from TOIDecPOMDPDiscrete.

Definition at line 152 of file TOIFactoredRewardDecPOMDPDiscrete.cpp.

References _m_initialized, _m_p_rModels, and MultiAgentDecisionProcess::GetNrAgents().

Member Data Documentation

bool TOIFactoredRewardDecPOMDPDiscrete::_m_initialized
private

Boolean that tracks whether this DecPOMDP is initialized.

Definition at line 48 of file TOIFactoredRewardDecPOMDPDiscrete.h.

Referenced by SetInitialized(), SoftPrint(), and TOIFactoredRewardDecPOMDPDiscrete().

std::vector<RewardModel*> TOIFactoredRewardDecPOMDPDiscrete::_m_p_rModels
protected

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