MultiAgentDecisionProcess  Release 0.2.1
TOIDecMDPDiscrete Class Reference

TOIDecMDPDiscrete is a class that represents a transition observation indepedent discrete DecMDP. More...

#include <TOIDecMDPDiscrete.h>

+ Inheritance diagram for TOIDecMDPDiscrete:
+ Collaboration diagram for TOIDecMDPDiscrete:

Public Member Functions

void CreateStateObservations ()
 This function creates the 'state observations'.
bool SetInitialized (bool b)
 Sets _m_initialized to b.
 TOIDecMDPDiscrete (std::string name="received unspec. by TOI-DecMDPDiscrete", std::string descr="received unspec. by TOI-DecMDPDiscrete", std::string pf="received unspec. by TOI-DecMDPDiscrete")
 (default) Constructor
virtual ~TOIDecMDPDiscrete ()
 Destructor.
- Public Member Functions inherited from TOIDecPOMDPDiscrete
virtual TOIDecPOMDPDiscreteClone () const
 Returns a pointer to a copy of this class.
void CreateNewRewardModel ()
 Creates a new reward model.
void CreateNewRewardModelForAgent (Index agentI)
 implementation of POSGDiscreteInterface
DecPOMDPDiscreteGetIndividualDecPOMDPD (Index agentI) const
virtual double GetReward (Index sI, Index jaI) const
 return the reward for state, joint action indices
virtual double GetReward (const std::vector< Index > &sIs, const std::vector< Index > &aIs) 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.
virtual std::string SoftPrint () const
 SoftPrints some information on the DecPOMDPDiscrete.
 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!

Private Attributes

bool _m_initialized
 Boolean that tracks whether this TOIDecMDPDiscrete is initialized.

Additional Inherited Members

- Protected Member Functions inherited from TransitionObservationIndependentMADPDiscrete
bool GetSparse () const
- Protected Attributes inherited from TOIDecPOMDPDiscrete
std::vector< DecPOMDPDiscrete * > _m_individualDecPOMDPDs
 A vector storing pointers to the individual DecPOMDPs.
RewardModelTOISparse_m_p_rModel

Detailed Description

TOIDecMDPDiscrete is a class that represents a transition observation indepedent discrete DecMDP.

Definition at line 41 of file TOIDecMDPDiscrete.h.

Constructor & Destructor Documentation

TOIDecMDPDiscrete::TOIDecMDPDiscrete ( std::string  name = "received unspec. by TOI-DecMDPDiscrete",
std::string  descr = "received unspec. by TOI-DecMDPDiscrete",
std::string  pf = "received unspec. by TOI-DecMDPDiscrete" 
)

(default) Constructor

Definition at line 33 of file TOIDecMDPDiscrete.cpp.

References _m_initialized.

TOIDecMDPDiscrete::~TOIDecMDPDiscrete ( )
virtual

Destructor.

Definition at line 41 of file TOIDecMDPDiscrete.cpp.

Member Function Documentation

void TOIDecMDPDiscrete::CreateStateObservations ( )

This function creates the 'state observations'.

I.e., for each agent the same number of observations as local states is created. The observation probabilities are set such that in a particular state the corresponding observation is received with certainty.

Definition at line 60 of file TOIDecMDPDiscrete.cpp.

References MultiAgentDecisionProcessDiscrete::CreateNewObservationModel(), TransitionObservationIndependentMADPDiscrete::GetIndividualMADPD(), TransitionObservationIndependentMADPDiscrete::GetNrActions(), MultiAgentDecisionProcess::GetNrAgents(), TransitionObservationIndependentMADPDiscrete::GetNrStates(), TransitionObservationIndependentMADPDiscrete::SetNrObservations(), and MultiAgentDecisionProcessDiscrete::SetObservationProbability().

Referenced by ParserTOIDecMDPDiscrete::Parse().

bool TOIDecMDPDiscrete::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 45 of file TOIDecMDPDiscrete.cpp.

References _m_initialized, and TOIDecPOMDPDiscrete::SetInitialized().

Member Data Documentation

bool TOIDecMDPDiscrete::_m_initialized
private

Boolean that tracks whether this TOIDecMDPDiscrete is initialized.

Definition at line 46 of file TOIDecMDPDiscrete.h.

Referenced by SetInitialized(), and TOIDecMDPDiscrete().


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