MultiAgentDecisionProcess
|
TransitionObservationIndependentMADPDiscrete is an base class that defines the primary properties of a Transition and Observation independent decision process. More...
#include <TransitionObservationIndependentMADPDiscrete.h>
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 Action * | GetAction (Index agentI, Index a) const |
Get a pointer to action a of agentI. More... | |
MultiAgentDecisionProcessDiscrete * | GetIndividualMADPD (Index agentI) const |
Returns a pointer to agentsI's individual model. More... | |
double | GetInitialStateProbability (Index sI) const |
returns the prob. More... | |
virtual StateDistributionVector * | GetISD () const |
returns the initial state distribution. More... | |
const JointAction * | GetJointAction (Index i) const |
Returns a pointer to joint action i. More... | |
const JointActionDiscrete * | GetJointActionDiscrete (Index i) const |
return a ref to the i-th joint action (a JointActionDiscrete). More... | |
const JointObservation * | GetJointObservation (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 Observation * | GetObservation (Index agentI, Index o) const |
Get a pointer to observation o of agentI. More... | |
ObservationModelDiscrete * | GetObservationModelDiscretePtr () 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 |
OGet * | GetOGet () const |
const State * | GetState (Index i) const |
Returns a pointer to state i. More... | |
const State * | GetState (const std::vector< Index > &sIs) const |
TGet * | GetTGet () const |
TransitionModelDiscrete * | GetTransitionModelDiscretePtr () 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< Index > | JointToIndividualActionIndices (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< Index > | SampleInitialStates () const |
Index | SampleJointObservation (Index jaI, Index sucI) const |
Returns a joint observation, sampled according to the observation probabilities. More... | |
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. More... | |
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. 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 Scope & | GetAllAgentScope () 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< Index > | JointToIndividualObservationIndices (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< Index > | JointToIndividualActionIndicesNoCache (Index jaI) const |
std::vector< Index > | JointToIndividualObservationIndicesNoCache (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... | |
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).
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 & | ) |
|
virtual |
Destructor.
References _m_individualMADPDs, and _m_jointActionVec.
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." | ) |
Adds one agent with an optional name.
References _m_individualMADPDs, _m_sparse, MultiAgentDecisionProcess::AddAgent(), MultiAgentDecisionProcess::GetNrAgents(), MultiAgentDecisionProcess::GetProblemFile(), SetInitialized(), and MultiAgentDecisionProcessDiscrete::SetSparse().
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.
|
private |
|
protected |
References _m_initialized, _m_nrJointActions, _m_nrJointObservations, _m_nrJointStates, _m_p_oModel, _m_p_tModel, GetObservationProbability(), GetTransitionProbability(), TransitionModelDiscreteInterface::Set(), and ObservationModelDiscreteInterface::Set().
Referenced by ArgumentUtils::GetDecPOMDPDiscreteInterfaceFromArgs(), and SetInitialized().
|
protected |
References _m_individualMADPDs, _m_initialized, _m_nrIndivActions, _m_nrJointActions, _m_nrJointObservations, _m_nrJointStates, _m_p_oModel, _m_p_tModel, ObservationModelMappingSparse::GetMatrixPtr(), GetNrActions(), MultiAgentDecisionProcess::GetNrAgents(), GetObservationModelDiscretePtr(), GetObservationProbability(), GetTransitionProbability(), IndividualToJointActionIndices(), IndividualToJointObservationIndices(), IndividualToJointStateIndices(), TransitionModelDiscreteInterface::Set(), ObservationModelDiscreteInterface::Set(), and ObservationModelDiscrete::SoftPrint().
Referenced by CreateCentralizedSparseModels().
|
protected |
References CreateCentralizedObservationTransitionModel(), and CreateCentralizedSparseTransitionModel().
Referenced by ArgumentUtils::GetDecPOMDPDiscreteInterfaceFromArgs(), and SetInitialized().
void TransitionObservationIndependentMADPDiscrete::CreateCentralizedSparseTransitionModel | ( | ) |
References _m_individualMADPDs, _m_initialized, _m_nrIndivActions, _m_nrJointActions, _m_nrJointStates, _m_p_tModel, TransitionModelMappingSparse::GetMatrixPtr(), GetNrActions(), MultiAgentDecisionProcess::GetNrAgents(), GetNrJointActions(), GetTransitionModelDiscretePtr(), GetTransitionProbability(), IndividualToJointActionIndices(), IndividualToJointStateIndices(), TransitionModelDiscreteInterface::Set(), and TransitionModelDiscrete::SoftPrint().
Referenced by CreateCentralizedSparseModels().
|
private |
References _m_indivStateIndices, _m_jointIndicesCached, _m_nrJointStates, GetIndividualMADPD(), GetISD(), MultiAgentDecisionProcess::GetNrAgents(), and SetISD().
Referenced by SetInitialized().
|
private |
Recursively constructs all the joint actions.
Works by calling CreateJointActionsRecursively on a new (empty) joint action.
References _m_jointActionVec, _m_jointIndicesCached, _m_jointModelsGenerated, _m_jointToIndActionCache, _m_nrIndivActions, _m_nrJointActions, CreateJointActionsRecursively(), GetIndividualMADPD(), MultiAgentDecisionProcessDiscrete::GetNrActions(), GetNrActions(), MultiAgentDecisionProcess::GetNrAgents(), and JointToIndividualActionIndicesNoCache().
Referenced by SetInitialized().
|
private |
|
private |
References _m_indivObs, _m_jointIndicesCached, _m_jointObs, _m_jointToIndObsCache, _m_nrIndivObs, _m_nrJointObservations, ConstructJointObservationsRecursively(), GetIndividualMADPD(), MultiAgentDecisionProcess::GetNrAgents(), MultiAgentDecisionProcessDiscrete::GetNrObservations(), GetNrObservations(), and JointToIndividualObservationIndicesNoCache().
Referenced by SetInitialized().
|
private |
This function generates the joint -> individual state index cache.
This function assumes that all the agents and their local states have been added.
References _m_indivStateIndices, _m_jointIndicesCached, _m_jointStates, _m_nrIndivStates, _m_nrJointStates, GetIndividualMADPD(), NamedDescribedEntity::GetName(), MultiAgentDecisionProcess::GetNrAgents(), MultiAgentDecisionProcessDiscrete::GetNrStates(), MultiAgentDecisionProcessDiscrete::GetState(), IndexTools::Increment(), NamedDescribedEntity::SetDescription(), and NamedDescribedEntity::SetName().
Referenced by SetInitialized().
|
inlinevirtual |
Get a pointer to action a of agentI.
Implements MultiAgentDecisionProcessDiscreteInterface.
References GetIndividualMADPD().
|
inline |
Returns a pointer to agentsI's individual model.
Referenced by CreateISD(), CreateJointActions(), CreateJointActionsRecursively(), CreateJointObservations(), CreateJointStates(), TOIDecPOMDPDiscrete::CreateNewRewardModel(), TOIDecMDPDiscrete::CreateStateObservations(), GetAction(), GetInitialStateProbability(), GetJointActionDiscrete(), GetJointObservation(), GetNrActions(), GetNrObservations(), GetObservation(), GetObservationProbability(), TOICompactRewardDecPOMDPDiscrete::GetReward(), GetState(), GetTransitionProbability(), ParserTOIDecPOMDPDiscrete::ParseAgent(), ParserTOICompactRewardDecPOMDPDiscrete::ParseRewards(), ParserTOIDecPOMDPDiscrete::ParseRewards(), SampleInitialStates(), SampleJointObservation(), SampleSuccessorState(), TOICompactRewardDecPOMDPDiscrete::SetInitialized(), SoftPrint(), SoftPrintActionSets(), SoftPrintState(), ParserTOICompactRewardDecPOMDPDiscrete::StoreDecPOMDP(), ParserTOIFactoredRewardDecPOMDPDiscrete::StoreDecPOMDP(), and ParserTOIDecPOMDPDiscrete::StoreDecPOMDP().
|
virtual |
returns the prob.
of state sI according to the initial state distribution.
Implements MultiAgentDecisionProcessDiscreteInterface.
References _m_initialStateDistribution, GetIndividualMADPD(), MultiAgentDecisionProcessDiscrete::GetInitialStateProbability(), MultiAgentDecisionProcess::GetNrAgents(), and JointToIndividualStateIndices().
|
virtual |
returns the initial state distribution.
Implements MultiAgentDecisionProcessDiscreteInterface.
References _m_initialStateDistribution, and _m_jointModelsGenerated.
Referenced by CreateISD().
|
inlinevirtual |
Returns a pointer to joint action i.
Implements MultiAgentDecisionProcessDiscreteInterface.
References GetJointActionDiscrete().
const JointActionDiscrete * TransitionObservationIndependentMADPDiscrete::GetJointActionDiscrete | ( | Index | i | ) | const |
return a ref to the i-th joint action (a JointActionDiscrete).
References _m_jointActionMap, _m_jointActionVec, _m_jointIndicesCached, _m_nrIndivActions, JointActionDiscrete::AddIndividualAction(), GetIndividualMADPD(), MultiAgentDecisionProcess::GetNrAgents(), and IndexTools::JointToIndividualIndices().
Referenced by GetJointAction(), and JointToIndividualActionIndicesNoCache().
|
virtual |
Get a pointer to the i-th joint observation.
Implements MultiAgentDecisionProcessDiscreteInterface.
References _m_jointIndicesCached, _m_jointObs, _m_jointObsMap, _m_nrIndivObs, JointObservationDiscrete::AddIndividualObservation(), GetIndividualMADPD(), MultiAgentDecisionProcess::GetNrAgents(), and IndexTools::JointToIndividualIndices().
|
inlinevirtual |
return the number of actions of agent agentI
Implements MultiAgentDecisionProcessDiscreteInterface.
References GetIndividualMADPD(), and MultiAgentDecisionProcessDiscrete::GetNrActions().
|
inlinevirtual |
returns a vector with the number of actions for each agent.
Implements MultiAgentDecisionProcessDiscreteInterface.
Referenced by CreateCentralizedObservationTransitionModel(), CreateCentralizedSparseTransitionModel(), CreateJointActions(), CreateJointActionsRecursively(), TOIDecMDPDiscrete::CreateStateObservations(), GetNrJointActions(), IndividualToJointActionIndices(), JointToIndividualActionIndices(), and SoftPrintActionSets().
|
inlinevirtual |
return the number of joint actions.
Implements MultiAgentDecisionProcessDiscreteInterface.
Referenced by CreateCentralizedSparseTransitionModel(), and SoftPrint().
|
virtual |
Get the number of joint actions the agents in agScope can form.
Implements MultiAgentDecisionProcessDiscreteInterface.
References GetNrActions(), IndexTools::RestrictIndividualIndicesToScope(), and VectorTools::VectorProduct().
|
inlinevirtual |
Get the number of joint observations.
Implements MultiAgentDecisionProcessDiscreteInterface.
Referenced by SoftPrint().
|
inline |
Referenced by GetNrStates(), and SoftPrint().
|
inlinevirtual |
return the number of observations of agent agentI
Implements MultiAgentDecisionProcessDiscreteInterface.
References GetIndividualMADPD(), and MultiAgentDecisionProcessDiscrete::GetNrObservations().
|
inlinevirtual |
Returns a vector with the number of observations for each agent.
Implements MultiAgentDecisionProcessDiscreteInterface.
Referenced by CreateJointObservations(), and JointToIndividualObservationIndicesNoCache().
|
inline |
Returns the number of local states for agent i.
|
inlinevirtual |
returns the number of (joint) states.
Implements MultiAgentDecisionProcessDiscreteInterface.
References GetNrJointStates().
Referenced by TOIDecMDPDiscrete::CreateStateObservations().
|
inlinevirtual |
Get a pointer to observation o of agentI.
Implements MultiAgentDecisionProcessDiscreteInterface.
References GetIndividualMADPD().
|
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().
|
virtual |
Returns the probability of the joint observation joI (the product of the individual observation probabilities, which depend only on local states).
Implements MultiAgentDecisionProcessDiscreteInterface.
References _m_indivStateIndices, _m_jointModelsGenerated, _m_jointToIndActionCache, _m_jointToIndObsCache, GetIndividualMADPD(), MultiAgentDecisionProcess::GetNrAgents(), MultiAgentDecisionProcessDiscrete::GetObservationProbability(), JointToIndividualActionIndices(), JointToIndividualObservationIndices(), and JointToIndividualStateIndices().
Referenced by CreateCentralizedFullModels(), and CreateCentralizedObservationTransitionModel().
|
inlinevirtual |
Implements MultiAgentDecisionProcessDiscreteInterface.
|
inlineprotected |
Referenced by TOIDecPOMDPDiscrete::CreateNewRewardModel().
Returns a pointer to state i.
Implements MultiAgentDecisionProcessDiscreteInterface.
References JointToIndividualStateIndices().
Referenced by SimulationTOIDecPOMDPDiscrete::RunSimulations(), and SimulationTOIDecPOMDPDiscrete::Step().
|
inlinevirtual |
Implements MultiAgentDecisionProcessDiscreteInterface.
|
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().
|
virtual |
returns probability of joint transition (the product of the probabilities of the individual transitions)
Implements MultiAgentDecisionProcessDiscreteInterface.
References _m_indivStateIndices, _m_jointModelsGenerated, _m_jointToIndActionCache, GetIndividualMADPD(), MultiAgentDecisionProcess::GetNrAgents(), MultiAgentDecisionProcessDiscrete::GetTransitionProbability(), JointToIndividualActionIndices(), and JointToIndividualStateIndices().
Referenced by CreateCentralizedFullModels(), CreateCentralizedObservationTransitionModel(), and CreateCentralizedSparseTransitionModel().
|
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().
|
inlinevirtual |
Returns the joint action index that corresponds to the array of specified individual action indices.
Implements MultiAgentDecisionProcessDiscreteInterface.
References IndexTools::IndividualToJointIndicesArrayStepSize().
|
inlinevirtual |
indiv->joint for a restricted set (Scope) of agents
Implements MultiAgentDecisionProcessDiscreteInterface.
References GetNrActions(), IndexTools::IndividualToJointIndices(), and IndexTools::RestrictIndividualIndicesToScope().
|
inline |
converts individual to joint actions.
References IndexTools::IndividualToJointIndicesArray().
|
inlinevirtual |
returns the joint index for indivObsIndices
Implements MultiAgentDecisionProcessDiscreteInterface.
References IndexTools::IndividualToJointIndicesStepSize().
Referenced by CreateCentralizedObservationTransitionModel(), and SampleJointObservation().
|
inline |
returns the joint index for indivStateIndices
References IndexTools::IndividualToJointIndicesStepSize().
Referenced by CreateCentralizedObservationTransitionModel(), CreateCentralizedSparseTransitionModel(), PlanningUnitTOIDecPOMDPDiscrete::IndividualToJointStateIndices(), SampleInitialState(), and SampleSuccessorState().
|
inline |
References SetInitialized().
|
inlinevirtual |
returns a vector of indices to indiv.
action indicies corr. to joint action index jaI.
Implements MultiAgentDecisionProcessDiscreteInterface.
Referenced by GetObservationProbability(), TOIFactoredRewardDecPOMDPDiscrete::GetReward(), TOICompactRewardDecPOMDPDiscrete::GetReward(), TOIDecPOMDPDiscrete::GetReward(), GetTransitionProbability(), JointToRestrictedJointActionIndex(), SampleJointObservation(), SampleSuccessorState(), and TOIDecPOMDPDiscrete::SetReward().
|
inlinevirtual |
joint->indiv for a restricted set (Scope) of agents
Implements MultiAgentDecisionProcessDiscreteInterface.
References GetNrActions(), IndexTools::JointToIndividualIndices(), and IndexTools::RestrictIndividualIndicesToScope().
|
inlinevirtual |
returns the individual indices for joint observation joI.
Implements MultiAgentDecisionProcessDiscreteInterface.
Referenced by GetObservationProbability().
|
private |
References _m_initialized, DEBUG_TOIMADPD, MultiAgentDecisionProcess::GetNrAgents(), GetNrObservations(), and IndexTools::JointToIndividualIndices().
Referenced by CreateJointObservations().
|
inline |
returns a vector of individual (local) state indices corresponding to joint state index jointSI.
References IndexTools::JointToIndividualIndicesStepSize().
Referenced by GetInitialStateProbability(), GetObservationProbability(), TOIFactoredRewardDecPOMDPDiscrete::GetReward(), TOICompactRewardDecPOMDPDiscrete::GetReward(), TOIDecPOMDPDiscrete::GetReward(), GetState(), GetTransitionProbability(), PlanningUnitTOIDecPOMDPDiscrete::JointToIndividualStateIndices(), SampleJointObservation(), SampleSuccessorState(), TOIDecPOMDPDiscrete::SetReward(), and SoftPrintState().
|
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().
|
inline |
Prints information regarding this TransitionObservationIndependentMADPDiscrete.
References SoftPrint().
|
inline |
Prints the action set for each agent.
References SoftPrintActionSets().
|
inline |
Prints the set of joint actions.
References SoftPrintJointActionSet().
|
inlinevirtual |
Samples an initial state.
Implements MultiAgentDecisionProcessDiscreteInterface.
References IndividualToJointStateIndices(), and SampleInitialStates().
|
inline |
|
inlinevirtual |
Returns a joint observation, sampled according to the observation probabilities.
Implements MultiAgentDecisionProcessDiscreteInterface.
References IndividualToJointObservationIndices(), JointToIndividualActionIndices(), and JointToIndividualStateIndices().
Referenced by PlanningUnitTOIDecPOMDPDiscrete::SampleJointObservation(), and SimulationTOIDecPOMDPDiscrete::Step().
|
inlinevirtual |
returns a successor state index sampled according to the transition probabilities.
Implements MultiAgentDecisionProcessDiscreteInterface.
References IndividualToJointStateIndices(), JointToIndividualActionIndices(), and JointToIndividualStateIndices().
Referenced by PlanningUnitTOIDecPOMDPDiscrete::SampleSuccessorState().
|
protectedvirtual |
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 in TOIDecPOMDPDiscrete, TOICompactRewardDecPOMDPDiscrete, TOIFactoredRewardDecPOMDPDiscrete, and TOIDecMDPDiscrete.
References _m_actionStepSize, _m_actionStepSizeArray, _m_individualMADPDs, _m_initialized, _m_jointIndicesCached, _m_jointModelsGenerated, _m_nr_agents, _m_nrIndivActions, _m_nrIndivObs, _m_nrIndivStates, _m_observationStepSize, _m_sparse, _m_stateStepSize, IndexTools::CalculateStepSize(), IndexTools::CalculateStepSizeVector(), CreateCentralizedFullModels(), CreateCentralizedSparseModels(), CreateISD(), CreateJointActions(), CreateJointObservations(), CreateJointStates(), DEBUG_TOIMADPD, and MultiAgentDecisionProcess::GetNrAgents().
Referenced by AddAgent(), Initialize(), TOIDecPOMDPDiscrete::SetInitialized(), and SetNrAgents().
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 | ) |
Sets the number of agents to n.
References _m_individualMADPDs, _m_sparse, MultiAgentDecisionProcess::GetProblemFile(), SetInitialized(), MultiAgentDecisionProcess::SetNrAgents(), and MultiAgentDecisionProcessDiscrete::SetSparse().
Referenced by ParserTOIDecPOMDPDiscrete::ParseBase().
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 | ) |
References _m_individualMADPDs, and _m_sparse.
Referenced by ArgumentUtils::GetDecPOMDPDiscreteInterfaceFromArgs().
|
virtual |
SoftPrints information regarding this TransitionObservationIndependentMADPDiscrete.
Implements MultiAgentDecisionProcessDiscreteInterface.
References _m_initialized, GetIndividualMADPD(), MultiAgentDecisionProcess::GetNrAgents(), GetNrJointActions(), GetNrJointObservations(), GetNrJointStates(), MultiAgentDecisionProcess::SoftPrint(), MultiAgentDecisionProcessDiscrete::SoftPrint(), SoftPrintActionSets(), and SoftPrintJointActionSet().
Referenced by Print(), and TOIDecPOMDPDiscrete::SoftPrint().
string TransitionObservationIndependentMADPDiscrete::SoftPrintActionSets | ( | ) | const |
SoftPrints the action set for each agent.
References _m_initialized, MultiAgentDecisionProcess::_m_nrAgents, GetIndividualMADPD(), GetNrActions(), and NamedDescribedEntity::SoftPrint().
Referenced by PrintActionSets(), and SoftPrint().
string TransitionObservationIndependentMADPDiscrete::SoftPrintJointActionSet | ( | ) | const |
SoftPrints the set of joint actions.
References _m_initialized, and _m_jointActionVec.
Referenced by PrintJointActionSet(), and SoftPrint().
|
virtual |
|
private |
Referenced by SetInitialized().
|
private |
Referenced by SetInitialized().
|
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().
|
private |
Referenced by ConstructJointObservationsRecursively(), and CreateJointObservations().
|
private |
The vector storing the individual state indices for each joint index: _m_indivStateIndices[jointStateIndex] = vector<Index>
Referenced by CreateISD(), CreateJointStates(), GetObservationProbability(), and GetTransitionProbability().
|
private |
Referenced by TransitionObservationIndependentMADPDiscrete().
|
private |
Boolean to indicate whether this MADPDiscrete has been initialized.
Referenced by CreateCentralizedFullModels(), CreateCentralizedObservationTransitionModel(), CreateCentralizedSparseTransitionModel(), JointToIndividualActionIndicesNoCache(), JointToIndividualObservationIndicesNoCache(), SetInitialized(), SoftPrint(), SoftPrintActionSets(), SoftPrintJointActionSet(), and TransitionObservationIndependentMADPDiscrete().
|
private |
The vector containing the initial state distr over joint states.
Referenced by GetInitialStateProbability(), GetISD(), SetISD(), and TransitionObservationIndependentMADPDiscrete().
|
private |
Referenced by GetJointActionDiscrete(), and TransitionObservationIndependentMADPDiscrete().
|
private |
The vector storing the joint actions.
Referenced by CreateJointActions(), CreateJointActionsRecursively(), GetJointActionDiscrete(), SoftPrintJointActionSet(), and ~TransitionObservationIndependentMADPDiscrete().
|
private |
Boolean indicating whether joint indices have been cached.
Referenced by CreateISD(), CreateJointActions(), CreateJointObservations(), CreateJointStates(), GetJointActionDiscrete(), GetJointObservation(), SetInitialized(), and TransitionObservationIndependentMADPDiscrete().
|
private |
Boolean indicating whether joint models have been generated.
Referenced by CreateJointActions(), GetISD(), GetObservationProbability(), GetTransitionProbability(), SetInitialized(), and TransitionObservationIndependentMADPDiscrete().
|
private |
Referenced by ConstructJointObservationsRecursively(), CreateJointObservations(), and GetJointObservation().
|
private |
Referenced by GetJointObservation(), and TransitionObservationIndependentMADPDiscrete().
|
private |
Referenced by CreateJointStates().
|
private |
Referenced by GetState(), and TransitionObservationIndependentMADPDiscrete().
|
private |
Referenced by CreateJointActions(), GetObservationProbability(), and GetTransitionProbability().
|
private |
Referenced by CreateJointObservations(), and GetObservationProbability().
|
private |
Referenced by SetInitialized().
|
private |
|
private |
Referenced by CreateJointObservations(), GetJointObservation(), and SetInitialized().
|
private |
Vector that stores the number of individual states.
(Created by CreateJointStates() )
Referenced by CreateJointStates(), and SetInitialized().
|
private |
the number of joint actions.
Referenced by CreateCentralizedFullModels(), CreateCentralizedObservationTransitionModel(), CreateCentralizedSparseTransitionModel(), CreateJointActions(), and TransitionObservationIndependentMADPDiscrete().
|
private |
|
private |
|
private |
Referenced by SetInitialized().
|
private |
|
private |
|
private |
Boolean that indicates whether models should be stored sparsely.
Referenced by AddAgent(), SetInitialized(), SetNrAgents(), SetSparse(), and TransitionObservationIndependentMADPDiscrete().
|
private |
Referenced by SetInitialized().