MultiAgentDecisionProcess
Release 0.2.1
|
PlanningUnitMADPDiscrete represents a Planning unit for a discrete MADP (discrete actions, observations and states). More...
#include <PlanningUnitMADPDiscrete.h>
Public Member Functions | |
virtual bool | AreCachedJointToIndivIndices (PolicyGlobals::IndexDomainCategory pdc) const |
Check whether certain index conversions are cached. | |
void | ComputeHistoryArrays (Index hI, Index t, Index t_offset, Index Indices[], size_t indexDomainSize) const |
This function computes the indices of the sequence corr. | |
Index | ComputeHistoryIndex (Index t, Index t_offset, const Index indices[], size_t indexDomainSize) const |
This function computes the index of a history. | |
const Action * | GetAction (Index agentI, Index a) const |
Returns a ref to the a-th action of agent agentI. | |
void | GetActionHistoryArrays (Index agentI, Index ahI, Index t, Index aIs[]) const |
Computes the joint actions for jahI. | |
ActionHistoryTree * | GetActionHistoryTree (Index agentI, Index ohI) const |
Returns a pointer to action history# ohI of agent# agentI. | |
void | GetActionObservationHistoryArrays (Index agentI, Index aohI, Index t, Index aIs[], Index oIs[]) const |
Computes the joint actions and observations for aohI. | |
Index | GetActionObservationHistoryIndex (Index agentI, Index t, const std::vector< Index > &actions, const std::vector< Index > &observations) const |
converts the vectors of actions and observations of length t to a (individual) ObservationHistory Index for agentI. | |
ActionObservationHistoryTree * | GetActionObservationHistoryTree (Index agentI, Index aohI) const |
Returns a pointer to observation history# ohI of agent# agentI. | |
virtual PolicyGlobals::IndexDomainCategory | GetDefaultIndexDomCat () const |
Return the default IndexDomainCategory for the problem. | |
Index | GetFirstJointActionObservationHistoryIndex (Index ts) const |
Returns the index of the first joint action observation history of time step ts. | |
Index | GetFirstJointObservationHistoryIndex (Index ts) const |
Returns the index of the first joint observation history of time step ts. | |
Index | GetFirstObservationHistoryIndex (Index agI, Index ts) const |
Returns the index of the first ts observation history of agent agI. | |
double | GetInitialStateProbability (Index sI) const |
Returns the probability of a state in the initial state distribution. | |
double | GetJAOHProb (Index jaohI, Index p_jaohI=0, const JointBeliefInterface *p_jb=NULL, const JointPolicyDiscrete *jpol=NULL) const |
returns the probability of jaohI. | |
double | GetJAOHProbGivenPred (Index jaohI) const |
Gives the conditional probability of the realization of the joint action-observation history jaohI (and thus of the joint belief corresponding to JointActionObservationHistory jaohI). | |
double | GetJAOHProbs (JointBeliefInterface *jb, Index jaohI, Index p_jaohI=0, const JointBeliefInterface *p_jb=NULL, const JointPolicyDiscrete *jpol=NULL) const |
returns the probability of jaohI AND the corresponding joint belief given the predecessor p_jaohI (and its corresponding belief) | |
double | GetJAOHProbsRecursively (JointBeliefInterface *jb, const Index jaIs[], const Index joIs[], Index t_p, Index t, Index p_jaohI=0, const JointPolicyDiscrete *jpol=NULL) const |
the function that perfoms most of the work, called by GetJAOHProbs. | |
const JointAction * | GetJointAction (Index jaI) const |
Returns a ref to the i-th joint action. | |
Index | GetJointActionHistoryIndex (Index t, const std::vector< Index > &jointActions) const |
converts the vector joint observations of length t to a JointObservationHistory Index. | |
Index | GetJointActionHistoryIndex (Index t, const Index jointActions[]) const |
converts the vector joint observations of length t to a JointObservationHistory Index. | |
Index | GetJointActionHistoryIndex (JointActionHistoryTree *joh) const |
Returns the index of a JointActionHistoryTree pointer. | |
JointActionHistoryTree * | GetJointActionHistoryTree (Index jahI) const |
Returns a pointer to joint action history#. | |
void | GetJointActionObservationHistoryArrays (Index jaohI, Index t, Index jaIs[], Index joIs[]) const |
Computes the joint actions and observations for jaohI. | |
Index | GetJointActionObservationHistoryIndex (JointActionObservationHistoryTree *jaoh) const |
Returns the index of a JointObservationHistoryTree pointer. | |
Index | GetJointActionObservationHistoryIndex (Index t, const std::vector< Index > &Jactions, const std::vector< Index > &Jobservations) const |
converts the vectors of actions and observations of length t to a joint ActionObservationHistory Index. | |
JointActionObservationHistoryTree * | GetJointActionObservationHistoryTree (Index jaohI) const |
Returns a pointer to JointActionObservation history#. | |
void | GetJointActionObservationHistoryVectors (Index jaohI, std::vector< Index > &jaIs, std::vector< Index > &joIs) const |
returns the vectors with joint actions and observations for JointActionObservationHistory jaohi. | |
JointBeliefInterface * | GetJointBeliefInterface (Index jaohI) const |
brief Returns a pointer to a new joint belief. | |
const JointObservation * | GetJointObservation (Index joI) const |
Returns a ref to the joI-th joint observation. | |
void | GetJointObservationHistoryArrays (Index johI, Index t, Index joIs[]) const |
Computes the joint observations for johI. | |
Index | GetJointObservationHistoryIndex (JointObservationHistoryTree *joh) const |
Returns the index of a JointObservationHistoryTree pointer. | |
Index | GetJointObservationHistoryIndex (Index t, const std::vector< Index > &jointObservations) const |
converts the vector joint observations of length t to a JointObservationHistory Index. | |
Index | GetJointObservationHistoryIndex (Index t, const Index jointObservations[]) const |
converts the vector joint observations of length t to a JointObservationHistory Index. | |
JointObservationHistoryTree * | GetJointObservationHistoryTree (Index johI) const |
Returns a pointer to joint observation history#. | |
MultiAgentDecisionProcessDiscreteInterface * | GetMADPDI () |
const MultiAgentDecisionProcessDiscreteInterface * | GetMADPDI () const |
JointBeliefInterface * | GetNewJointBeliefFromISD () const |
Returns a new joint belief with the value of the initial state distribution. | |
virtual JointBeliefInterface * | GetNewJointBeliefInterface () const |
a function that forces derives classes to specify which types of joint beliefs are used. | |
virtual JointBeliefInterface * | GetNewJointBeliefInterface (size_t size) const |
size_t | GetNrActionHistories (Index agentI) const |
Returns the number of action histories for agentI. | |
size_t | GetNrActionObservationHistories (Index agentI) const |
Returns the number of action observation histories for agentI. | |
const std::vector< size_t > & | GetNrActions () const |
Returns the number of actions vector. | |
size_t | GetNrActions (Index agentI) const |
Returns the number of actions of agent agentI. | |
size_t | GetNrAgents () const |
Gets the number of agents. | |
size_t | GetNrJointActionHistories () const |
Returns the number of joint action histories. | |
size_t | GetNrJointActionObservationHistories () const |
Returns the number of jointActionObservation histories. | |
size_t | GetNrJointActions () const |
return the number of joint actions. | |
size_t | GetNrJointObservationHistories () const |
Returns the number of joint observation histories. | |
size_t | GetNrJointObservationHistories (Index ts) const |
Returns the number of joint observation histories for time step ts. | |
size_t | GetNrJointObservations () const |
Returns the number of joint observations. | |
LIndex | GetNrJointPolicies () const |
Returns the number of joint policies. | |
size_t | GetNrObservationHistories (Index agentI) const |
Returns the number of observation histories for agentI. | |
size_t | GetNrObservationHistories (Index agentI, Index ts) const |
Returns the number of observation histories for agentI for time step ts. | |
const std::vector< size_t > | GetNrObservationHistoriesVector () const |
Returns a vector with the number of OHs for each agent. | |
const std::vector< size_t > | GetNrObservationHistoriesVector (Index ts) const |
Returns a vector with the number of OHs in stage ts for each agent. | |
const std::vector< size_t > & | GetNrObservations () const |
Returns the number of observations vector. | |
size_t | GetNrObservations (Index agentI) const |
Returns the number of observations of agent agentI. | |
LIndex | GetNrPolicies (Index agentI) const |
Returns the number of policies for agentI. | |
size_t | GetNrPolicyDomainElements (Index agentI, PolicyGlobals::IndexDomainCategory cat, size_t depth=MAXHORIZON) const |
Get the number of elements in the domain of an agent's policy. | |
size_t | GetNrStates () const |
Returns the number of states. | |
const Observation * | GetObservation (Index agentI, Index o) const |
Returns a ref to the o-th observation of agent agentI. | |
void | GetObservationHistoryArrays (Index agentI, Index ohI, Index t, Index oIs[]) const |
Computes the observations for ohI. | |
Index | GetObservationHistoryIndex (Index agentI, Index t, const std::vector< Index > &observations) const |
converts the vector observations of length t to a (individual) ObservationHistory Index for agentI. | |
ObservationHistoryTree * | GetObservationHistoryTree (Index agentI, Index ohI) const |
Returns a pointer to observation history# ohI of agent# agentI. | |
const ObservationModelDiscrete * | GetObservationModelDiscretePtr () const |
double | GetObservationProbability (Index jaI, Index sucSI, Index joI) const |
Returns P(joI | jaI, sucSI ). Arguments are time-ordered. | |
const PlanningUnitMADPDiscreteParameters & | GetParams () const |
Get the parameters for this planning unit. | |
const MultiAgentDecisionProcessDiscreteInterface * | GetProblem () const |
Returns a reference to the problem of the PlanningUnitMADPDiscrete. | |
MultiAgentDecisionProcessDiscreteInterface * | GetProblem () |
const State * | GetState (Index i) const |
Get a pointer to a State by index. | |
Index | GetSuccessorAHI (Index agentI, Index ohI, Index oI) const |
Index | GetSuccessorAOHI (Index agI, Index aohI, Index aI, Index oI) const |
Returns the index of the successor of joint action-observation history jaohI via joint action jaI and joint observation joI. | |
Index | GetSuccessorJAHI (Index johI, Index joI) const |
Index | GetSuccessorJAOHI (Index jaohI, Index jaI, Index joI) const |
Returns the index of the successor of agent agI's action-observation history aohI via action aI and observation oI. | |
Index | GetSuccessorJOHI (Index johI, Index joI) const |
Returns the index of the successor of observation history johI via joint observation joI. | |
Index | GetSuccessorOHI (Index agentI, Index ohI, Index oI) const |
Returns the index of the successor of observation history ohI of agentI via observation joI. | |
Index | GetTimeStepForAHI (Index agentI, Index ohI) const |
Returns the time step of observation history ohI. | |
Index | GetTimeStepForAOHI (Index agentI, Index aohI) const |
Returns the time step of joint action-observation historyaohI. | |
Index | GetTimeStepForJAHI (Index johI) const |
Returns the time step of joint observation history johI. | |
Index | GetTimeStepForJAOHI (Index jaohI) const |
Returns the time step of joint action-observation historyjaohI. | |
Index | GetTimeStepForJOHI (Index johI) const |
Returns the time step of joint observation history johI. | |
Index | GetTimeStepForOHI (Index agentI, Index ohI) const |
Returns the time step of observation history ohI. | |
const TransitionModelDiscrete * | GetTransitionModelDiscretePtr () const |
double | GetTransitionProbability (Index sI, Index jaI, Index sucSI) const |
Returns the trans. prob for state, joint action, suc state indices. | |
Index | IndividualToJointActionHistoryIndex (Index t, const std::vector< Index > &indivIs) const |
converts individual history indices to a joint index | |
Index | IndividualToJointActionIndices (const Index *indivActionIndices) const |
Returns the joint action index that corresponds to the array of specified individual action indices. | |
Index | IndividualToJointActionIndices (const std::vector< Index > &indivActionIndices) const |
Returns the joint action index that corresponds to the vector of specified individual action indices. | |
Index | IndividualToJointActionObservationHistoryIndex (Index t, const std::vector< Index > &indivIs) const |
converts individual history indices to a joint index | |
Index | IndividualToJointObservationHistoryIndex (Index t, const std::vector< Index > &indivIs) const |
converts individual history indices to a joint index | |
Index | IndividualToJointObservationIndices (std::vector< Index > &inObs) const |
Returns the joint observation index that corresponds to the vector of specified individual observation indices. | |
void | JointAOHIndexToIndividualActionObservationVectors (Index jaohI, std::vector< std::vector< Index > > &indivO_vec, std::vector< std::vector< Index > > &indivA_vec) const |
computes the vectors of actions and obs. | |
void | JointAOHIndexToIndividualActionObservationVectors (Index jaohI, std::vector< std::vector< Index > > &indivAO_vec) const |
computes the vector of action-observations corresponding to jaohI indivAO_vec[agentI][t] = aoI | |
std::vector< Index > | JointToIndividualActionHistoryIndices (Index JAHistI) const |
Returns a vector containing the indices of the individual ObservationHistory s corresponding to the JointActionHistory index JAHistI. | |
const std::vector< Index > & | JointToIndividualActionHistoryIndicesRef (Index JAHistI) const |
Returns a reference to a cached vector containing the indices of the indiv. | |
std::vector< Index > | JointToIndividualActionIndices (Index jaI) const |
Returns a vector containing the indices of the indiv. | |
std::vector< Index > | JointToIndividualActionObservationHistoryIndices (Index jaohI) const |
Returns a vector containing the indices of the indiv. | |
const std::vector< Index > & | JointToIndividualActionObservationHistoryIndicesRef (Index jaohI) const |
Returns a vector containing the indices of the indiv. | |
std::vector< Index > | JointToIndividualObservationHistoryIndices (Index johI) const |
Returns a vector containing the indices of the indiv. | |
const std::vector< Index > & | JointToIndividualObservationHistoryIndicesRef (Index johI) const |
Returns a vector containing the indices of the indiv. | |
std::vector< Index > | JointToIndividualObservationIndices (Index joI) const |
Returns a vector containing the indices of the indiv. | |
std::vector< Index > | JointToIndividualPolicyDomainIndices (Index jdI, PolicyGlobals::IndexDomainCategory cat) const |
Converts joint indices to individual policy domain element indices. | |
const std::vector< Index > & | JointToIndividualPolicyDomainIndicesRef (Index jdI, PolicyGlobals::IndexDomainCategory cat) const |
Converts individual policy domain element indices to joint indices. | |
PlanningUnitMADPDiscrete (const PlanningUnitMADPDiscreteParameters ¶ms, size_t horizon=3, MultiAgentDecisionProcessDiscreteInterface *p=0) | |
Constructor with specified parameters. | |
PlanningUnitMADPDiscrete (size_t horizon=3, MultiAgentDecisionProcessDiscreteInterface *p=0) | |
Constructor with default parameters. | |
void | Print () |
Prints info regarding the planning unit. | |
void | PrintActionHistories () |
Prints the action histories for all agents. | |
void | PrintActionObservationHistories () |
Prints the actionObservation histories for all agents. | |
void | PrintObservationHistories () |
Prints the observation histories for all agents. | |
void | RegisterJointActionObservationHistoryTree (JointActionObservationHistoryTree *jaoht) |
Register a new jaoht in the vector of indices. | |
void | SetHorizon (size_t h) |
Sets the horizon for the planning problem. | |
void | SetParams (const PlanningUnitMADPDiscreteParameters ¶ms) |
Sets the parameters for this planning unit. | |
void | SetProblem (MultiAgentDecisionProcessDiscreteInterface *madp) |
Sets the problem for which to plan, using a pointer. | |
std::string | SoftPrintAction (Index agentI, Index actionI) const |
soft prints action actionI of agent agentI. | |
std::string | SoftPrintObservationHistory (Index agentI, Index ohIndex) const |
soft prints ObservationHistory ohIndex of agent agentI. | |
std::string | SoftPrintPolicyDomainElement (Index agentI, Index dI, PolicyGlobals::IndexDomainCategory cat) const |
Virtual function that has to be implemented by derived class. | |
~PlanningUnitMADPDiscrete () | |
Destructor. | |
![]() | |
size_t | GetHorizon () const |
Returns the planning horizon. | |
virtual JointPolicy * | GetJointPolicy ()=0 |
Returns a pointer to the computed joint policy. | |
Index | GetNextAgentIndex () |
Maintains a agent index and returns the next one on calling */. | |
int | GetSeed () const |
Returns the random seed stored. | |
void | InitSeed () const |
Initializes the random number generator (srand) to the stored seed. | |
virtual void | Plan ()=0 |
The function that performs the actual planning. | |
PlanningUnit (size_t horizon, MultiAgentDecisionProcessInterface *p) | |
(default) Constructor | |
void | SetProblem (MultiAgentDecisionProcessInterface *p) |
Updates the problem pointer. | |
void | SetSeed (int s) |
Stores the random seed and calls InitSeed(). | |
virtual | ~PlanningUnit () |
Destructor. | |
![]() | |
LIndex | GetNrJointPolicies (PolicyGlobals::IndexDomainCategory cat, size_t depth=MAXHORIZON) const |
Get the number of joint policies, given the policy's domain. | |
LIndex | GetNrPolicies (Index ag, PolicyGlobals::IndexDomainCategory cat, size_t depth=MAXHORIZON) const |
Get the number of policies for an agent, given the policy's domain. | |
virtual | ~Interface_ProblemToPolicyDiscretePure () |
Destructor. | |
![]() | |
Interface_ProblemToPolicyDiscrete () | |
(default) Constructor | |
virtual | ~Interface_ProblemToPolicyDiscrete () |
Destructor. | |
![]() | |
MultiAgentDecisionProcessDiscreteInterface * | GetReferred () const |
Return the referred thing... | |
Referrer (MultiAgentDecisionProcessDiscreteInterface *t_p=0) | |
(default) Constructor | |
Referrer (MultiAgentDecisionProcessDiscreteInterface &t) | |
Alternative constructor. | |
Referrer (const Referrer &a) | |
Copy constructor. | |
void | SetReferred (MultiAgentDecisionProcessDiscreteInterface *t_p) |
Change the referred thing... | |
virtual | ~Referrer () |
Destructor. |
Protected Member Functions | |
virtual bool | SanityCheck () const |
Do some sanity checks, can be overridden. |
Protected Attributes | |
std::vector< ActionHistoryTree * > | _m_actionHistoryTreeRootPointers |
A vector that stores pointers to the roots of the action history trees of each agent. | |
std::vector< std::vector < ActionHistoryTree * > > | _m_actionHistoryTreeVectors |
A vector which, for each agents, stores a vector with all ActionHistoryTree pointers. | |
std::vector < ActionObservationHistoryTree * > | _m_actionObservationHistoryTreeRootPointers |
A vector that stores pointers to the roots of the action-observation history trees of each agent. | |
std::vector< std::vector < ActionObservationHistoryTree * > > | _m_actionObservationHistoryTreeVectors |
A vector which, for each agents, stores a vector with all ActionObservationHistoryTree pointers. | |
std::vector< std::vector < LIndex > > | _m_firstAHIforT |
The _m_firstAHIforT[aI][t] contains the first action history for time-step t of agent aI. | |
std::vector< std::vector < LIndex > > | _m_firstAOHIforT |
The _m_firstAOHIforT[aI][t] contains the first actionObservation history for time-step t of agent aI. | |
std::vector< LIndex > | _m_firstJAHIforT |
The _m_firstJAHIforT[t] contains the first joint action history for time-step t. | |
std::vector< LIndex > | _m_firstJAOHIforT |
_m_firstJAOHIforT[t] contains the first joint actionObservation history for time-step t. | |
std::vector< LIndex > | _m_firstJOHIforT |
The _m_firstJOHIforT[t] contains the first joint observation history for time-step t. | |
std::vector< std::vector < LIndex > > | _m_firstOHIforT |
The _m_firstOHIforT[aI][t] contains the first observation history for time-step t of agent aI. | |
std::vector< double > | _m_jaohConditionalProbs |
Stores the conditional probability of this joint belief. | |
std::vector< double > | _m_jaohProbs |
Caches the probabilities of JointActionObservationHistory's (assuming b^0 is as specified by the problem and that a pure joint policy consistent with the i-th JointActionObservationHistory is followed). | |
std::vector< const JointBeliefInterface * > | _m_jBeliefCache |
_m_jBeliefCache[i] stores a pointer to the joint belief corresponding to the i-th JointActionObservationHistory (assuming b^0 is as specified by the problem and that a pure joint policy consistent with the i-th JointActionObservationHistory is followed) | |
JointActionHistoryTree * | _m_jointActionHistoryTreeRoot |
The root node of the joint action histories tree. | |
std::vector < JointActionHistoryTree * > | _m_jointActionHistoryTreeVector |
A vector which stores a JointActionHistoryTree pointer. | |
std::map< Index, JointActionObservationHistoryTree * > | _m_jointActionObservationHistoryTreeMap |
A map which is used instead of _m_jointActionObservationHistoryTreeVector when we don't cache all JointActionObservationHistoryTree's. | |
JointActionObservationHistoryTree * | _m_jointActionObservationHistoryTreeRoot |
The root node of the joint actionObservation histories tree. | |
std::vector < JointActionObservationHistoryTree * > | _m_jointActionObservationHistoryTreeVector |
A vector which stores JointActionObservationHistoryTree pointer. | |
JointObservationHistoryTree * | _m_jointObservationHistoryTreeRoot |
The root node of the joint observation histories tree. | |
std::vector < JointObservationHistoryTree * > | _m_jointObservationHistoryTreeVector |
A vector which stores a JointObservationHistoryTree pointer. | |
std::vector< size_t > | _m_nrActionHistories |
A vector that keeps track of the number of action histories per agent. | |
std::vector< std::vector < size_t > > | _m_nrActionHistoriesT |
A vector that keeps track of the number of action histories per agent per time step. | |
std::vector< size_t > | _m_nrActionObservationHistories |
A vector that keeps track of the number of action-obs. | |
std::vector< std::vector < size_t > > | _m_nrActionObservationHistoriesT |
Keeps track of the number of action-obs. | |
size_t | _m_nrJointActionHistories |
The number of joint action histories. | |
std::vector< size_t > | _m_nrJointActionHistoriesT |
The number of joint action histories per time-step. | |
size_t | _m_nrJointActionObservationHistories |
The number of joint actionAction histories. | |
std::vector< size_t > | _m_nrJointActionObservationHistoriesT |
The number of joint actionObservation histories per time-step. | |
size_t | _m_nrJointObservationHistories |
The number of joint observation histories. | |
std::vector< size_t > | _m_nrJointObservationHistoriesT |
The number of joint observation histories per time-step. | |
std::vector< size_t > | _m_nrObservationHistories |
A vector that keeps track of the number of observation histories per agent. | |
std::vector< std::vector < size_t > > | _m_nrObservationHistoriesT |
Keeps track of the number of observation histories per agent per time step. | |
std::vector < ObservationHistoryTree * > | _m_observationHistoryTreeRootPointers |
A vector that stores pointers to the roots of the observation history trees of each agent. | |
std::vector< std::vector < ObservationHistoryTree * > > | _m_observationHistoryTreeVectors |
A vector which, for each agents, stores a vector with all ObservationHistoryTree pointers. |
Private Member Functions | |
ActionHistoryTree * | CreateActionHistoryTree (Index agentI) |
Breadth-first construction of the action histories and action history tree for agent agentI. | |
ActionObservationHistoryTree * | CreateActionObservationHistoryTree (Index agentI) |
Breadth-first construction of the action-observation histories and action-obs. | |
ObservationHistoryTree * | CreateObservationHistoryTree (Index agentI) |
Breadth-first construction of the observation histories and obs. | |
void | Deinitialize () |
Cleans up and releases allocated memory. | |
void | DeInitializeActionHistories () |
Deletes all ActionHistories(Trees) - used on reinitialization. | |
void | DeInitializeActionObservationHistories () |
Deletes all ActionObservationHistories(Trees) - used on reinitialization. | |
void | DeInitializeJointActionHistories () |
Deletes all joint action histories. | |
void | DeInitializeJointActionObservationHistories () |
Deletes all joint action-observation histories. | |
void | DeInitializeJointObservationHistories () |
Deletes all joint observation histories. | |
void | DeInitializeObservationHistories () |
Deletes all ObservationHistories(Trees) - used on reinitialization. | |
void | Initialize () |
Calls functions to initialize the planning unit. | |
void | InitializeActionHistories () |
Constructs all possible action histories and puts them in a tree per agent. | |
void | InitializeActionObservationHistories () |
Constructs all possible action-observation histories and puts them in a tree per agent. | |
void | InitializeJointActionHistories () |
Creates all the joint action histories. | |
void | InitializeJointActionObservationHistories () |
Creates all the joint action-observation histories. | |
void | InitializeJointObservationHistories () |
Creates all the joint observation histories. | |
void | InitializeObservationHistories () |
Constructs all possible observation histories and puts them in a tree per agent. |
Private Attributes | |
bool | _m_initialized |
A bool indicating whether this Planning unit has been initialized. | |
PlanningUnitMADPDiscreteParameters | _m_params |
The parameters for this planning unit. |
PlanningUnitMADPDiscrete represents a Planning unit for a discrete MADP (discrete actions, observations and states).
Definition at line 68 of file PlanningUnitMADPDiscrete.h.
PlanningUnitMADPDiscrete::PlanningUnitMADPDiscrete | ( | const PlanningUnitMADPDiscreteParameters & | params, |
size_t | horizon = 3 , |
||
MultiAgentDecisionProcessDiscreteInterface * | p = 0 |
||
) |
Constructor with specified parameters.
Allows for specification of the planning horizon and a pointer to the problem instance.
Definition at line 74 of file PlanningUnitMADPDiscrete.cpp.
References _m_initialized, _m_params, DEBUG_PU_CONSTRUCTORS, Initialize(), and PlanningUnitMADPDiscreteParameters::SanityCheck().
PlanningUnitMADPDiscrete::PlanningUnitMADPDiscrete | ( | size_t | horizon = 3 , |
MultiAgentDecisionProcessDiscreteInterface * | p = 0 |
||
) |
Constructor with default parameters.
Allows for specification of the planning horizon and a pointer to the problem instance. See PlanningUnitMADPDiscreteParameters for the default settings.
Definition at line 91 of file PlanningUnitMADPDiscrete.cpp.
References _m_initialized, _m_params, DEBUG_PU_CONSTRUCTORS, Initialize(), and PlanningUnitMADPDiscreteParameters::SetComputeAll().
PlanningUnitMADPDiscrete::~PlanningUnitMADPDiscrete | ( | ) |
|
virtual |
Check whether certain index conversions are cached.
Implements Interface_ProblemToPolicyDiscrete.
Definition at line 2885 of file PlanningUnitMADPDiscrete.cpp.
References PolicyGlobals::AOHIST_INDEX, PolicyGlobals::OHIST_INDEX, and PolicyGlobals::TYPE_INDEX.
void PlanningUnitMADPDiscrete::ComputeHistoryArrays | ( | Index | hI, |
Index | t, | ||
Index | t_offset, | ||
Index | Indices[], | ||
size_t | indexDomainSize | ||
) | const |
This function computes the indices of the sequence corr.
to a history. I.e., it is the reverse of ComputeHistoryIndex.
It can be a joint or individual history of actions, observations or actions-observations.
Definition at line 1293 of file PlanningUnitMADPDiscrete.cpp.
Index PlanningUnitMADPDiscrete::ComputeHistoryIndex | ( | Index | t, |
Index | t_offset, | ||
const Index | indices[], | ||
size_t | indexDomainSize | ||
) | const |
This function computes the index of a history.
It can be a joint or individual history of actions, observations or actions-observations.
Definition at line 1566 of file PlanningUnitMADPDiscrete.cpp.
Referenced by GetActionObservationHistoryIndex(), GetJointActionHistoryIndex(), GetJointActionObservationHistoryIndex(), GetJointObservationHistoryIndex(), and GetObservationHistoryIndex().
|
private |
Breadth-first construction of the action histories and action history tree for agent agentI.
Returns a pointer to the root of the tree. The function should only be called from InitializeActionHistories()! (should be called in the order of the agents).
Definition at line 555 of file PlanningUnitMADPDiscrete.cpp.
References _m_actionHistoryTreeVectors, _m_firstAHIforT, _m_nrActionHistories, _m_nrActionHistoriesT, IndexTools::CalculateNumberOfSequences(), PlanningUnit::GetHorizon(), and GetNrActions().
Referenced by InitializeActionHistories().
|
private |
Breadth-first construction of the action-observation histories and action-obs.
history tree for agent agentI.
Returns a pointer to the root of the tree. The function should only be called from InitializeActionObservationHistories()! (should be called in the order of the agents).
Definition at line 920 of file PlanningUnitMADPDiscrete.cpp.
References _m_actionObservationHistoryTreeVectors, _m_firstAOHIforT, _m_nrActionHistoriesT, _m_nrActionObservationHistories, _m_nrActionObservationHistoriesT, ActionObservationHistoryTree::GetActionObservationHistory(), PlanningUnit::GetHorizon(), History::GetLength(), GetNrActions(), GetNrObservations(), ActionObservationHistory::Print(), ActionObservationHistoryTree::Print(), ActionObservationHistoryTree::SetIndex(), and ActionObservationHistoryTree::SetSuccessor().
Referenced by InitializeActionObservationHistories().
|
private |
Breadth-first construction of the observation histories and obs.
history tree for agent agentI.
Returns a pointer to the root of the tree. The function should only be called from InitializeObservationHistories()! (should be called in the order of the agents).
Definition at line 255 of file PlanningUnitMADPDiscrete.cpp.
References _m_firstOHIforT, _m_nrObservationHistories, _m_nrObservationHistoriesT, _m_observationHistoryTreeVectors, IndexTools::CalculateNumberOfSequences(), TreeNode< Tcontained >::GetContainedElement(), PlanningUnit::GetHorizon(), History::GetLength(), GetNrObservations(), ObservationHistoryTree::GetObservationHistory(), TreeNode< Tcontained >::SetIndex(), and TreeNode< Tcontained >::SetSuccessor().
Referenced by InitializeObservationHistories().
|
private |
Cleans up and releases allocated memory.
Definition at line 183 of file PlanningUnitMADPDiscrete.cpp.
References _m_initialized, DeInitializeActionHistories(), DeInitializeActionObservationHistories(), DeInitializeJointActionHistories(), DeInitializeJointActionObservationHistories(), DeInitializeJointObservationHistories(), DeInitializeObservationHistories(), PlanningUnit::GetHorizon(), and Globals::MAXHORIZON.
Referenced by Initialize(), SetHorizon(), SetParams(), SetProblem(), and ~PlanningUnitMADPDiscrete().
|
private |
Deletes all ActionHistories(Trees) - used on reinitialization.
Definition at line 744 of file PlanningUnitMADPDiscrete.cpp.
References _m_actionHistoryTreeRootPointers, _m_actionHistoryTreeVectors, _m_firstAHIforT, _m_nrActionHistories, and _m_nrActionHistoriesT.
Referenced by Deinitialize().
|
private |
Deletes all ActionObservationHistories(Trees) - used on reinitialization.
Definition at line 781 of file PlanningUnitMADPDiscrete.cpp.
References _m_actionObservationHistoryTreeRootPointers, _m_actionObservationHistoryTreeVectors, _m_firstAOHIforT, _m_nrActionObservationHistories, and _m_nrActionObservationHistoriesT.
Referenced by Deinitialize().
|
private |
Deletes all joint action histories.
Definition at line 772 of file PlanningUnitMADPDiscrete.cpp.
References _m_firstJAHIforT, _m_jointActionHistoryTreeRoot, _m_jointActionHistoryTreeVector, _m_nrJointActionHistories, and _m_nrJointActionHistoriesT.
Referenced by Deinitialize().
|
private |
Deletes all joint action-observation histories.
Definition at line 801 of file PlanningUnitMADPDiscrete.cpp.
References _m_firstJAOHIforT, _m_jaohConditionalProbs, _m_jBeliefCache, _m_jointActionObservationHistoryTreeMap, _m_jointActionObservationHistoryTreeRoot, _m_jointActionObservationHistoryTreeVector, _m_nrJointActionObservationHistories, _m_nrJointActionObservationHistoriesT, _m_params, and PlanningUnitMADPDiscreteParameters::GetComputeJointBeliefs().
Referenced by Deinitialize().
|
private |
Deletes all joint observation histories.
Definition at line 491 of file PlanningUnitMADPDiscrete.cpp.
References _m_firstJOHIforT, _m_jointObservationHistoryTreeRoot, _m_jointObservationHistoryTreeVector, _m_nrJointObservationHistories, and _m_nrJointObservationHistoriesT.
Referenced by Deinitialize().
|
private |
Deletes all ObservationHistories(Trees) - used on reinitialization.
Definition at line 355 of file PlanningUnitMADPDiscrete.cpp.
References _m_firstOHIforT, _m_nrObservationHistories, _m_nrObservationHistoriesT, _m_observationHistoryTreeRootPointers, and _m_observationHistoryTreeVectors.
Referenced by Deinitialize().
|
inline |
Returns a ref to the a-th action of agent agentI.
Definition at line 395 of file PlanningUnitMADPDiscrete.h.
References GetAction(), and Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred().
Referenced by GetAction(), ActionHistory::SoftPrint(), and ActionObservationHistory::SoftPrint().
void PlanningUnitMADPDiscrete::GetActionHistoryArrays | ( | Index | agentI, |
Index | ahI, | ||
Index | t, | ||
Index | aIs[] | ||
) | const |
Computes the joint actions for jahI.
This function computes (i.e., does no look up).
Definition at line 1500 of file PlanningUnitMADPDiscrete.cpp.
Referenced by IndividualToJointActionHistoryIndex().
ActionHistoryTree * PlanningUnitMADPDiscrete::GetActionHistoryTree | ( | Index | agentI, |
Index | ohI | ||
) | const |
Returns a pointer to action history# ohI of agent# agentI.
Definition at line 2175 of file PlanningUnitMADPDiscrete.cpp.
References _m_actionHistoryTreeVectors, DEBUG_PUD, GetNrActionHistories(), and GetNrAgents().
Referenced by ActionObservationHistory::ActionObservationHistory(), and ActionObservationHistory::SoftPrint().
void PlanningUnitMADPDiscrete::GetActionObservationHistoryArrays | ( | Index | agentI, |
Index | aohI, | ||
Index | t, | ||
Index | aIs[], | ||
Index | oIs[] | ||
) | const |
Computes the joint actions and observations for aohI.
This function computes (i.e., does no look up).
Definition at line 1440 of file PlanningUnitMADPDiscrete.cpp.
References IndexTools::ActionObservation_to_ActionIndex(), and IndexTools::ActionObservation_to_ObservationIndex().
Referenced by IndividualToJointActionObservationHistoryIndex().
Index PlanningUnitMADPDiscrete::GetActionObservationHistoryIndex | ( | Index | agentI, |
Index | t, | ||
const std::vector< Index > & | actions, | ||
const std::vector< Index > & | observations | ||
) | const |
converts the vectors of actions and observations of length t to a (individual) ObservationHistory Index for agentI.
Definition at line 1713 of file PlanningUnitMADPDiscrete.cpp.
References _m_firstAOHIforT, IndexTools::ActionAndObservation_to_ActionObservationIndex(), ComputeHistoryIndex(), GetNrActions(), and GetNrObservations().
Referenced by JointToIndividualActionObservationHistoryIndices().
|
inline |
Returns a pointer to observation history# ohI of agent# agentI.
Definition at line 746 of file PlanningUnitMADPDiscrete.h.
References _m_actionObservationHistoryTreeVectors.
|
virtual |
Return the default IndexDomainCategory for the problem.
Implements Interface_ProblemToPolicyDiscrete.
Definition at line 2960 of file PlanningUnitMADPDiscrete.cpp.
References PolicyGlobals::OHIST_INDEX.
|
inline |
Returns the index of the first joint action observation history of time step ts.
Definition at line 689 of file PlanningUnitMADPDiscrete.h.
References _m_firstJAOHIforT.
|
inline |
Returns the index of the first joint observation history of time step ts.
Definition at line 535 of file PlanningUnitMADPDiscrete.h.
References _m_firstJOHIforT.
|
inline |
Returns the index of the first ts observation history of agent agI.
Definition at line 531 of file PlanningUnitMADPDiscrete.h.
References _m_firstOHIforT.
Referenced by GMAA_MAAstar::ConstructAndValuateNextPolicies(), GMAA_kGMAA::ConstructAndValuateNextPolicies(), BGforStageCreation::Fill_FirstOHtsI(), and BayesianGameForDecPOMDPStage::Fill_FirstOHtsI().
|
inline |
Returns the probability of a state in the initial state distribution.
Definition at line 367 of file PlanningUnitMADPDiscrete.h.
References GetInitialStateProbability(), and Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred().
Referenced by ValueFunctionDecPOMDPDiscrete::CalculateV0RecursivelyCached(), ValueFunctionDecPOMDPDiscrete::CalculateV0RecursivelyNotCached(), and GetInitialStateProbability().
double PlanningUnitMADPDiscrete::GetJAOHProb | ( | Index | jaohI, |
Index | p_jaohI = 0 , |
||
const JointBeliefInterface * | p_jb = NULL , |
||
const JointPolicyDiscrete * | jpol = NULL |
||
) | const |
returns the probability of jaohI.
Definition at line 2463 of file PlanningUnitMADPDiscrete.cpp.
References GetJAOHProbs(), and GetNrStates().
double PlanningUnitMADPDiscrete::GetJAOHProbGivenPred | ( | Index | jaohI | ) | const |
Gives the conditional probability of the realization of the joint action-observation history jaohI (and thus of the joint belief corresponding to JointActionObservationHistory jaohI).
This probability is conditional GIVEN the previous joint action-observation history (joint belief) AND joint action. I.e. P(h'|h,a) = P(h,a,h') / P(h,a)
Definition at line 2480 of file PlanningUnitMADPDiscrete.cpp.
References _m_jaohConditionalProbs, _m_params, PlanningUnitMADPDiscreteParameters::GetComputeJointActionObservationHistories(), GetJAOHProbs(), GetJointActionObservationHistoryIndex(), GetJointActionObservationHistoryVectors(), GetNewJointBeliefInterface(), and prob.
double PlanningUnitMADPDiscrete::GetJAOHProbs | ( | JointBeliefInterface * | jb, |
Index | jaohI, | ||
Index | p_jaohI = 0 , |
||
const JointBeliefInterface * | p_jb = NULL , |
||
const JointPolicyDiscrete * | jpol = NULL |
||
) | const |
returns the probability of jaohI AND the corresponding joint belief given the predecessor p_jaohI (and its corresponding belief)
-output args: JointBeliefInterface jb -the joint belief at jaohI -input args: Index jaohI -the jaohI for which we want to know the probs. Index p_jaohI = 0 -the GIVEN predecessor, when none is specified, the initial (empty) jaoh is assumed. JointBelief* p_jb = NULL-the corresponding GIVEN jb of p JointPolicyDiscrete * jpol = NULL -the policy followed starting from p_jaohI. (see remark below) -returns the probability of jaohI, given p_jaohI.
jpol is the joint policy that is followed for the stages between p_jaohI and jaohI. It doesn't matter if given jpol, the prob. of p_jaohI is 0; this function returns P(jaohI) GIVEN p_jaohI and following jpol consequently.
Definition at line 2286 of file PlanningUnitMADPDiscrete.cpp.
References _m_jaohProbs, _m_jBeliefCache, _m_params, PlanningUnitMADPDiscreteParameters::GetComputeJointBeliefs(), GetJAOHProbsRecursively(), JointActionObservationHistoryTree::GetJointActionObservationHistory(), GetJointActionObservationHistoryArrays(), GetJointActionObservationHistoryTree(), GetJointActionObservationHistoryVectors(), GetMADPDI(), GetTimeStepForJAOHI(), Globals::INITIAL_JAOHI, BeliefInterface::Set(), JointActionObservationHistory::SoftPrint(), and PrintTools::SoftPrintVector().
Referenced by GetJAOHProb(), and GetJAOHProbGivenPred().
double PlanningUnitMADPDiscrete::GetJAOHProbsRecursively | ( | JointBeliefInterface * | jb, |
const Index | jaIs[], | ||
const Index | joIs[], | ||
Index | t_p, | ||
Index | t, | ||
Index | p_jaohI = 0 , |
||
const JointPolicyDiscrete * | jpol = NULL |
||
) | const |
the function that perfoms most of the work, called by GetJAOHProbs.
given the joint belief jb, held for joint action observation history p_joahI, this function performs the joint belief updates corresponding to the sequence
jaIs[t_p], joIs[t_p], ..., jaIs[t], joIs[t]
the returned value is the probability of this sequence, given the start p_jaohI, and given the policy followed jpol.
The joint belief corresponding to this sequence is returned through jb (the belief jb is simply updated.)
Definition at line 2403 of file PlanningUnitMADPDiscrete.cpp.
References PolicyGlobals::AOHIST_INDEX, JointPolicyDiscrete::GetIndexDomainCategory(), JointPolicyDiscrete::GetJointActionProb(), GetJointObservationHistoryIndex(), Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred(), GetSuccessorJAOHI(), PolicyGlobals::OHIST_INDEX, and JointBeliefInterface::Update().
Referenced by GetJAOHProbs(), and BayesianGameForDecPOMDPStage::Initialize().
|
inline |
Returns a ref to the i-th joint action.
Definition at line 398 of file PlanningUnitMADPDiscrete.h.
References GetJointAction(), and Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred().
Referenced by GetJointAction(), JointActionObservationHistory::SoftPrint(), JointActionHistory::SoftPrint(), and SimulationDecPOMDPDiscrete::Step().
Index PlanningUnitMADPDiscrete::GetJointActionHistoryIndex | ( | Index | t, |
const std::vector< Index > & | jointActions | ||
) | const |
converts the vector joint observations of length t to a JointObservationHistory Index.
jointObservation needs to be a vector of length > t. The index of the history formed by the first t joint observations is returned.
Definition at line 1671 of file PlanningUnitMADPDiscrete.cpp.
References _m_firstJAHIforT, ComputeHistoryIndex(), and GetNrJointActions().
Referenced by IndividualToJointActionHistoryIndex().
Index PlanningUnitMADPDiscrete::GetJointActionHistoryIndex | ( | Index | t, |
const Index | jointActions[] | ||
) | const |
converts the vector joint observations of length t to a JointObservationHistory Index.
jointObservation needs to be a vector of length > t. The index of the history formed by the first t joint observations is returned.
Definition at line 1692 of file PlanningUnitMADPDiscrete.cpp.
References _m_firstJAHIforT, ComputeHistoryIndex(), and GetNrJointActions().
Index PlanningUnitMADPDiscrete::GetJointActionHistoryIndex | ( | JointActionHistoryTree * | joh | ) | const |
Returns the index of a JointActionHistoryTree pointer.
Definition at line 2223 of file PlanningUnitMADPDiscrete.cpp.
References _m_jointActionHistoryTreeVector, and _m_nrJointActionHistories.
JointActionHistoryTree * PlanningUnitMADPDiscrete::GetJointActionHistoryTree | ( | Index | jahI | ) | const |
Returns a pointer to joint action history#.
Definition at line 2210 of file PlanningUnitMADPDiscrete.cpp.
References _m_jointActionHistoryTreeVector, and _m_nrJointActionHistories.
Referenced by QBG::ComputeRecursivelyNoCache().
void PlanningUnitMADPDiscrete::GetJointActionObservationHistoryArrays | ( | Index | jaohI, |
Index | t, | ||
Index | jaIs[], | ||
Index | joIs[] | ||
) | const |
Computes the joint actions and observations for jaohI.
This function computes (i.e., does no look up).
This function is called by GetJAOHProbs() and JointToIndividualActionObservationHistoryIndices() (when the aoh's are not cached).
Definition at line 1366 of file PlanningUnitMADPDiscrete.cpp.
References IndexTools::ActionObservation_to_ActionIndex(), and IndexTools::ActionObservation_to_ObservationIndex().
Referenced by GetJAOHProbs(), and JointAOHIndexToIndividualActionObservationVectors().
Index PlanningUnitMADPDiscrete::GetJointActionObservationHistoryIndex | ( | JointActionObservationHistoryTree * | jaoh | ) | const |
Returns the index of a JointObservationHistoryTree pointer.
Definition at line 1551 of file PlanningUnitMADPDiscrete.cpp.
References _m_jointActionObservationHistoryTreeVector, and _m_nrJointActionObservationHistories.
Referenced by GetJAOHProbGivenPred(), IndividualToJointActionObservationHistoryIndex(), and BayesianGameForDecPOMDPStage::Initialize().
Index PlanningUnitMADPDiscrete::GetJointActionObservationHistoryIndex | ( | Index | t, |
const std::vector< Index > & | Jactions, | ||
const std::vector< Index > & | Jobservations | ||
) | const |
converts the vectors of actions and observations of length t to a joint ActionObservationHistory Index.
Jactions and Jobservation needs to be a vector of length > t.
Definition at line 1752 of file PlanningUnitMADPDiscrete.cpp.
References _m_firstJAOHIforT, IndexTools::ActionAndObservation_to_ActionObservationIndex(), ComputeHistoryIndex(), GetNrJointActions(), and GetNrJointObservations().
JointActionObservationHistoryTree * PlanningUnitMADPDiscrete::GetJointActionObservationHistoryTree | ( | Index | jaohI | ) | const |
Returns a pointer to JointActionObservation history#.
Definition at line 2866 of file PlanningUnitMADPDiscrete.cpp.
Referenced by QMDP::CacheJaohQValues(), GetJAOHProbs(), and BayesianGameForDecPOMDPStage::ProbRewardForjoahI().
void PlanningUnitMADPDiscrete::GetJointActionObservationHistoryVectors | ( | Index | jaohI, |
std::vector< Index > & | jaIs, | ||
std::vector< Index > & | joIs | ||
) | const |
returns the vectors with joint actions and observations for JointActionObservationHistory jaohi.
This function first tries to find jaohI in the cache. If it doesn't find it there, it computes the desired result using GetJointActionObservationHistoryArrays.
Definition at line 1338 of file PlanningUnitMADPDiscrete.cpp.
References JointActionObservationHistoryTree::GetJointActionObservationHistory().
Referenced by GetJAOHProbGivenPred(), GetJAOHProbs(), and GetJointBeliefInterface().
JointBeliefInterface * PlanningUnitMADPDiscrete::GetJointBeliefInterface | ( | Index | jaohI | ) | const |
brief Returns a pointer to a new joint belief.
When joint beliefs are cached, this function returns a new joint belief, which is a copy of the one stored in the joint belief cache.
When joint beliefs are not cached, this function simple calculates and returns a new belief.
In all cases, the programming is responsible to clean up! (i.e., 'delete' the ptr).
Definition at line 2244 of file PlanningUnitMADPDiscrete.cpp.
References _m_jBeliefCache, _m_params, PlanningUnitMADPDiscreteParameters::GetComputeJointBeliefs(), GetJointActionObservationHistoryVectors(), GetNewJointBeliefFromISD(), GetNewJointBeliefInterface(), Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred(), BeliefInterface::Print(), BeliefInterface::SanityCheck(), and JointBeliefInterface::Update().
Referenced by QFunctionJointBelief::GetQ(), and QMDP::GetQNoCache().
|
inline |
Returns a ref to the joI-th joint observation.
Definition at line 434 of file PlanningUnitMADPDiscrete.h.
References GetJointObservation(), and Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred().
Referenced by QBG::ComputeRecursivelyNoCache(), GetJointObservation(), JointActionObservationHistory::SoftPrint(), JointObservationHistory::SoftPrint(), and SimulationDecPOMDPDiscrete::Step().
void PlanningUnitMADPDiscrete::GetJointObservationHistoryArrays | ( | Index | johI, |
Index | t, | ||
Index | joIs[] | ||
) | const |
Computes the joint observations for johI.
This function computes (i.e., does no look up).
This function is called by JointToIndividualObservationHistoryIndices (used when obs-histories are not cached).
Definition at line 1414 of file PlanningUnitMADPDiscrete.cpp.
Referenced by JointToIndividualObservationHistoryIndices().
Index PlanningUnitMADPDiscrete::GetJointObservationHistoryIndex | ( | JointObservationHistoryTree * | joh | ) | const |
Returns the index of a JointObservationHistoryTree pointer.
Definition at line 1537 of file PlanningUnitMADPDiscrete.cpp.
References _m_jointObservationHistoryTreeVector, and _m_nrJointObservationHistories.
Referenced by GetJAOHProbsRecursively(), and IndividualToJointObservationHistoryIndex().
Index PlanningUnitMADPDiscrete::GetJointObservationHistoryIndex | ( | Index | t, |
const std::vector< Index > & | jointObservations | ||
) | const |
converts the vector joint observations of length t to a JointObservationHistory Index.
jointObservation needs to be a vector of length > t. The index of the history formed by the first t joint observations is returned.
Definition at line 1628 of file PlanningUnitMADPDiscrete.cpp.
References _m_firstJOHIforT, ComputeHistoryIndex(), and GetNrJointObservations().
Index PlanningUnitMADPDiscrete::GetJointObservationHistoryIndex | ( | Index | t, |
const Index | jointObservations[] | ||
) | const |
converts the vector joint observations of length t to a JointObservationHistory Index.
jointObservation needs to be a vector of length > t. The index of the history formed by the first t joint observations is returned.
Definition at line 1649 of file PlanningUnitMADPDiscrete.cpp.
References _m_firstJOHIforT, ComputeHistoryIndex(), and GetNrJointObservations().
JointObservationHistoryTree * PlanningUnitMADPDiscrete::GetJointObservationHistoryTree | ( | Index | johI | ) | const |
Returns a pointer to joint observation history#.
Definition at line 1271 of file PlanningUnitMADPDiscrete.cpp.
References _m_jointObservationHistoryTreeVector, and _m_nrJointObservationHistories.
Referenced by QBG::ComputeRecursivelyNoCache().
|
inline |
Definition at line 333 of file PlanningUnitMADPDiscrete.h.
References Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred().
Referenced by GetJAOHProbs().
|
inline |
Definition at line 335 of file PlanningUnitMADPDiscrete.h.
References Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred().
JointBeliefInterface * PlanningUnitMADPDiscrete::GetNewJointBeliefFromISD | ( | ) | const |
Returns a new joint belief with the value of the initial state distribution.
Definition at line 2856 of file PlanningUnitMADPDiscrete.cpp.
References MultiAgentDecisionProcessDiscreteInterface::GetISD(), and BeliefInterface::Set().
Referenced by AgentBG::Act(), QFunctionJAOHTree::ComputeQ(), AlphaVectorPlanning::ExportPOMDPFile(), GetJointBeliefInterface(), BayesianGameForDecPOMDPStage::Initialize(), Perseus::PlanEndOfIteration(), Perseus::PlanStartOfIteration(), BayesianGameForDecPOMDPStage::ProbRewardForjoahI(), AgentPOMDP::ResetEpisode(), AgentQMDP::ResetEpisode(), and AgentBG::ResetEpisode().
|
virtual |
a function that forces derives classes to specify which types of joint beliefs are used.
The function returns a pointer to a joint belief that is allocated with new. Therefore it should also be *delete*d.
The function is virtual, so it can be overriden in derived classes. The behavior implemented here is as follows:
When _m_params._m_useSparseBeliefs -> return a JointBeliefSparse otherwise return a JointBelief.
Definition at line 2966 of file PlanningUnitMADPDiscrete.cpp.
Referenced by AgentPOMDP::AgentPOMDP(), GetJAOHProbGivenPred(), GetJointBeliefInterface(), InitializeJointActionObservationHistories(), and AlphaVectorPlanning::SampleBeliefs().
|
virtual |
Definition at line 2974 of file PlanningUnitMADPDiscrete.cpp.
size_t PlanningUnitMADPDiscrete::GetNrActionHistories | ( | Index | agentI | ) | const |
Returns the number of action histories for agentI.
The planning unit (specifically _m_nrActionHistories) must be initialized when calling this function.
Definition at line 2152 of file PlanningUnitMADPDiscrete.cpp.
References _m_nrActionHistories.
Referenced by GetActionHistoryTree().
|
inline |
Returns the number of action observation histories for agentI.
The planning unit (specifically _m_nrObservationHistories) must be initialized and action-observation histories must have been created when calling this function.
Definition at line 743 of file PlanningUnitMADPDiscrete.h.
References _m_nrActionObservationHistories.
Referenced by JESPDynamicProgrammingPlanner::DynamicProgrammingBestResponse().
|
inline |
Returns the number of actions vector.
Definition at line 385 of file PlanningUnitMADPDiscrete.h.
References GetNrActions(), and Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred().
Referenced by AgentRandom::Act(), CreateActionHistoryTree(), CreateActionObservationHistoryTree(), GetActionObservationHistoryIndex(), GetNrActions(), GetNrPolicies(), and DICEPSPlanner::UpdateCEProbDistribution().
|
inlinevirtual |
Returns the number of actions of agent agentI.
Implements Interface_ProblemToPolicyDiscrete.
Definition at line 388 of file PlanningUnitMADPDiscrete.h.
References GetNrActions(), and Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred().
Referenced by GetNrActions().
|
inline |
Gets the number of agents.
Reimplemented from PlanningUnit.
Definition at line 352 of file PlanningUnitMADPDiscrete.h.
References PlanningUnit::GetNrAgents().
Referenced by AgentBG::AgentBG(), AlphaVectorBG::AlphaVectorBG(), QFunctionJAOHTree::ComputeQ(), GMAA_MAAstar::ConstructAndValuateNextPolicies(), GMAA_kGMAA::ConstructAndValuateNextPolicies(), GeneralizedMAAStarPlannerForDecPOMDPDiscrete::ConstructExtendedJointPolicy(), BGforStageCreation::Fill_FirstOHtsI(), BGforStageCreation::Fill_joI_Array(), GetActionHistoryTree(), GetNrJointPolicies(), GetNrObservationHistoriesVector(), GetObservationHistoryTree(), IndividualBeliefJESP::IndividualBeliefJESP(), IndividualToJointActionHistoryIndex(), IndividualToJointActionObservationHistoryIndex(), IndividualToJointObservationHistoryIndex(), InitializeActionHistories(), InitializeActionObservationHistories(), InitializeJointActionHistories(), InitializeJointActionObservationHistories(), InitializeJointObservationHistories(), InitializeObservationHistories(), JointActionHistory::JointActionHistory(), JointActionObservationHistory::JointActionObservationHistory(), JointAOHIndexToIndividualActionObservationVectors(), JointObservationHistory::JointObservationHistory(), JointToIndividualActionObservationHistoryIndices(), JointToIndividualObservationHistoryIndices(), JESPExhaustivePlanner::Plan(), JESPDynamicProgrammingPlanner::Plan(), PrintActionHistories(), PrintActionObservationHistories(), PrintObservationHistories(), and IndividualBeliefJESP::Update().
size_t PlanningUnitMADPDiscrete::GetNrJointActionHistories | ( | ) | const |
Returns the number of joint action histories.
Definition at line 2159 of file PlanningUnitMADPDiscrete.cpp.
References _m_jointActionHistoryTreeVector.
|
inline |
Returns the number of jointActionObservation histories.
Definition at line 751 of file PlanningUnitMADPDiscrete.h.
References _m_nrJointActionObservationHistories.
Referenced by QMDP::CacheJaohQValues().
|
inline |
return the number of joint actions.
Reimplemented from Interface_ProblemToPolicyDiscrete.
Definition at line 391 of file PlanningUnitMADPDiscrete.h.
References GetNrJointActions(), and Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred().
Referenced by AgentPOMDP::Act(), AgentQMDP::Act(), AlphaVectorPlanning::BackProjectFull(), AlphaVectorPlanning::BackProjectMonahan(), AlphaVectorPlanning::BackProjectSparse(), PerseusBGPlanner::BackupStageAll(), Perseus::BackupStageLeadOut(), PerseusBGPlanner::BackupStageSampling(), PerseusBGPlanner::BackupStageSamplingAlt(), AlphaVectorPOMDP::BeliefBackup(), AlphaVectorBG::BeliefBackupBGIP_Solver(), AlphaVectorBG::BeliefBackupExhaustiveOnlyKeepMax(), AlphaVectorBG::BeliefBackupExhaustiveStoreAll(), QMDP::CacheJaohQValues(), QFunctionJAOHTree::ComputeQ(), QBG::ComputeRecursivelyNoCache(), AlphaVectorPlanning::ExportPOMDPFile(), AlphaVectorPlanning::GetImmediateRewardValueFunction(), Perseus::GetInitialQFunctions(), Perseus::GetInitialValueFunction(), GetJointActionHistoryIndex(), GetJointActionObservationHistoryIndex(), AlphaVectorBG::GetMask(), AgentBG::GetMaximizingActionIndex(), AgentBG::GetMaximizingBGIndex(), GetNrJointActions(), MDPValueIteration::Initialize(), SimulationDecPOMDPDiscrete::Initialize(), AlphaVectorPlanning::Initialize(), InitializeJointActionHistories(), InitializeJointActionObservationHistories(), MDPValueIteration::Plan(), MDPValueIteration::PlanSlow(), and AlphaVectorPlanning::SampleBeliefs().
|
inline |
Returns the number of joint observation histories.
Definition at line 525 of file PlanningUnitMADPDiscrete.h.
References _m_nrJointObservationHistories.
Referenced by BayesianGameForDecPOMDPStage::Initialize(), DICEPSPlanner::Plan(), and ValueFunctionDecPOMDPDiscrete::ValueFunctionDecPOMDPDiscrete().
|
inline |
Returns the number of joint observation histories for time step ts.
Definition at line 528 of file PlanningUnitMADPDiscrete.h.
References _m_nrJointObservationHistoriesT.
|
inline |
Returns the number of joint observations.
Definition at line 428 of file PlanningUnitMADPDiscrete.h.
References GetNrJointObservations(), and Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred().
Referenced by AlphaVectorPlanning::BackProjectFull(), AlphaVectorPlanning::BackProjectMonahan(), AlphaVectorPlanning::BackProjectSparse(), Perseus::BackupStageLeadOut(), AlphaVectorPOMDP::BeliefBackup(), AlphaVectorBG::BeliefBackupBGIP_Solver(), AlphaVectorBG::BeliefBackupExhaustiveOnlyKeepMax(), AlphaVectorBG::BeliefBackupExhaustiveStoreAll(), QBG::ComputeRecursivelyNoCache(), AlphaVectorPlanning::ExportPOMDPFile(), GetJointActionObservationHistoryIndex(), GetJointObservationHistoryIndex(), GetNrJointObservations(), AlphaVectorPlanning::Initialize(), InitializeJointActionObservationHistories(), InitializeJointObservationHistories(), AlphaVectorPlanning::MonahanCrossSum(), and ValueFunctionDecPOMDPDiscrete::ValueFunctionDecPOMDPDiscrete().
LIndex PlanningUnitMADPDiscrete::GetNrJointPolicies | ( | ) | const |
Returns the number of joint policies.
Definition at line 1199 of file PlanningUnitMADPDiscrete.cpp.
References GetNrAgents(), and GetNrPolicies().
Referenced by BruteForceSearchPlanner::Plan().
size_t PlanningUnitMADPDiscrete::GetNrObservationHistories | ( | Index | agentI | ) | const |
Returns the number of observation histories for agentI.
The planning unit (specifically _m_nrObservationHistories) must be initialized when calling this function.
Definition at line 1212 of file PlanningUnitMADPDiscrete.cpp.
References _m_nrObservationHistories.
Referenced by GetNrObservationHistoriesVector(), GetNrPolicies(), GetObservationHistoryTree(), IndividualBeliefJESP::IndividualBeliefJESP(), DICEPSPlanner::Plan(), and DICEPSPlanner::UpdateCEProbDistribution().
|
inline |
Returns the number of observation histories for agentI for time step ts.
The planning unit (specifically _m_nrObservationHistories) must be initialized when calling this function.
Definition at line 519 of file PlanningUnitMADPDiscrete.h.
References _m_nrObservationHistoriesT.
const vector< size_t > PlanningUnitMADPDiscrete::GetNrObservationHistoriesVector | ( | ) | const |
Returns a vector with the number of OHs for each agent.
This calls GetNrObservationHistories(Index agentI)
Definition at line 1220 of file PlanningUnitMADPDiscrete.cpp.
References GetNrAgents(), and GetNrObservationHistories().
const vector< size_t > PlanningUnitMADPDiscrete::GetNrObservationHistoriesVector | ( | Index | ts | ) | const |
Returns a vector with the number of OHs in stage ts for each agent.
This calls GetNrObservationHistories(Index agentI, Index ts)
Definition at line 1228 of file PlanningUnitMADPDiscrete.cpp.
References GetNrAgents(), and GetNrObservationHistories().
|
inline |
Returns the number of observations vector.
Definition at line 422 of file PlanningUnitMADPDiscrete.h.
References GetNrObservations(), and Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred().
Referenced by CreateActionObservationHistoryTree(), CreateObservationHistoryTree(), GetActionObservationHistoryIndex(), GetNrObservations(), GetObservationHistoryIndex(), and IndividualBeliefJESP::Update().
|
inline |
Returns the number of observations of agent agentI.
Definition at line 425 of file PlanningUnitMADPDiscrete.h.
References GetNrObservations(), and Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred().
Referenced by GetNrObservations().
LIndex PlanningUnitMADPDiscrete::GetNrPolicies | ( | Index | agentI | ) | const |
Returns the number of policies for agentI.
Definition at line 1182 of file PlanningUnitMADPDiscrete.cpp.
References GetNrActions(), and GetNrObservationHistories().
Referenced by GetNrJointPolicies().
|
virtual |
Get the number of elements in the domain of an agent's policy.
Implements Interface_ProblemToPolicyDiscrete.
Definition at line 2933 of file PlanningUnitMADPDiscrete.cpp.
References PolicyGlobals::AOHIST_INDEX, Globals::MAXHORIZON, PolicyGlobals::OHIST_INDEX, and PolicyGlobals::TYPE_INDEX.
size_t PlanningUnitMADPDiscrete::GetNrStates | ( | ) | const |
Returns the number of states.
Definition at line 1175 of file PlanningUnitMADPDiscrete.cpp.
References MultiAgentDecisionProcessDiscreteInterface::GetNrStates(), and Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred().
Referenced by AgentQMDP::Act(), AlphaVectorPlanning::BackProjectFull(), AlphaVectorPlanning::BackProjectMonahan(), AlphaVectorPlanning::BackProjectSparse(), PerseusPOMDPPlanner::BackupStage(), PerseusBGPlanner::BackupStageAll(), PerseusBGPlanner::BackupStageSampling(), PerseusBGPlanner::BackupStageSamplingAlt(), AlphaVectorPOMDP::BeliefBackup(), AlphaVectorBG::BeliefBackupBGIP_Solver(), AlphaVectorBG::BeliefBackupExhaustiveOnlyKeepMax(), AlphaVectorBG::BeliefBackupExhaustiveStoreAll(), QFunctionJAOHTree::ComputeQ(), QBG::ComputeRecursivelyNoCache(), AlphaVectorPlanning::ExportPOMDPFile(), AlphaVectorPlanning::GetImmediateRewardValueFunction(), Perseus::GetInitialQFunctions(), Perseus::GetInitialValueFunction(), GetJAOHProb(), IndividualBeliefJESP::IndividualBeliefJESP(), MDPValueIteration::Initialize(), SimulationDecPOMDPDiscrete::Initialize(), AlphaVectorPlanning::Initialize(), AlphaVectorPlanning::MonahanCrossSum(), MDPValueIteration::Plan(), DICEPSPlanner::Plan(), MDPValueIteration::PlanSlow(), BayesianGameForDecPOMDPStage::ProbRewardForjoahI(), AlphaVectorPlanning::Prune(), AlphaVectorPlanning::SampleBeliefs(), IndividualBeliefJESP::Update(), and ValueFunctionDecPOMDPDiscrete::ValueFunctionDecPOMDPDiscrete().
|
inline |
Returns a ref to the o-th observation of agent agentI.
Definition at line 431 of file PlanningUnitMADPDiscrete.h.
References GetObservation(), and Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred().
Referenced by GetObservation(), ActionObservationHistory::SoftPrint(), and ObservationHistory::SoftPrint().
void PlanningUnitMADPDiscrete::GetObservationHistoryArrays | ( | Index | agentI, |
Index | ohI, | ||
Index | t, | ||
Index | oIs[] | ||
) | const |
Computes the observations for ohI.
This function computes (i.e., does no look up).
This function is called by JointToIndividualObservationHistoryIndices (used when obs-histories are not cached).
Definition at line 1474 of file PlanningUnitMADPDiscrete.cpp.
Referenced by BGforStageCreation::Fill_joI_Array(), BayesianGameForDecPOMDPStage::Fill_joI_Array(), and IndividualToJointObservationHistoryIndex().
Index PlanningUnitMADPDiscrete::GetObservationHistoryIndex | ( | Index | agentI, |
Index | t, | ||
const std::vector< Index > & | observations | ||
) | const |
converts the vector observations of length t to a (individual) ObservationHistory Index for agentI.
observation needs to be a vector of length > t. The index of the history formed by the first t observations is returned.
Definition at line 1596 of file PlanningUnitMADPDiscrete.cpp.
References _m_firstOHIforT, ComputeHistoryIndex(), and GetNrObservations().
Referenced by JointToIndividualObservationHistoryIndices().
ObservationHistoryTree * PlanningUnitMADPDiscrete::GetObservationHistoryTree | ( | Index | agentI, |
Index | ohI | ||
) | const |
Returns a pointer to observation history# ohI of agent# agentI.
Definition at line 1236 of file PlanningUnitMADPDiscrete.cpp.
References _m_observationHistoryTreeVectors, _m_params, DEBUG_PUD, PlanningUnitMADPDiscreteParameters::GetComputeIndividualObservationHistories(), GetNrAgents(), and GetNrObservationHistories().
Referenced by ActionObservationHistory::ActionObservationHistory(), and ActionObservationHistory::SoftPrint().
|
inline |
Definition at line 1005 of file PlanningUnitMADPDiscrete.h.
References GetObservationModelDiscretePtr(), and Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred().
Referenced by GetObservationModelDiscretePtr(), and AlphaVectorPlanning::Initialize().
|
inline |
Returns P(joI | jaI, sucSI ). Arguments are time-ordered.
Definition at line 976 of file PlanningUnitMADPDiscrete.h.
References GetObservationProbability(), and Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred().
Referenced by ValueFunctionDecPOMDPDiscrete::CalculateVsjohRecursivelyCached(), ValueFunctionDecPOMDPDiscrete::CalculateVsjohRecursivelyNotCached(), AlphaVectorPlanning::ExportPOMDPFile(), GetObservationProbability(), and IndividualBeliefJESP::Update().
|
inline |
Get the parameters for this planning unit.
Definition at line 375 of file PlanningUnitMADPDiscrete.h.
References _m_params.
Referenced by GeneralizedMAAStarPlannerForDecPOMDPDiscrete::GeneralizedMAAStarPlannerForDecPOMDPDiscrete().
|
inline |
Returns a reference to the problem of the PlanningUnitMADPDiscrete.
Reimplemented from PlanningUnit.
Definition at line 355 of file PlanningUnitMADPDiscrete.h.
References Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred().
Referenced by JESPDynamicProgrammingPlanner::DynamicProgrammingBestResponse(), and AlphaVectorPlanning::SampleBeliefs().
|
inline |
Definition at line 357 of file PlanningUnitMADPDiscrete.h.
References Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred().
|
inline |
Get a pointer to a State by index.
Definition at line 363 of file PlanningUnitMADPDiscrete.h.
References Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred(), and GetState().
Referenced by GetState().
Index PlanningUnitMADPDiscrete::GetSuccessorAHI | ( | Index | agentI, |
Index | ohI, | ||
Index | oI | ||
) | const |
Definition at line 2745 of file PlanningUnitMADPDiscrete.cpp.
Index PlanningUnitMADPDiscrete::GetSuccessorAOHI | ( | Index | agI, |
Index | aohI, | ||
Index | aI, | ||
Index | oI | ||
) | const |
Returns the index of the successor of joint action-observation history jaohI via joint action jaI and joint observation joI.
Definition at line 2805 of file PlanningUnitMADPDiscrete.cpp.
Index PlanningUnitMADPDiscrete::GetSuccessorJAHI | ( | Index | johI, |
Index | joI | ||
) | const |
Definition at line 2727 of file PlanningUnitMADPDiscrete.cpp.
Index PlanningUnitMADPDiscrete::GetSuccessorJAOHI | ( | Index | jaohI, |
Index | jaI, | ||
Index | joI | ||
) | const |
Returns the index of the successor of agent agI's action-observation history aohI via action aI and observation oI.
Definition at line 2823 of file PlanningUnitMADPDiscrete.cpp.
Referenced by GetJAOHProbsRecursively().
Index PlanningUnitMADPDiscrete::GetSuccessorJOHI | ( | Index | johI, |
Index | joI | ||
) | const |
Returns the index of the successor of observation history johI via joint observation joI.
I.e., johIsuc = (johI, joI).
Definition at line 2650 of file PlanningUnitMADPDiscrete.cpp.
Referenced by ValueFunctionDecPOMDPDiscrete::CalculateVsjohRecursivelyCached(), ValueFunctionDecPOMDPDiscrete::CalculateVsjohRecursivelyNotCached(), BGforStageCreation::Fill_jaI_Array(), BayesianGameForDecPOMDPStage::Fill_jaI_Array(), and SimulationDecPOMDPDiscrete::RunSimulation().
Index PlanningUnitMADPDiscrete::GetSuccessorOHI | ( | Index | agentI, |
Index | ohI, | ||
Index | oI | ||
) | const |
Returns the index of the successor of observation history ohI of agentI via observation joI.
I.e., johIsuc = (johI, joI).
Definition at line 2668 of file PlanningUnitMADPDiscrete.cpp.
Referenced by IndividualBeliefJESP::Update().
Index PlanningUnitMADPDiscrete::GetTimeStepForAHI | ( | Index | agentI, |
Index | ohI | ||
) | const |
Returns the time step of observation history ohI.
Definition at line 2687 of file PlanningUnitMADPDiscrete.cpp.
Index PlanningUnitMADPDiscrete::GetTimeStepForAOHI | ( | Index | agentI, |
Index | aohI | ||
) | const |
Returns the time step of joint action-observation historyaohI.
Definition at line 2764 of file PlanningUnitMADPDiscrete.cpp.
Index PlanningUnitMADPDiscrete::GetTimeStepForJAHI | ( | Index | johI | ) | const |
Returns the time step of joint observation history johI.
Definition at line 2707 of file PlanningUnitMADPDiscrete.cpp.
Index PlanningUnitMADPDiscrete::GetTimeStepForJAOHI | ( | Index | jaohI | ) | const |
Returns the time step of joint action-observation historyjaohI.
Definition at line 2784 of file PlanningUnitMADPDiscrete.cpp.
Referenced by GetJAOHProbs(), QMDP::GetQNoCache(), JointAOHIndexToIndividualActionObservationVectors(), and JointToIndividualActionObservationHistoryIndices().
Index PlanningUnitMADPDiscrete::GetTimeStepForJOHI | ( | Index | johI | ) | const |
Returns the time step of joint observation history johI.
Definition at line 2629 of file PlanningUnitMADPDiscrete.cpp.
Referenced by ValueFunctionDecPOMDPDiscrete::CalculateVsjohRecursivelyNotCached(), and JointToIndividualObservationHistoryIndices().
Index PlanningUnitMADPDiscrete::GetTimeStepForOHI | ( | Index | agentI, |
Index | ohI | ||
) | const |
Returns the time step of observation history ohI.
Definition at line 2609 of file PlanningUnitMADPDiscrete.cpp.
|
inline |
Definition at line 1000 of file PlanningUnitMADPDiscrete.h.
References Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred().
Referenced by AlphaVectorPlanning::AlphaVectorPlanning(), AlphaVectorPlanning::Initialize(), and MDPValueIteration::Plan().
|
inline |
Returns the trans. prob for state, joint action, suc state indices.
Definition at line 972 of file PlanningUnitMADPDiscrete.h.
References Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred(), and GetTransitionProbability().
Referenced by ValueFunctionDecPOMDPDiscrete::CalculateVsjohRecursivelyCached(), ValueFunctionDecPOMDPDiscrete::CalculateVsjohRecursivelyNotCached(), AlphaVectorPlanning::ExportPOMDPFile(), GetTransitionProbability(), and MDPValueIteration::PlanSlow().
Index PlanningUnitMADPDiscrete::IndividualToJointActionHistoryIndex | ( | Index | t, |
const std::vector< Index > & | indivIs | ||
) | const |
converts individual history indices to a joint index
This converts a vector of individual observation history indices to a joint observation history index.
Definition at line 2049 of file PlanningUnitMADPDiscrete.cpp.
References GetActionHistoryArrays(), GetJointActionHistoryIndex(), GetNrAgents(), and IndividualToJointActionIndices().
|
inlinevirtual |
Returns the joint action index that corresponds to the array of specified individual action indices.
Implements Interface_ProblemToPolicyDiscrete.
Definition at line 402 of file PlanningUnitMADPDiscrete.h.
References Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred(), and IndividualToJointActionIndices().
Referenced by IndividualToJointActionHistoryIndex(), IndividualToJointActionIndices(), IndividualToJointActionObservationHistoryIndex(), SimulationDecPOMDPDiscrete::RunSimulations(), and IndividualBeliefJESP::Update().
|
inlinevirtual |
Returns the joint action index that corresponds to the vector of specified individual action indices.
Implements Interface_ProblemToPolicyDiscrete.
Definition at line 408 of file PlanningUnitMADPDiscrete.h.
References Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred(), and IndividualToJointActionIndices().
Referenced by IndividualToJointActionIndices().
Index PlanningUnitMADPDiscrete::IndividualToJointActionObservationHistoryIndex | ( | Index | t, |
const std::vector< Index > & | indivIs | ||
) | const |
converts individual history indices to a joint index
This converts a vector of individual observation history indices to a joint observation history index.
Definition at line 2085 of file PlanningUnitMADPDiscrete.cpp.
References GetActionObservationHistoryArrays(), GetJointActionObservationHistoryIndex(), GetNrAgents(), IndividualToJointActionIndices(), and IndividualToJointObservationIndices().
Index PlanningUnitMADPDiscrete::IndividualToJointObservationHistoryIndex | ( | Index | t, |
const std::vector< Index > & | indivIs | ||
) | const |
converts individual history indices to a joint index
This converts a vector of individual observation history indices to a joint observation history index.
Definition at line 2014 of file PlanningUnitMADPDiscrete.cpp.
References GetJointObservationHistoryIndex(), GetNrAgents(), GetObservationHistoryArrays(), and IndividualToJointObservationIndices().
|
inline |
Returns the joint observation index that corresponds to the vector of specified individual observation indices.
Definition at line 438 of file PlanningUnitMADPDiscrete.h.
References Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred(), and IndividualToJointObservationIndices().
Referenced by BGforStageCreation::Fill_joI_Array(), BayesianGameForDecPOMDPStage::Fill_joI_Array(), IndividualToJointActionObservationHistoryIndex(), IndividualToJointObservationHistoryIndex(), IndividualToJointObservationIndices(), and IndividualBeliefJESP::Update().
|
private |
Calls functions to initialize the planning unit.
Definition at line 145 of file PlanningUnitMADPDiscrete.cpp.
References _m_initialized, DEBUG_PUD, Deinitialize(), PlanningUnit::GetHorizon(), Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred(), InitializeActionHistories(), InitializeActionObservationHistories(), InitializeJointActionHistories(), InitializeJointActionObservationHistories(), InitializeJointObservationHistories(), InitializeObservationHistories(), Globals::MAXHORIZON, E::Print(), Print(), and SanityCheck().
Referenced by PlanningUnitMADPDiscrete(), SetHorizon(), SetParams(), and SetProblem().
|
private |
Constructs all possible action histories and puts them in a tree per agent.
Pointers to (the root nodes of) these trees are stored in _m_actionHistoryTreeRootPointers.
Definition at line 503 of file PlanningUnitMADPDiscrete.cpp.
References _m_actionHistoryTreeRootPointers, _m_actionHistoryTreeVectors, _m_firstAHIforT, _m_nrActionHistories, _m_nrActionHistoriesT, _m_params, CreateActionHistoryTree(), PlanningUnitMADPDiscreteParameters::GetComputeIndividualActionHistories(), PlanningUnit::GetHorizon(), MultiAgentDecisionProcessDiscreteInterface::GetNrActions(), GetNrAgents(), and Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred().
Referenced by Initialize().
|
private |
Constructs all possible action-observation histories and puts them in a tree per agent.
Pointers to (the root nodes of) these trees are stored in _m_observationHistoryTreeRootPointers.
Definition at line 842 of file PlanningUnitMADPDiscrete.cpp.
References _m_actionObservationHistoryTreeRootPointers, _m_actionObservationHistoryTreeVectors, _m_firstAOHIforT, _m_nrActionObservationHistories, _m_nrActionObservationHistoriesT, _m_params, CreateActionObservationHistoryTree(), PlanningUnitMADPDiscreteParameters::GetComputeIndividualActionObservationHistories(), PlanningUnit::GetHorizon(), MultiAgentDecisionProcessDiscreteInterface::GetNrActions(), GetNrAgents(), MultiAgentDecisionProcessDiscreteInterface::GetNrObservations(), and Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred().
Referenced by Initialize().
|
private |
Creates all the joint action histories.
The root is stored as _m_jointActionHistoryTreeRoot and all joint action histories are accessible by index through _m_jointActionHistoryTreeVector.
Definition at line 658 of file PlanningUnitMADPDiscrete.cpp.
References _m_firstJAHIforT, _m_jointActionHistoryTreeRoot, _m_jointActionHistoryTreeVector, _m_nrActionHistoriesT, _m_nrJointActionHistories, _m_nrJointActionHistoriesT, _m_params, PlanningUnitMADPDiscreteParameters::GetComputeJointActionHistories(), PlanningUnit::GetHorizon(), GetJointActionHistory, GetNrAgents(), GetNrJointActions(), and JointActionHistory::Print().
Referenced by Initialize().
|
private |
Creates all the joint action-observation histories.
The root is stored as _m_jointActionObservationHistoryTreeRoot and all joint act-obs. histories are accessible by index through _m_jointActionObservationHistoryTreeVector. Depending on _m_params, the joint beliefs should are calculated and stored (and their conditional probabilities).
Definition at line 1012 of file PlanningUnitMADPDiscrete.cpp.
References _m_firstJAOHIforT, _m_jaohConditionalProbs, _m_jaohProbs, _m_jBeliefCache, _m_jointActionObservationHistoryTreeMap, _m_jointActionObservationHistoryTreeRoot, _m_jointActionObservationHistoryTreeVector, _m_nrActionHistoriesT, _m_nrJointActionObservationHistories, _m_nrJointActionObservationHistoriesT, _m_nrObservationHistoriesT, _m_params, PlanningUnitMADPDiscreteParameters::GetComputeJointActionObservationHistories(), PlanningUnitMADPDiscreteParameters::GetComputeJointBeliefs(), PlanningUnit::GetHorizon(), MultiAgentDecisionProcessDiscreteInterface::GetISD(), History::GetLength(), GetNewJointBeliefInterface(), GetNrAgents(), GetNrJointActions(), GetNrJointObservations(), Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred(), JointActionObservationHistory::Print(), JointActionObservationHistoryTree::Print(), prob, BeliefInterface::Set(), JointActionObservationHistoryTree::SetIndex(), JointActionObservationHistoryTree::SetSuccessor(), and JointBeliefInterface::Update().
Referenced by Initialize().
|
private |
Creates all the joint observation histories.
The root is stored as _m_jointObservationHistoryTreeRoot and all joint obs. histories are accessible by index through _m_jointObservationHistoryTreeVector.
Definition at line 382 of file PlanningUnitMADPDiscrete.cpp.
References _m_firstJOHIforT, _m_jointObservationHistoryTreeRoot, _m_jointObservationHistoryTreeVector, _m_nrJointObservationHistories, _m_nrJointObservationHistoriesT, _m_nrObservationHistoriesT, _m_params, PlanningUnitMADPDiscreteParameters::GetComputeJointObservationHistories(), TreeNode< Tcontained >::GetContainedElement(), PlanningUnit::GetHorizon(), History::GetLength(), GetNrAgents(), GetNrJointObservations(), JointObservationHistory::Print(), TreeNode< Tcontained >::Print(), TreeNode< Tcontained >::SetIndex(), and TreeNode< Tcontained >::SetSuccessor().
Referenced by Initialize().
|
private |
Constructs all possible observation histories and puts them in a tree per agent.
Pointers to (the root nodes of) these trees are stored in _m_observationHistoryTreeRootPointers.
Definition at line 201 of file PlanningUnitMADPDiscrete.cpp.
References _m_firstOHIforT, _m_nrObservationHistories, _m_nrObservationHistoriesT, _m_observationHistoryTreeRootPointers, _m_observationHistoryTreeVectors, _m_params, CreateObservationHistoryTree(), PlanningUnitMADPDiscreteParameters::GetComputeIndividualObservationHistories(), PlanningUnit::GetHorizon(), GetNrAgents(), MultiAgentDecisionProcessDiscreteInterface::GetNrObservations(), and Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred().
Referenced by Initialize().
void PlanningUnitMADPDiscrete::JointAOHIndexToIndividualActionObservationVectors | ( | Index | jaohI, |
std::vector< std::vector< Index > > & | indivO_vec, | ||
std::vector< std::vector< Index > > & | indivA_vec | ||
) | const |
computes the vectors of actions and obs.
corresponding to jaohI indivO_vec[agentI][t] = oI
Definition at line 1875 of file PlanningUnitMADPDiscrete.cpp.
References GetJointActionObservationHistoryArrays(), GetNrAgents(), GetTimeStepForJAOHI(), JointToIndividualActionIndices(), and JointToIndividualObservationIndices().
Referenced by JointToIndividualActionObservationHistoryIndices().
void PlanningUnitMADPDiscrete::JointAOHIndexToIndividualActionObservationVectors | ( | Index | jaohI, |
std::vector< std::vector< Index > > & | indivAO_vec | ||
) | const |
computes the vector of action-observations corresponding to jaohI indivAO_vec[agentI][t] = aoI
Definition at line 1865 of file PlanningUnitMADPDiscrete.cpp.
vector< Index > PlanningUnitMADPDiscrete::JointToIndividualActionHistoryIndices | ( | Index | JAHistI | ) | const |
Returns a vector containing the indices of the individual ObservationHistory s corresponding to the JointActionHistory index JAHistI.
This method does not depend on a cached vector. (and thus also works if JointActionHistory s are not generated.
Definition at line 1932 of file PlanningUnitMADPDiscrete.cpp.
const vector< Index > & PlanningUnitMADPDiscrete::JointToIndividualActionHistoryIndicesRef | ( | Index | JAHistI | ) | const |
Returns a reference to a cached vector containing the indices of the indiv.
action histories corresponding to the joint action history index JAHistI. NOTE: The cached vector (of which the reference is returned) is stored in the generated JointActionHistory. If joint action histories are not generated (see PlanningUnitMADPDiscrete constructor), this method will fail.
Definition at line 1939 of file PlanningUnitMADPDiscrete.cpp.
References _m_jointActionHistoryTreeVector, and _m_nrJointActionHistories.
vector< Index > PlanningUnitMADPDiscrete::JointToIndividualActionIndices | ( | Index | jaI | ) | const |
Returns a vector containing the indices of the indiv.
actions corresponding to the joint action jaI.
Definition at line 2237 of file PlanningUnitMADPDiscrete.cpp.
References Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred().
Referenced by AgentPOMDP::Act(), AgentQMDP::Act(), AgentBG::Act(), JointActionObservationHistory::JointActionObservationHistory(), and JointAOHIndexToIndividualActionObservationVectors().
vector< Index > PlanningUnitMADPDiscrete::JointToIndividualActionObservationHistoryIndices | ( | Index | jaohI | ) | const |
Returns a vector containing the indices of the indiv.
act.-obs.history indices corresponding to the joint observation hist. joI.
Definition at line 1911 of file PlanningUnitMADPDiscrete.cpp.
References GetActionObservationHistoryIndex(), GetNrAgents(), GetTimeStepForJAOHI(), and JointAOHIndexToIndividualActionObservationVectors().
Referenced by JointToIndividualPolicyDomainIndices().
const vector< Index > & PlanningUnitMADPDiscrete::JointToIndividualActionObservationHistoryIndicesRef | ( | Index | jaohI | ) | const |
Returns a vector containing the indices of the indiv.
act.-obs.histories corresponding to the joint observation hist. joI.
Definition at line 1844 of file PlanningUnitMADPDiscrete.cpp.
References _m_jointActionObservationHistoryTreeVector, _m_nrJointActionObservationHistories, and JointActionObservationHistoryTree::GetJointActionObservationHistory().
Referenced by JointToIndividualPolicyDomainIndicesRef().
vector< Index > PlanningUnitMADPDiscrete::JointToIndividualObservationHistoryIndices | ( | Index | johI | ) | const |
Returns a vector containing the indices of the indiv.
obs. histories corresponding to the joint observation hist. joI.
Definition at line 1791 of file PlanningUnitMADPDiscrete.cpp.
References GetJointObservationHistoryArrays(), GetNrAgents(), GetObservationHistoryIndex(), GetTimeStepForJOHI(), and JointToIndividualObservationIndices().
Referenced by JointToIndividualPolicyDomainIndices().
const vector< Index > & PlanningUnitMADPDiscrete::JointToIndividualObservationHistoryIndicesRef | ( | Index | johI | ) | const |
Returns a vector containing the indices of the indiv.
obs.histories corresponding to the joint observation hist. joI.
Definition at line 1824 of file PlanningUnitMADPDiscrete.cpp.
References _m_jointObservationHistoryTreeVector, _m_nrJointObservationHistories, and JointObservationHistoryTree::GetJointObservationHistory().
Referenced by JointToIndividualPolicyDomainIndicesRef().
|
inline |
Returns a vector containing the indices of the indiv.
observations corresponding to the joint observation joI.
Definition at line 443 of file PlanningUnitMADPDiscrete.h.
References Referrer< MultiAgentDecisionProcessDiscreteInterface >::GetReferred(), and JointToIndividualObservationIndices().
Referenced by SimulationDecPOMDPDiscrete::GetAction(), JointActionObservationHistory::JointActionObservationHistory(), JointAOHIndexToIndividualActionObservationVectors(), JointToIndividualObservationHistoryIndices(), and JointToIndividualObservationIndices().
|
virtual |
Converts joint indices to individual policy domain element indices.
A function that should be implemented by a derived class, if this derived class caches index vectors of the policy domains elements corresponding to a joint index. See AreCachedJointToIndivIndices()
Implements Interface_ProblemToPolicyDiscrete.
Definition at line 1964 of file PlanningUnitMADPDiscrete.cpp.
References PolicyGlobals::AOHIST_INDEX, JointToIndividualActionObservationHistoryIndices(), JointToIndividualObservationHistoryIndices(), PolicyGlobals::OHIST_INDEX, and PolicyGlobals::TYPE_INDEX.
|
virtual |
Converts individual policy domain element indices to joint indices.
A function that should be implemented by a derived class, if this derived class caches index vectors of the policy domains elements corresponding to a joint index. See AreCachedJointToIndivIndices()
Implements Interface_ProblemToPolicyDiscrete.
Definition at line 1984 of file PlanningUnitMADPDiscrete.cpp.
References PolicyGlobals::AOHIST_INDEX, JointToIndividualActionObservationHistoryIndicesRef(), JointToIndividualObservationHistoryIndicesRef(), PolicyGlobals::OHIST_INDEX, and PolicyGlobals::TYPE_INDEX.
void PlanningUnitMADPDiscrete::Print | ( | ) |
Prints info regarding the planning unit.
Definition at line 2542 of file PlanningUnitMADPDiscrete.cpp.
References PrintTools::PrintVectorCout().
Referenced by Initialize().
void PlanningUnitMADPDiscrete::PrintActionHistories | ( | ) |
Prints the action histories for all agents.
Definition at line 2513 of file PlanningUnitMADPDiscrete.cpp.
References _m_actionHistoryTreeRootPointers, and GetNrAgents().
void PlanningUnitMADPDiscrete::PrintActionObservationHistories | ( | ) |
Prints the actionObservation histories for all agents.
Definition at line 2523 of file PlanningUnitMADPDiscrete.cpp.
References _m_actionObservationHistoryTreeRootPointers, _m_params, PlanningUnitMADPDiscreteParameters::GetComputeIndividualActionObservationHistories(), and GetNrAgents().
void PlanningUnitMADPDiscrete::PrintObservationHistories | ( | ) |
Prints the observation histories for all agents.
Definition at line 2503 of file PlanningUnitMADPDiscrete.cpp.
References _m_observationHistoryTreeRootPointers, and GetNrAgents().
void PlanningUnitMADPDiscrete::RegisterJointActionObservationHistoryTree | ( | JointActionObservationHistoryTree * | jaoht | ) |
Register a new jaoht in the vector of indices.
Definition at line 2849 of file PlanningUnitMADPDiscrete.cpp.
References TreeNode< Tcontained >::GetIndex().
|
protectedvirtual |
Do some sanity checks, can be overridden.
Reimplemented in PlanningUnitDecPOMDPDiscrete.
Definition at line 139 of file PlanningUnitMADPDiscrete.cpp.
Referenced by Initialize().
|
virtual |
Sets the horizon for the planning problem.
Also reinitializes the planning unit.
Reimplemented from PlanningUnit.
Definition at line 123 of file PlanningUnitMADPDiscrete.cpp.
References Deinitialize(), and Initialize().
Referenced by NullPlanner::NullPlanner(), and NullPlannerTOI::NullPlannerTOI().
void PlanningUnitMADPDiscrete::SetParams | ( | const PlanningUnitMADPDiscreteParameters & | params | ) |
Sets the parameters for this planning unit.
Also reinitializes the planning unit.
Definition at line 132 of file PlanningUnitMADPDiscrete.cpp.
References _m_params, Deinitialize(), and Initialize().
Referenced by NullPlanner::NullPlanner(), and NullPlannerTOI::NullPlannerTOI().
void PlanningUnitMADPDiscrete::SetProblem | ( | MultiAgentDecisionProcessDiscreteInterface * | madp | ) |
Sets the problem for which to plan, using a pointer.
Also reinitializes the planning unit.
Definition at line 111 of file PlanningUnitMADPDiscrete.cpp.
References DEBUG_PUD, Deinitialize(), Initialize(), Referrer< MultiAgentDecisionProcessDiscreteInterface >::SetReferred(), and MultiAgentDecisionProcessDiscreteInterface::SoftPrint().
|
virtual |
soft prints action actionI of agent agentI.
Implements Interface_ProblemToPolicyDiscrete.
Definition at line 3012 of file PlanningUnitMADPDiscrete.cpp.
string PlanningUnitMADPDiscrete::SoftPrintObservationHistory | ( | Index | agentI, |
Index | ohIndex | ||
) | const |
soft prints ObservationHistory ohIndex of agent agentI.
Definition at line 2983 of file PlanningUnitMADPDiscrete.cpp.
|
virtual |
Virtual function that has to be implemented by derived class.
This should return a string describing element dIndex of the domain (e.g. an observation history) of agent agentI.
Implements Interface_ProblemToPolicyDiscrete.
Definition at line 2906 of file PlanningUnitMADPDiscrete.cpp.
References PolicyGlobals::AOHIST_INDEX, PolicyGlobals::OHIST_INDEX, and PolicyGlobals::TYPE_INDEX.
|
protected |
A vector that stores pointers to the roots of the action history trees of each agent.
Definition at line 250 of file PlanningUnitMADPDiscrete.h.
Referenced by DeInitializeActionHistories(), InitializeActionHistories(), and PrintActionHistories().
|
protected |
A vector which, for each agents, stores a vector with all ActionHistoryTree pointers.
Used to give access to each ActionHistory(Tree) by index.
Definition at line 255 of file PlanningUnitMADPDiscrete.h.
Referenced by CreateActionHistoryTree(), DeInitializeActionHistories(), GetActionHistoryTree(), and InitializeActionHistories().
|
protected |
A vector that stores pointers to the roots of the action-observation history trees of each agent.
Definition at line 267 of file PlanningUnitMADPDiscrete.h.
Referenced by DeInitializeActionObservationHistories(), InitializeActionObservationHistories(), and PrintActionObservationHistories().
|
protected |
A vector which, for each agents, stores a vector with all ActionObservationHistoryTree pointers.
Used to give access to each ActionObservationHistory(Tree) by index.
Definition at line 274 of file PlanningUnitMADPDiscrete.h.
Referenced by CreateActionObservationHistoryTree(), DeInitializeActionObservationHistories(), GetActionObservationHistoryTree(), and InitializeActionObservationHistories().
|
protected |
The _m_firstAHIforT[aI][t] contains the first action history for time-step t of agent aI.
Definition at line 209 of file PlanningUnitMADPDiscrete.h.
Referenced by CreateActionHistoryTree(), DeInitializeActionHistories(), and InitializeActionHistories().
|
protected |
The _m_firstAOHIforT[aI][t] contains the first actionObservation history for time-step t of agent aI.
Definition at line 226 of file PlanningUnitMADPDiscrete.h.
Referenced by CreateActionObservationHistoryTree(), DeInitializeActionObservationHistories(), GetActionObservationHistoryIndex(), and InitializeActionObservationHistories().
|
protected |
The _m_firstJAHIforT[t] contains the first joint action history for time-step t.
Definition at line 212 of file PlanningUnitMADPDiscrete.h.
Referenced by DeInitializeJointActionHistories(), GetJointActionHistoryIndex(), and InitializeJointActionHistories().
|
protected |
_m_firstJAOHIforT[t] contains the first joint actionObservation history for time-step t.
Definition at line 229 of file PlanningUnitMADPDiscrete.h.
Referenced by DeInitializeJointActionObservationHistories(), GetFirstJointActionObservationHistoryIndex(), GetJointActionObservationHistoryIndex(), and InitializeJointActionObservationHistories().
|
protected |
The _m_firstJOHIforT[t] contains the first joint observation history for time-step t.
Definition at line 195 of file PlanningUnitMADPDiscrete.h.
Referenced by DeInitializeJointObservationHistories(), GetFirstJointObservationHistoryIndex(), GetJointObservationHistoryIndex(), and InitializeJointObservationHistories().
|
protected |
The _m_firstOHIforT[aI][t] contains the first observation history for time-step t of agent aI.
Definition at line 192 of file PlanningUnitMADPDiscrete.h.
Referenced by CreateObservationHistoryTree(), DeInitializeObservationHistories(), GetFirstObservationHistoryIndex(), GetObservationHistoryIndex(), and InitializeObservationHistories().
|
private |
A bool indicating whether this Planning unit has been initialized.
Definition at line 81 of file PlanningUnitMADPDiscrete.h.
Referenced by Deinitialize(), Initialize(), and PlanningUnitMADPDiscrete().
|
protected |
Stores the conditional probability of this joint belief.
Definition at line 300 of file PlanningUnitMADPDiscrete.h.
Referenced by DeInitializeJointActionObservationHistories(), GetJAOHProbGivenPred(), and InitializeJointActionObservationHistories().
|
protected |
Caches the probabilities of JointActionObservationHistory's (assuming b^0 is as specified by the problem and that a pure joint policy consistent with the i-th JointActionObservationHistory is followed).
I.e., _m_jaohProbsCache[k] = P( jaohI=k | prevJPol, b^0 )
Definition at line 307 of file PlanningUnitMADPDiscrete.h.
Referenced by GetJAOHProbs(), and InitializeJointActionObservationHistories().
|
protected |
_m_jBeliefCache[i] stores a pointer to the joint belief corresponding to the i-th JointActionObservationHistory (assuming b^0 is as specified by the problem and that a pure joint policy consistent with the i-th JointActionObservationHistory is followed)
Definition at line 298 of file PlanningUnitMADPDiscrete.h.
Referenced by DeInitializeJointActionObservationHistories(), GetJAOHProbs(), GetJointBeliefInterface(), and InitializeJointActionObservationHistories().
|
protected |
The root node of the joint action histories tree.
Definition at line 257 of file PlanningUnitMADPDiscrete.h.
Referenced by DeInitializeJointActionHistories(), and InitializeJointActionHistories().
|
protected |
A vector which stores a JointActionHistoryTree pointer.
Used to give access to the all JointActionHistoryTree by index.
Definition at line 262 of file PlanningUnitMADPDiscrete.h.
Referenced by DeInitializeJointActionHistories(), GetJointActionHistoryIndex(), GetJointActionHistoryTree(), GetNrJointActionHistories(), InitializeJointActionHistories(), and JointToIndividualActionHistoryIndicesRef().
|
protected |
A map which is used instead of _m_jointActionObservationHistoryTreeVector when we don't cache all JointActionObservationHistoryTree's.
Definition at line 290 of file PlanningUnitMADPDiscrete.h.
Referenced by DeInitializeJointActionObservationHistories(), and InitializeJointActionObservationHistories().
|
protected |
The root node of the joint actionObservation histories tree.
Definition at line 278 of file PlanningUnitMADPDiscrete.h.
Referenced by DeInitializeJointActionObservationHistories(), and InitializeJointActionObservationHistories().
|
protected |
A vector which stores JointActionObservationHistoryTree pointer.
Used to give access to the all JointActionObservationHistoryTree by index.
Definition at line 284 of file PlanningUnitMADPDiscrete.h.
Referenced by DeInitializeJointActionObservationHistories(), GetJointActionObservationHistoryIndex(), InitializeJointActionObservationHistories(), and JointToIndividualActionObservationHistoryIndicesRef().
|
protected |
The root node of the joint observation histories tree.
Definition at line 241 of file PlanningUnitMADPDiscrete.h.
Referenced by DeInitializeJointObservationHistories(), and InitializeJointObservationHistories().
|
protected |
A vector which stores a JointObservationHistoryTree pointer.
Used to give access to the all JointObservationHistoryTree by index.
Definition at line 246 of file PlanningUnitMADPDiscrete.h.
Referenced by DeInitializeJointObservationHistories(), GetJointObservationHistoryIndex(), GetJointObservationHistoryTree(), InitializeJointObservationHistories(), and JointToIndividualObservationHistoryIndicesRef().
|
protected |
A vector that keeps track of the number of action histories per agent.
Definition at line 199 of file PlanningUnitMADPDiscrete.h.
Referenced by CreateActionHistoryTree(), DeInitializeActionHistories(), GetNrActionHistories(), and InitializeActionHistories().
|
protected |
A vector that keeps track of the number of action histories per agent per time step.
_m_nrActionHistoriesT[agentI][t]
Definition at line 204 of file PlanningUnitMADPDiscrete.h.
Referenced by CreateActionHistoryTree(), CreateActionObservationHistoryTree(), DeInitializeActionHistories(), InitializeActionHistories(), InitializeJointActionHistories(), and InitializeJointActionObservationHistories().
|
protected |
A vector that keeps track of the number of action-obs.
histories per agent.
Definition at line 216 of file PlanningUnitMADPDiscrete.h.
Referenced by CreateActionObservationHistoryTree(), DeInitializeActionObservationHistories(), GetNrActionObservationHistories(), and InitializeActionObservationHistories().
|
protected |
Keeps track of the number of action-obs.
histories per agent per time step. _m_nrActionObservationHistoriesT[agentI][t]
Definition at line 221 of file PlanningUnitMADPDiscrete.h.
Referenced by CreateActionObservationHistoryTree(), DeInitializeActionObservationHistories(), and InitializeActionObservationHistories().
|
protected |
The number of joint action histories.
Definition at line 201 of file PlanningUnitMADPDiscrete.h.
Referenced by DeInitializeJointActionHistories(), GetJointActionHistoryIndex(), GetJointActionHistoryTree(), InitializeJointActionHistories(), and JointToIndividualActionHistoryIndicesRef().
|
protected |
The number of joint action histories per time-step.
Definition at line 206 of file PlanningUnitMADPDiscrete.h.
Referenced by DeInitializeJointActionHistories(), and InitializeJointActionHistories().
|
protected |
The number of joint actionAction histories.
Definition at line 218 of file PlanningUnitMADPDiscrete.h.
Referenced by DeInitializeJointActionObservationHistories(), GetJointActionObservationHistoryIndex(), GetNrJointActionObservationHistories(), InitializeJointActionObservationHistories(), and JointToIndividualActionObservationHistoryIndicesRef().
|
protected |
The number of joint actionObservation histories per time-step.
Definition at line 223 of file PlanningUnitMADPDiscrete.h.
Referenced by DeInitializeJointActionObservationHistories(), and InitializeJointActionObservationHistories().
|
protected |
The number of joint observation histories.
Definition at line 184 of file PlanningUnitMADPDiscrete.h.
Referenced by DeInitializeJointObservationHistories(), GetJointObservationHistoryIndex(), GetJointObservationHistoryTree(), GetNrJointObservationHistories(), InitializeJointObservationHistories(), and JointToIndividualObservationHistoryIndicesRef().
|
protected |
The number of joint observation histories per time-step.
Definition at line 189 of file PlanningUnitMADPDiscrete.h.
Referenced by DeInitializeJointObservationHistories(), GetNrJointObservationHistories(), and InitializeJointObservationHistories().
|
protected |
A vector that keeps track of the number of observation histories per agent.
Definition at line 182 of file PlanningUnitMADPDiscrete.h.
Referenced by CreateObservationHistoryTree(), DeInitializeObservationHistories(), GetNrObservationHistories(), and InitializeObservationHistories().
|
protected |
Keeps track of the number of observation histories per agent per time step.
_m_nrObservationHistoriesT[agentI][t]
Definition at line 187 of file PlanningUnitMADPDiscrete.h.
Referenced by CreateObservationHistoryTree(), DeInitializeObservationHistories(), GetNrObservationHistories(), InitializeJointActionObservationHistories(), InitializeJointObservationHistories(), and InitializeObservationHistories().
|
protected |
A vector that stores pointers to the roots of the observation history trees of each agent.
Definition at line 235 of file PlanningUnitMADPDiscrete.h.
Referenced by DeInitializeObservationHistories(), InitializeObservationHistories(), and PrintObservationHistories().
|
protected |
A vector which, for each agents, stores a vector with all ObservationHistoryTree pointers.
Used to give access to each ObservationHistory(Tree) by index.
Definition at line 239 of file PlanningUnitMADPDiscrete.h.
Referenced by CreateObservationHistoryTree(), DeInitializeObservationHistories(), GetObservationHistoryTree(), and InitializeObservationHistories().
|
private |
The parameters for this planning unit.
Definition at line 84 of file PlanningUnitMADPDiscrete.h.
Referenced by DeInitializeJointActionObservationHistories(), GetJAOHProbGivenPred(), GetJAOHProbs(), GetJointBeliefInterface(), GetObservationHistoryTree(), GetParams(), InitializeActionHistories(), InitializeActionObservationHistories(), InitializeJointActionHistories(), InitializeJointActionObservationHistories(), InitializeJointObservationHistories(), InitializeObservationHistories(), PlanningUnitMADPDiscrete(), PrintActionObservationHistories(), and SetParams().