MultiAgentDecisionProcess
|
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::PolicyDomainCategory pdc) const |
Check whether certain index conversions are cached. More... | |
void | ComputeHistoryArrays (Index hI, Index t, Index t_offset, Index Indices[], size_t indexDomainSize) const |
This function computes the indices of the sequence corr. More... | |
Index | ComputeHistoryIndex (Index t, Index t_offset, const Index indices[], size_t indexDomainSize) const |
This function computes the index of a history. More... | |
void | ExportDotGraph (const std::string &filename, const PolicyDiscretePure &policy, Index agentI, bool labelEdges=true) const |
Export a policy in dot format (from the GraphViz tools). More... | |
const Action * | GetAction (Index agentI, Index a) const |
Returns a ref to the a-th action of agent agentI. More... | |
void | GetActionHistoryArrays (Index agentI, Index ahI, Index t, Index aIs[]) const |
Computes the joint actions for jahI. More... | |
ActionHistoryTree * | GetActionHistoryTree (Index agentI, Index ohI) const |
Returns a pointer to action history# ohI of agent# agentI. More... | |
void | GetActionObservationHistoryArrays (Index agentI, Index aohI, Index t, Index aIs[], Index oIs[]) const |
Computes the joint actions and observations for aohI. More... | |
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. More... | |
ActionObservationHistoryTree * | GetActionObservationHistoryTree (Index agentI, Index aohI) const |
Returns a pointer to observation history# ohI of agent# agentI. More... | |
virtual PolicyGlobals::PolicyDomainCategory | GetDefaultIndexDomCat () const |
Return the default PolicyDomainCategory for the problem. More... | |
LIndex | GetFirstJointActionObservationHistoryIndex (Index ts) const |
Returns the index of the first joint action observation history of time step ts. More... | |
LIndex | GetFirstJointObservationHistoryIndex (Index ts) const |
Returns the index of the first joint observation history of time step ts. More... | |
LIndex | GetFirstObservationHistoryIndex (Index agI, Index ts) const |
Returns the index of the first ts observation history of agent agI. More... | |
double | GetInitialStateProbability (Index sI) const |
Returns the probability of a state in the initial state distribution. More... | |
double | GetJAOHProb (LIndex jaohI, Index p_jaohI=0, const JointBeliefInterface *p_jb=NULL, const JointPolicyDiscrete *jpol=NULL) const |
returns the probability of jaohI. More... | |
double | GetJAOHProbGivenPred (LIndex 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). More... | |
double | GetJAOHProbs (JointBeliefInterface *jb, LIndex jaohI, LIndex 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) More... | |
double | GetJAOHProbsRecursively (JointBeliefInterface *jb, const Index jaIs[], const Index joIs[], Index t_p, Index t, LIndex p_jaohI=0, const JointPolicyDiscrete *jpol=NULL) const |
the function that perfoms most of the work, called by GetJAOHProbs. More... | |
const JointAction * | GetJointAction (Index jaI) const |
Returns a ref to the i-th joint action. More... | |
Index | GetJointActionHistoryIndex (Index t, const std::vector< Index > &jointActions) const |
converts the vector joint observations of length t to a JointObservationHistory Index. More... | |
Index | GetJointActionHistoryIndex (Index t, const Index jointActions[]) const |
converts the vector joint observations of length t to a JointObservationHistory Index. More... | |
Index | GetJointActionHistoryIndex (JointActionHistoryTree *joh) const |
Returns the index of a JointActionHistoryTree pointer. More... | |
JointActionHistoryTree * | GetJointActionHistoryTree (Index jahI) const |
Returns a pointer to joint action history#. More... | |
void | GetJointActionObservationHistoryArrays (LIndex jaohI, Index t, Index jaIs[], Index joIs[]) const |
Computes the joint actions and observations for jaohI. More... | |
LIndex | GetJointActionObservationHistoryIndex (JointActionObservationHistoryTree *jaoh) const |
Returns the index of a JointActionObservationHistoryTree pointer. More... | |
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. More... | |
Index | GetJointActionObservationHistoryIndex (Index t, const std::vector< Index > &Jactions, const std::vector< Index > &Jobservations, const Scope &agentSope) const |
like GetJointActionObservationHistoryIndex, but works on a subset of agents. More... | |
JointActionObservationHistoryTree * | GetJointActionObservationHistoryTree (LIndex jaohI) const |
Returns a pointer to JointActionObservation history#. More... | |
void | GetJointActionObservationHistoryVectors (LIndex jaohI, std::vector< Index > &jaIs, std::vector< Index > &joIs) const |
returns the vectors with joint actions and observations for JointActionObservationHistory jaohi. More... | |
JointBeliefInterface * | GetJointBeliefInterface (LIndex jaohI) const |
brief Returns a pointer to a new joint belief. More... | |
const JointObservation * | GetJointObservation (Index joI) const |
Returns a ref to the joI-th joint observation. More... | |
void | GetJointObservationHistoryArrays (Index johI, Index t, Index joIs[]) const |
Computes the joint observations for johI. More... | |
Index | GetJointObservationHistoryIndex (JointObservationHistoryTree *joh) const |
Returns the index of a JointObservationHistoryTree pointer. More... | |
Index | GetJointObservationHistoryIndex (Index t, const std::vector< Index > &jointObservations) const |
converts the vector joint observations of length t to a JointObservationHistory Index. More... | |
Index | GetJointObservationHistoryIndex (Index t, const Index jointObservations[]) const |
converts the vector joint observations of length t to a JointObservationHistory Index. More... | |
JointObservationHistoryTree * | GetJointObservationHistoryTree (Index johI) const |
Returns a pointer to joint observation history#. More... | |
MultiAgentDecisionProcessDiscreteInterface * | GetMADPDI () |
const MultiAgentDecisionProcessDiscreteInterface * | GetMADPDI () const |
JointBeliefInterface * | GetNewJointBeliefFromISD () const |
Returns a new joint belief with the value of the initial state distribution. More... | |
virtual JointBeliefInterface * | GetNewJointBeliefInterface () const |
a function that forces derives classes to specify which types of joint beliefs are used. More... | |
virtual JointBeliefInterface * | GetNewJointBeliefInterface (size_t size) const |
size_t | GetNrActionHistories (Index agentI) const |
Returns the number of action histories for agentI. More... | |
size_t | GetNrActionHistories (Index agentI, Index ts) const |
Returns the number of action histories for agentI for time step ts. More... | |
size_t | GetNrActionObservationHistories (Index agentI) const |
Returns the number of action observation histories for agentI. More... | |
const std::vector< size_t > & | GetNrActions () const |
Returns the number of actions vector. More... | |
size_t | GetNrActions (Index agentI) const |
Returns the number of actions of agent agentI. More... | |
size_t | GetNrAgents () const |
Gets the number of agents. More... | |
size_t | GetNrJointActionHistories () const |
Returns the number of joint action histories. More... | |
size_t | GetNrJointActionObservationHistories () const |
Returns the number of jointActionObservation histories. More... | |
size_t | GetNrJointActions () const |
return the number of joint actions. More... | |
size_t | GetNrJointObservationHistories () const |
Returns the number of joint observation histories. More... | |
size_t | GetNrJointObservationHistories (Index ts) const |
Returns the number of joint observation histories for time step ts. More... | |
size_t | GetNrJointObservations () const |
Returns the number of joint observations. More... | |
LIndex | GetNrJointPolicies () const |
Returns the number of joint policies. More... | |
size_t | GetNrObservationHistories (Index agentI) const |
Returns the number of observation histories for agentI. More... | |
size_t | GetNrObservationHistories (Index agentI, Index ts) const |
Returns the number of observation histories for agentI for time step ts. More... | |
const std::vector< size_t > | GetNrObservationHistoriesVector () const |
Returns a vector with the number of OHs for each agent. More... | |
const std::vector< size_t > | GetNrObservationHistoriesVector (Index ts) const |
Returns a vector with the number of OHs in stage ts for each agent. More... | |
const std::vector< size_t > & | GetNrObservations () const |
Returns the number of observations vector. More... | |
size_t | GetNrObservations (Index agentI) const |
Returns the number of observations of agent agentI. More... | |
LIndex | GetNrPolicies (Index agentI) const |
Returns the number of policies for agentI. More... | |
size_t | GetNrPolicyDomainElements (Index agentI, PolicyGlobals::PolicyDomainCategory cat, size_t depth=MAXHORIZON) const |
Get the number of elements in the domain of an agent's policy. More... | |
size_t | GetNrStates () const |
Returns the number of states. More... | |
const Observation * | GetObservation (Index agentI, Index o) const |
Returns a ref to the o-th observation of agent agentI. More... | |
void | GetObservationHistoryArrays (Index agentI, Index ohI, Index t, Index oIs[]) const |
Computes the observations for ohI. More... | |
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. More... | |
ObservationHistoryTree * | GetObservationHistoryTree (Index agentI, Index ohI) const |
Returns a pointer to observation history# ohI of agent# agentI. More... | |
const ObservationModelDiscrete * | GetObservationModelDiscretePtr () const |
double | GetObservationProbability (Index jaI, Index sucSI, Index joI) const |
Returns P(joI | jaI, sucSI ). Arguments are time-ordered. More... | |
const PlanningUnitMADPDiscreteParameters & | GetParams () const |
Get the parameters for this planning unit. More... | |
const MultiAgentDecisionProcessDiscreteInterface * | GetProblem () const |
Returns a reference to the problem of the PlanningUnitMADPDiscrete. More... | |
MultiAgentDecisionProcessDiscreteInterface * | GetProblem () |
const State * | GetState (Index i) const |
Get a pointer to a State by index. More... | |
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. More... | |
Index | GetSuccessorJAHI (Index johI, Index joI) const |
LIndex | GetSuccessorJAOHI (LIndex 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. More... | |
Index | GetSuccessorJOHI (Index johI, Index joI) const |
Returns the index of the successor of observation history johI via joint observation joI. More... | |
Index | GetSuccessorOHI (Index agentI, Index ohI, Index oI) const |
Returns the index of the successor of observation history ohI of agentI via observation joI. More... | |
Index | GetTimeStepForAHI (Index agentI, Index ohI) const |
Returns the time step of observation history ohI. More... | |
Index | GetTimeStepForAOHI (Index agentI, Index aohI) const |
Returns the time step of joint action-observation historyaohI. More... | |
Index | GetTimeStepForJAHI (Index johI) const |
Returns the time step of joint observation history johI. More... | |
Index | GetTimeStepForJAOHI (LIndex jaohI) const |
Returns the time step of joint action-observation historyjaohI. More... | |
Index | GetTimeStepForJOHI (Index johI) const |
Returns the time step of joint observation history johI. More... | |
Index | GetTimeStepForOHI (Index agentI, Index ohI) const |
Returns the time step of observation history ohI. More... | |
const TransitionModelDiscrete * | GetTransitionModelDiscretePtr () const |
double | GetTransitionProbability (Index sI, Index jaI, Index sucSI) const |
Returns the trans. prob for state, joint action, suc state indices. More... | |
Index | IndividualToJointActionHistoryIndex (Index t, const std::vector< Index > &indivIs) const |
converts individual history indices to a joint index More... | |
Index | IndividualToJointActionIndices (const Index *indivActionIndices) const |
Returns the joint action index that corresponds to the array of specified individual action indices. More... | |
Index | IndividualToJointActionIndices (const std::vector< Index > &indivActionIndices) const |
Returns the joint action index that corresponds to the vector of specified individual action indices. More... | |
LIndex | IndividualToJointActionObservationHistoryIndex (Index t, const std::vector< Index > &indivIs) const |
converts individual history indices to a joint index More... | |
Index | IndividualToJointObservationHistoryIndex (Index t, const std::vector< Index > &indivIs) const |
converts individual history indices to a joint index More... | |
Index | IndividualToJointObservationIndices (const std::vector< Index > &inObs) const |
Returns the joint observation index that corresponds to the vector of specified individual observation indices. More... | |
void | JointAOHIndexToIndividualActionObservationVectors (LIndex jaohI, std::vector< std::vector< Index > > &indivO_vec, std::vector< std::vector< Index > > &indivA_vec) const |
computes the vectors of actions and obs. More... | |
void | JointAOHIndexToIndividualActionObservationVectors (LIndex jaohI, std::vector< std::vector< Index > > &indivAO_vec) const |
computes the vector of action-observations corresponding to jaohI indivAO_vec[agentI][t] = aoI More... | |
std::vector< Index > | JointToIndividualActionHistoryIndices (Index JAHistI) const |
Returns a vector containing the indices of the individual ObservationHistory s corresponding to the JointActionHistory index JAHistI. More... | |
const std::vector< Index > & | JointToIndividualActionHistoryIndicesRef (Index JAHistI) const |
Returns a reference to a cached vector containing the indices of the indiv. More... | |
std::vector< Index > | JointToIndividualActionIndices (Index jaI) const |
Returns a vector containing the indices of the indiv. More... | |
std::vector< Index > | JointToIndividualActionObservationHistoryIndices (LIndex jaohI) const |
Returns a vector containing the indices of the indiv. More... | |
const std::vector< Index > & | JointToIndividualActionObservationHistoryIndicesRef (LIndex jaohI) const |
Returns a vector containing the indices of the indiv. More... | |
std::vector< Index > | JointToIndividualObservationHistoryIndices (Index johI) const |
Returns a vector containing the indices of the indiv. More... | |
const std::vector< Index > & | JointToIndividualObservationHistoryIndicesRef (Index johI) const |
Returns a vector containing the indices of the indiv. More... | |
std::vector< Index > | JointToIndividualObservationIndices (Index joI) const |
Returns a vector containing the indices of the indiv. More... | |
std::vector< Index > | JointToIndividualPolicyDomainIndices (Index jdI, PolicyGlobals::PolicyDomainCategory cat) const |
Converts joint indices to individual policy domain element indices. More... | |
const std::vector< Index > & | JointToIndividualPolicyDomainIndicesRef (Index jdI, PolicyGlobals::PolicyDomainCategory cat) const |
Converts individual policy domain element indices to joint indices. More... | |
PlanningUnitMADPDiscrete (size_t horizon=3, MultiAgentDecisionProcessDiscreteInterface *p=0, const PlanningUnitMADPDiscreteParameters *params=0) | |
Constructor with specified parameters. More... | |
PlanningUnitMADPDiscrete (size_t horizon=3, MultiAgentDecisionProcessDiscreteInterface *p=0) | |
Constructor with default parameters. DEPRECATED?: More... | |
std::string | PolicyToDotGraph (const PolicyDiscretePure &policy, Index agentI, bool labelEdges=true) const |
Convert a policy to dot format (from the GraphViz tools). More... | |
void | Print () |
Prints info regarding the planning unit. More... | |
void | PrintActionHistories () |
Prints the action histories for all agents. More... | |
void | PrintActionObservationHistories () |
Prints the actionObservation histories for all agents. More... | |
void | PrintObservationHistories () |
Prints the observation histories for all agents. More... | |
void | RegisterJointActionObservationHistoryTree (JointActionObservationHistoryTree *jaoht) |
Register a new jaoht in the vector of indices. More... | |
void | SetHorizon (size_t h) |
Sets the horizon for the planning problem. More... | |
void | SetParams (const PlanningUnitMADPDiscreteParameters ¶ms) |
Sets the parameters for this planning unit. More... | |
void | SetProblem (MultiAgentDecisionProcessDiscreteInterface *madp) |
Sets the problem for which to plan, using a pointer. More... | |
std::string | SoftPrintAction (Index agentI, Index actionI) const |
soft prints action actionI of agent agentI. More... | |
std::string | SoftPrintObservationHistory (Index agentI, Index ohIndex) const |
soft prints ObservationHistory ohIndex of agent agentI. More... | |
std::string | SoftPrintPolicyDomainElement (Index agentI, Index dI, PolicyGlobals::PolicyDomainCategory cat) const |
Virtual function that has to be implemented by derived class. More... | |
~PlanningUnitMADPDiscrete () | |
Destructor. More... | |
Public Member Functions inherited from PlanningUnit | |
size_t | GetHorizon () const |
Returns the planning horizon. More... | |
virtual boost::shared_ptr < JointPolicy > | GetJointPolicy ()=0 |
Returns a pointer to the computed joint policy. More... | |
Index | GetNextAgentIndex () |
Maintains a agent index and returns the next one on calling */. More... | |
size_t | GetNrAgents () const |
Return the number of agents. More... | |
const MultiAgentDecisionProcessInterface * | GetProblem () const |
Get the problem pointer. More... | |
int | GetSeed () const |
Returns the random seed stored. More... | |
void | InitSeed () const |
Initializes the random number generator (srand) to the stored seed. More... | |
virtual void | Plan ()=0 |
The function that performs the actual planning. More... | |
PlanningUnit (size_t horizon, MultiAgentDecisionProcessInterface *p) | |
(default) Constructor More... | |
void | SetProblem (MultiAgentDecisionProcessInterface *p) |
Updates the problem pointer. More... | |
void | SetSeed (int s) |
Stores the random seed and calls InitSeed(). More... | |
virtual | ~PlanningUnit () |
Destructor. More... | |
Public Member Functions inherited from Interface_ProblemToPolicyDiscretePure | |
LIndex | GetNrJointPolicies (PolicyGlobals::PolicyDomainCategory cat, size_t depth=MAXHORIZON) const |
Get the number of joint policies, given the policy's domain. More... | |
LIndex | GetNrPolicies (Index ag, PolicyGlobals::PolicyDomainCategory cat, size_t depth=MAXHORIZON) const |
Get the number of policies for an agent, given the policy's domain. More... | |
virtual | ~Interface_ProblemToPolicyDiscretePure () |
Destructor. More... | |
Public Member Functions inherited from Interface_ProblemToPolicyDiscrete | |
size_t | GetNrJointActions () const |
Get the number of joint actions. More... | |
Interface_ProblemToPolicyDiscrete () | |
(default) Constructor More... | |
virtual | ~Interface_ProblemToPolicyDiscrete () |
Destructor. More... | |
Protected Member Functions | |
virtual bool | SanityCheck () const |
Do some sanity checks, can be overridden. More... | |
Protected Attributes | |
std::vector< ActionHistoryTree * > | _m_actionHistoryTreeRootPointers |
A vector that stores pointers to the roots of the action history trees of each agent. More... | |
std::vector< std::vector < ActionHistoryTree * > > | _m_actionHistoryTreeVectors |
A vector which, for each agents, stores a vector with all ActionHistoryTree pointers. More... | |
std::vector < ActionObservationHistoryTree * > | _m_actionObservationHistoryTreeRootPointers |
A vector that stores pointers to the roots of the action-observation history trees of each agent. More... | |
std::vector< std::vector < ActionObservationHistoryTree * > > | _m_actionObservationHistoryTreeVectors |
A vector which, for each agents, stores a vector with all ActionObservationHistoryTree pointers. More... | |
std::vector< std::vector < LIndex > > | _m_firstAHIforT |
The _m_firstAHIforT[aI][t] contains the first action history for time-step t of agent aI. More... | |
std::vector< std::vector < LIndex > > | _m_firstAOHIforT |
The _m_firstAOHIforT[aI][t] contains the first actionObservation history for time-step t of agent aI. More... | |
std::vector< LIndex > | _m_firstJAHIforT |
The _m_firstJAHIforT[t] contains the first joint action history for time-step t. More... | |
std::vector< LIndex > | _m_firstJAOHIforT |
_m_firstJAOHIforT[t] contains the first joint actionObservation history for time-step t. More... | |
std::vector< LIndex > | _m_firstJOHIforT |
The _m_firstJOHIforT[t] contains the first joint observation history for time-step t. More... | |
std::vector< std::vector < LIndex > > | _m_firstOHIforT |
The _m_firstOHIforT[aI][t] contains the first observation history for time-step t of agent aI. More... | |
std::vector< double > | _m_jaohConditionalProbs |
Stores the conditional probability of this joint belief. More... | |
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). More... | |
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) More... | |
JointActionHistoryTree * | _m_jointActionHistoryTreeRoot |
The root node of the joint action histories tree. More... | |
std::vector < JointActionHistoryTree * > | _m_jointActionHistoryTreeVector |
A vector which stores a JointActionHistoryTree pointer. More... | |
std::map< LIndex, JointActionObservationHistoryTree * > | _m_jointActionObservationHistoryTreeMap |
A map which is used instead of _m_jointActionObservationHistoryTreeVector when we don't cache all JointActionObservationHistoryTree's. More... | |
JointActionObservationHistoryTree * | _m_jointActionObservationHistoryTreeRoot |
The root node of the joint actionObservation histories tree. More... | |
std::vector < JointActionObservationHistoryTree * > | _m_jointActionObservationHistoryTreeVector |
A vector which stores JointActionObservationHistoryTree pointer. More... | |
JointObservationHistoryTree * | _m_jointObservationHistoryTreeRoot |
The root node of the joint observation histories tree. More... | |
std::vector < JointObservationHistoryTree * > | _m_jointObservationHistoryTreeVector |
A vector which stores a JointObservationHistoryTree pointer. More... | |
std::vector< size_t > | _m_nrActionHistories |
A vector that keeps track of the number of action histories per agent. More... | |
std::vector< std::vector < size_t > > | _m_nrActionHistoriesT |
A vector that keeps track of the number of action histories per agent per time step. More... | |
std::vector< size_t > | _m_nrActionObservationHistories |
A vector that keeps track of the number of action-obs. More... | |
std::vector< std::vector < size_t > > | _m_nrActionObservationHistoriesT |
Keeps track of the number of action-obs. More... | |
size_t | _m_nrJointActionHistories |
The number of joint action histories. More... | |
std::vector< size_t > | _m_nrJointActionHistoriesT |
The number of joint action histories per time-step. More... | |
size_t | _m_nrJointActionObservationHistories |
The number of joint actionAction histories. More... | |
std::vector< size_t > | _m_nrJointActionObservationHistoriesT |
The number of joint actionObservation histories per time-step. More... | |
size_t | _m_nrJointObservationHistories |
The number of joint observation histories. More... | |
std::vector< size_t > | _m_nrJointObservationHistoriesT |
The number of joint observation histories per time-step. More... | |
std::vector< size_t > | _m_nrObservationHistories |
A vector that keeps track of the number of observation histories per agent. More... | |
std::vector< std::vector < size_t > > | _m_nrObservationHistoriesT |
Keeps track of the number of observation histories per agent per time step. More... | |
std::vector < ObservationHistoryTree * > | _m_observationHistoryTreeRootPointers |
A vector that stores pointers to the roots of the observation history trees of each agent. More... | |
std::vector< std::vector < ObservationHistoryTree * > > | _m_observationHistoryTreeVectors |
A vector which, for each agents, stores a vector with all ObservationHistoryTree pointers. More... | |
Private Member Functions | |
ActionHistoryTree * | CreateActionHistoryTree (Index agentI) |
Breadth-first construction of the action histories and action history tree for agent agentI. More... | |
ActionObservationHistoryTree * | CreateActionObservationHistoryTree (Index agentI) |
Breadth-first construction of the action-observation histories and action-obs. More... | |
ObservationHistoryTree * | CreateObservationHistoryTree (Index agentI) |
Breadth-first construction of the observation histories and obs. More... | |
void | Deinitialize () |
Cleans up and releases allocated memory. More... | |
void | DeInitializeActionHistories () |
Deletes all ActionHistories(Trees) - used on reinitialization. More... | |
void | DeInitializeActionObservationHistories () |
Deletes all ActionObservationHistories(Trees) - used on reinitialization. More... | |
void | DeInitializeJointActionHistories () |
Deletes all joint action histories. More... | |
void | DeInitializeJointActionObservationHistories () |
Deletes all joint action-observation histories. More... | |
void | DeInitializeJointObservationHistories () |
Deletes all joint observation histories. More... | |
void | DeInitializeObservationHistories () |
Deletes all ObservationHistories(Trees) - used on reinitialization. More... | |
void | Initialize () |
Calls functions to initialize the planning unit. More... | |
void | InitializeActionHistories () |
Constructs all possible action histories and puts them in a tree per agent. More... | |
void | InitializeActionObservationHistories () |
Constructs all possible action-observation histories and puts them in a tree per agent. More... | |
void | InitializeJointActionHistories () |
Creates all the joint action histories. More... | |
void | InitializeJointActionObservationHistories () |
Creates all the joint action-observation histories. More... | |
void | InitializeJointObservationHistories () |
Creates all the joint observation histories. More... | |
void | InitializeObservationHistories () |
Constructs all possible observation histories and puts them in a tree per agent. More... | |
Private Attributes | |
bool | _m_initialized |
A bool indicating whether this Planning unit has been initialized. More... | |
MultiAgentDecisionProcessDiscreteInterface * | _m_madp |
PlanningUnitMADPDiscreteParameters | _m_params |
The parameters for this planning unit. More... | |
PlanningUnitMADPDiscrete represents a Planning unit for a discrete MADP (discrete actions, observations and states).
PlanningUnitMADPDiscrete::PlanningUnitMADPDiscrete | ( | size_t | horizon = 3 , |
MultiAgentDecisionProcessDiscreteInterface * | p = 0 , |
||
const PlanningUnitMADPDiscreteParameters * | params = 0 |
||
) |
Constructor with specified parameters.
Allows for specification of the planning horizon and a pointer to the problem instance.
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. DEPRECATED?:
DEPRECATED?:
Allows for specification of the planning horizon and a pointer to the problem instance. See PlanningUnitMADPDiscreteParameters for the default settings.
References _m_initialized, _m_params, DEBUG_PU_CONSTRUCTORS, Initialize(), and PlanningUnitMADPDiscreteParameters::SetComputeAll().
PlanningUnitMADPDiscrete::~PlanningUnitMADPDiscrete | ( | ) |
Destructor.
References Deinitialize().
|
virtual |
Check whether certain index conversions are cached.
Implements Interface_ProblemToPolicyDiscrete.
References _m_params, PolicyGlobals::AOHIST_INDEX, PlanningUnitMADPDiscreteParameters::GetComputeJointActionObservationHistories(), PlanningUnitMADPDiscreteParameters::GetComputeJointObservationHistories(), 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.
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.
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).
References _m_actionHistoryTreeVectors, _m_firstAHIforT, _m_nrActionHistories, _m_nrActionHistoriesT, IndexTools::CalculateNumberOfSequences(), Globals::CastLIndexToIndex(), PlanningUnit::GetHorizon(), GetNrActions(), and ArgumentHandlers::size().
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).
References _m_actionObservationHistoryTreeVectors, _m_firstAOHIforT, _m_nrActionHistoriesT, _m_nrActionObservationHistories, _m_nrActionObservationHistoriesT, Globals::CastLIndexToIndex(), 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).
References _m_firstOHIforT, _m_nrObservationHistories, _m_nrObservationHistoriesT, _m_observationHistoryTreeVectors, IndexTools::CalculateNumberOfSequences(), Globals::CastLIndexToIndex(), TreeNode< Tcontained >::GetContainedElement(), PlanningUnit::GetHorizon(), History::GetLength(), GetNrObservations(), ObservationHistoryTree::GetObservationHistory(), TreeNode< Tcontained >::SetIndex(), TreeNode< Tcontained >::SetSuccessor(), and ArgumentHandlers::size().
Referenced by InitializeObservationHistories().
|
private |
Cleans up and releases allocated memory.
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.
References _m_actionHistoryTreeRootPointers, _m_actionHistoryTreeVectors, _m_firstAHIforT, _m_nrActionHistories, and _m_nrActionHistoriesT.
Referenced by Deinitialize().
|
private |
Deletes all ActionObservationHistories(Trees) - used on reinitialization.
References _m_actionObservationHistoryTreeRootPointers, _m_actionObservationHistoryTreeVectors, _m_firstAOHIforT, _m_nrActionObservationHistories, and _m_nrActionObservationHistoriesT.
Referenced by Deinitialize().
|
private |
Deletes all joint action histories.
References _m_firstJAHIforT, _m_jointActionHistoryTreeRoot, _m_jointActionHistoryTreeVector, _m_nrJointActionHistories, and _m_nrJointActionHistoriesT.
Referenced by Deinitialize().
|
private |
Deletes all joint action-observation histories.
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.
References _m_firstJOHIforT, _m_jointObservationHistoryTreeRoot, _m_jointObservationHistoryTreeVector, _m_nrJointObservationHistories, and _m_nrJointObservationHistoriesT.
Referenced by Deinitialize().
|
private |
Deletes all ObservationHistories(Trees) - used on reinitialization.
References _m_firstOHIforT, _m_nrObservationHistories, _m_nrObservationHistoriesT, _m_observationHistoryTreeRootPointers, and _m_observationHistoryTreeVectors.
Referenced by Deinitialize().
void PlanningUnitMADPDiscrete::ExportDotGraph | ( | const std::string & | filename, |
const PolicyDiscretePure & | policy, | ||
Index | agentI, | ||
bool | labelEdges = true |
||
) | const |
Export a policy in dot format (from the GraphViz tools).
References PolicyToDotGraph().
Returns a ref to the a-th action of agent agentI.
References GetMADPDI().
Referenced by ActionHistory::SoftPrint(), ActionObservationHistory::SoftPrint(), and SoftPrintAction().
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).
References Globals::CastLIndexToIndex().
Referenced by IndividualToJointActionHistoryIndex().
ActionHistoryTree * PlanningUnitMADPDiscrete::GetActionHistoryTree | ( | Index | agentI, |
Index | ohI | ||
) | const |
Returns a pointer to action history# ohI of agent# agentI.
References _m_actionHistoryTreeVectors, DEBUG_PUD, GetNrActionHistories(), GetNrAgents(), and ArgumentHandlers::size().
Referenced by ActionObservationHistory::ActionObservationHistory(), GetSuccessorAHI(), GetTimeStepForAHI(), 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).
References IndexTools::ActionObservation_to_ActionIndex(), IndexTools::ActionObservation_to_ObservationIndex(), and Globals::CastLIndexToIndex().
Referenced by IndividualToJointActionObservationHistoryIndex(), JointPolicyPureVectorForClusteredBG::StartRecursiveConstructionPerAgent(), and JointPolicyPureVectorForClusteredBG::StartRecursiveSoftPrintPerAgent().
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.
References _m_firstAOHIforT, IndexTools::ActionAndObservation_to_ActionObservationIndex(), Globals::CastLIndexToIndex(), ComputeHistoryIndex(), GetNrActions(), and GetNrObservations().
Referenced by BayesianGameWithClusterInfo::BayesianGameWithClusterInfo(), and JointToIndividualActionObservationHistoryIndices().
|
inline |
Returns a pointer to observation history# ohI of agent# agentI.
References _m_actionObservationHistoryTreeVectors.
Referenced by GetSuccessorAOHI(), GetTimeStepForAOHI(), and SoftPrintPolicyDomainElement().
|
virtual |
Return the default PolicyDomainCategory for the problem.
Implements Interface_ProblemToPolicyDiscrete.
References PolicyGlobals::OHIST_INDEX.
|
inline |
Returns the index of the first joint action observation history of time step ts.
Returns the index of the first joint observation history of time step ts.
|
inline |
Returns the index of the first ts observation history of agent agI.
Referenced by GMAA_MAAstarClassic::ConstructAndValuateNextPolicies(), GMAA_kGMAA::ConstructAndValuateNextPolicies(), GMAA_MAAstar::ConstructAndValuateNextPolicies(), BGforStageCreation::Fill_FirstOHtsI(), BayesianGameForDecPOMDPStage::Fill_FirstOHtsI(), GMAA_MAA_ELSI::Fill_FirstOHtsI(), IndividualBeliefJESP::GetAugmentedStateIndex(), and FSAOHDist_NECOF::Update().
|
inline |
Returns the probability of a state in the initial state distribution.
References GetMADPDI().
Referenced by ValueFunctionDecPOMDPDiscrete::CalculateV().
double PlanningUnitMADPDiscrete::GetJAOHProb | ( | LIndex | jaohI, |
Index | p_jaohI = 0 , |
||
const JointBeliefInterface * | p_jb = NULL , |
||
const JointPolicyDiscrete * | jpol = NULL |
||
) | const |
returns the probability of jaohI.
References GetJAOHProbs(), and GetNewJointBeliefInterface().
Referenced by QHybrid::GetQ().
double PlanningUnitMADPDiscrete::GetJAOHProbGivenPred | ( | LIndex | 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)
References _m_jaohConditionalProbs, _m_params, Globals::CastLIndexToIndex(), PlanningUnitMADPDiscreteParameters::GetComputeJointActionObservationHistories(), GetJAOHProbs(), GetJointActionObservationHistoryIndex(), GetJointActionObservationHistoryVectors(), and GetNewJointBeliefInterface().
Referenced by QHybrid::ComputeRecursively().
double PlanningUnitMADPDiscrete::GetJAOHProbs | ( | JointBeliefInterface * | jb, |
LIndex | jaohI, | ||
LIndex | 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.
References _m_jaohProbs, _m_jBeliefCache, _m_params, Globals::CastLIndexToIndex(), 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, | ||
LIndex | 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.)
References PolicyGlobals::AOHIST_INDEX, JointPolicyDiscrete::GetJointActionProb(), GetJointObservationHistoryIndex(), GetMADPDI(), JointPolicyDiscrete::GetPolicyDomainCategory(), GetSuccessorJAOHI(), PolicyGlobals::OHIST_INDEX, and JointBeliefInterface::Update().
Referenced by GetJAOHProbs(), and BayesianGameForDecPOMDPStage::Initialize().
|
inline |
Returns a ref to the i-th joint action.
References GetMADPDI().
Referenced by JointActionObservationHistory::SoftPrint(), JointActionHistory::SoftPrint(), SimulationFactoredDecPOMDPDiscrete::Step(), SimulationDecPOMDPDiscrete::Step(), and SimulationTOIDecPOMDPDiscrete::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.
References _m_firstJAHIforT, Globals::CastLIndexToIndex(), 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.
References _m_firstJAHIforT, Globals::CastLIndexToIndex(), ComputeHistoryIndex(), and GetNrJointActions().
Index PlanningUnitMADPDiscrete::GetJointActionHistoryIndex | ( | JointActionHistoryTree * | joh | ) | const |
Returns the index of a JointActionHistoryTree pointer.
References _m_jointActionHistoryTreeVector, and _m_nrJointActionHistories.
JointActionHistoryTree * PlanningUnitMADPDiscrete::GetJointActionHistoryTree | ( | Index | jahI | ) | const |
Returns a pointer to joint action history#.
References _m_jointActionHistoryTreeVector, and _m_nrJointActionHistories.
Referenced by QBG::ComputeRecursivelyNoCache(), GetSuccessorJAHI(), and GetTimeStepForJAHI().
void PlanningUnitMADPDiscrete::GetJointActionObservationHistoryArrays | ( | LIndex | 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).
References IndexTools::ActionObservation_to_ActionIndex(), IndexTools::ActionObservation_to_ObservationIndex(), and Globals::CastLIndexToIndex().
Referenced by GetJAOHProbs(), and JointAOHIndexToIndividualActionObservationVectors().
LIndex PlanningUnitMADPDiscrete::GetJointActionObservationHistoryIndex | ( | JointActionObservationHistoryTree * | jaoh | ) | const |
Returns the index of a JointActionObservationHistoryTree pointer.
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.
References _m_firstJAOHIforT, IndexTools::ActionAndObservation_to_ActionObservationIndex(), Globals::CastLIndexToIndex(), ComputeHistoryIndex(), GetNrJointActions(), and GetNrJointObservations().
Index PlanningUnitMADPDiscrete::GetJointActionObservationHistoryIndex | ( | Index | t, |
const std::vector< Index > & | Jactions, | ||
const std::vector< Index > & | Jobservations, | ||
const Scope & | agentSope | ||
) | const |
like GetJointActionObservationHistoryIndex, but works on a subset of agents.
References _m_firstJAOHIforT, IndexTools::ActionAndObservation_to_ActionObservationIndex(), Globals::CastLIndexToIndex(), ComputeHistoryIndex(), GetNrJointActions(), and GetNrJointObservations().
JointActionObservationHistoryTree * PlanningUnitMADPDiscrete::GetJointActionObservationHistoryTree | ( | LIndex | jaohI | ) | const |
Returns a pointer to JointActionObservation history#.
References _m_jointActionObservationHistoryTreeMap, _m_jointActionObservationHistoryTreeVector, _m_params, Globals::CastLIndexToIndex(), and PlanningUnitMADPDiscreteParameters::GetComputeJointActionObservationHistories().
Referenced by GetJAOHProbs(), MonahanPlanner::GetQ(), GetSuccessorJAOHI(), GetTimeStepForJAOHI(), BayesianGameForDecPOMDPStage::ProbRewardForjoahI(), and GMAA_MAA_ELSI::ProbRewardForjoahI().
void PlanningUnitMADPDiscrete::GetJointActionObservationHistoryVectors | ( | LIndex | 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.
References JointActionObservationHistoryTree::GetJointActionObservationHistory().
Referenced by GetJAOHProbGivenPred(), GetJAOHProbs(), and GetJointBeliefInterface().
JointBeliefInterface * PlanningUnitMADPDiscrete::GetJointBeliefInterface | ( | LIndex | 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).
References _m_jBeliefCache, _m_params, Globals::CastLIndexToIndex(), PlanningUnitMADPDiscreteParameters::GetComputeJointBeliefs(), GetJointActionObservationHistoryVectors(), GetMADPDI(), GetNewJointBeliefFromISD(), GetNewJointBeliefInterface(), BeliefInterface::Print(), BeliefInterface::SanityCheck(), and JointBeliefInterface::Update().
Referenced by QHybrid::ComputeRecursively(), QFunctionJointBelief::GetQ(), MonahanPlanner::GetQ(), QHybrid::GetQ(), QAlphaVector::GetQ(), QAV< PerseusPOMDPPlanner >::GetQ(), and QMDP::GetQNoCache().
|
inline |
Returns a ref to the joI-th joint observation.
References GetMADPDI().
Referenced by QBG::ComputeRecursivelyNoCache(), JointActionObservationHistory::SoftPrint(), JointObservationHistory::SoftPrint(), SimulationFactoredDecPOMDPDiscrete::Step(), SimulationDecPOMDPDiscrete::Step(), and SimulationTOIDecPOMDPDiscrete::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).
References Globals::CastLIndexToIndex().
Referenced by JointToIndividualObservationHistoryIndices().
Index PlanningUnitMADPDiscrete::GetJointObservationHistoryIndex | ( | JointObservationHistoryTree * | joh | ) | const |
Returns the index of a JointObservationHistoryTree pointer.
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.
References _m_firstJOHIforT, Globals::CastLIndexToIndex(), 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.
References _m_firstJOHIforT, Globals::CastLIndexToIndex(), ComputeHistoryIndex(), and GetNrJointObservations().
JointObservationHistoryTree * PlanningUnitMADPDiscrete::GetJointObservationHistoryTree | ( | Index | johI | ) | const |
Returns a pointer to joint observation history#.
References _m_jointObservationHistoryTreeVector, and _m_nrJointObservationHistories.
Referenced by QBG::ComputeRecursivelyNoCache(), GMAA_MAA_ELSI::Get_joht(), GetSuccessorJOHI(), and GetTimeStepForJOHI().
|
inline |
References _m_madp.
Referenced by GetAction(), GetInitialStateProbability(), GetJAOHProbs(), GetJAOHProbsRecursively(), GetJointAction(), GetJointBeliefInterface(), GetJointObservation(), GetNewJointBeliefFromISD(), GetNrActions(), GetNrJointActions(), GetNrJointObservations(), GetNrObservations(), GetNrStates(), GetObservation(), GetObservationModelDiscretePtr(), GetObservationProbability(), GetProblem(), GetState(), GetTransitionModelDiscretePtr(), GetTransitionProbability(), IndividualToJointActionIndices(), IndividualToJointObservationIndices(), InitializeActionHistories(), InitializeActionObservationHistories(), InitializeJointActionObservationHistories(), InitializeObservationHistories(), JointToIndividualActionIndices(), and JointToIndividualObservationIndices().
|
inline |
References _m_madp.
JointBeliefInterface * PlanningUnitMADPDiscrete::GetNewJointBeliefFromISD | ( | ) | const |
Returns a new joint belief with the value of the initial state distribution.
References MultiAgentDecisionProcessDiscreteInterface::GetISD(), GetMADPDI(), GetNewJointBeliefInterface(), and BeliefInterface::Set().
Referenced by AgentBG::Act(), QFunctionJAOHTree::ComputeQ(), QHybrid::ComputeQ(), GetJointBeliefInterface(), BayesianGameForDecPOMDPStage::Initialize(), PerseusNonStationaryQPlanner::PlanAll(), Perseus::PlanEndOfIteration(), PerseusNonStationaryQPlanner::PlanSampling(), Perseus::PlanStartOfIteration(), BayesianGameForDecPOMDPStage::ProbRewardForjoahI(), GMAA_MAA_ELSI::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.
References _m_params, GetNrStates(), and PlanningUnitMADPDiscreteParameters::GetUseSparseJointBeliefs().
Referenced by AgentPOMDP::AgentPOMDP(), BayesianGameWithClusterInfo::Extend(), GetJAOHProb(), GetJAOHProbGivenPred(), GetJointBeliefInterface(), GetNewJointBeliefFromISD(), InitializeJointActionObservationHistories(), AlphaVectorPlanning::SampleBeliefs(), and AlphaVectorPlanning::SampleBeliefsNonStationary().
|
virtual |
References _m_params, and PlanningUnitMADPDiscreteParameters::GetUseSparseJointBeliefs().
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.
References _m_nrActionHistories.
Referenced by GetActionHistoryTree(), ArgumentUtils::GetHybridQheuristicFromArgs(), and QHybrid::Initialize().
Returns the number of action histories for agentI for time step ts.
The planning unit (specifically _m_nrActionHistories) must be initialized when calling this function.
|
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.
Referenced by JESPDynamicProgrammingPlanner::DynamicProgrammingBestResponse(), and GetNrPolicyDomainElements().
|
inline |
Returns the number of actions vector.
References GetMADPDI().
Referenced by AgentRandom::Act(), GMAA_MAA_ELSI::CAVNP_quick_n_dirty2(), TreeIncPruneBGPlanner::ComputeKey(), GMAA_MAA_ELSI::ConstructBayesianGame(), CreateActionHistoryTree(), CreateActionObservationHistoryTree(), GetActionObservationHistoryIndex(), GetNrActions(), GetNrPolicies(), GetSuccessorAHI(), GetSuccessorAOHI(), TreeIncPruneBGPlanner::GetValidActions(), SimulationFactoredDecPOMDPDiscrete::RunSimulationsRandomActions(), TreeIncPruneBGPlanner::SaveStats(), TreeIncPruneBGPlanner::SoftPrintStats(), FSAOHDist_NECOF::Update(), and DICEPSPlanner::UpdateCEProbDistribution().
|
inlinevirtual |
Returns the number of actions of agent agentI.
Implements Interface_ProblemToPolicyDiscrete.
References GetMADPDI(), and GetNrActions().
|
inlinevirtual |
Gets the number of agents.
Implements Interface_ProblemToPolicyDiscrete.
References PlanningUnit::GetNrAgents().
Referenced by AgentBG::AgentBG(), AlphaVectorBG::AlphaVectorBG(), TreeIncPruneBGPlanner::BackupStage(), QBGPlanner_TreeIncPruneBnB::BackupStage(), BayesianGameWithClusterInfo::BayesianGameWithClusterInfo(), GMAA_MAA_ELSI::CAVNP_quick_n_dirty2(), TreeIncPruneBGPlanner::ComputeKey(), QFunctionJAOHTree::ComputeQ(), GMAA_MAAstarClassic::ConstructAndValuateNextPolicies(), GMAA_kGMAA::ConstructAndValuateNextPolicies(), GMAA_MAAstar::ConstructAndValuateNextPolicies(), GMAA_MAA_ELSI::ConstructBayesianGame(), GeneralizedMAAStarPlannerForDecPOMDPDiscrete::ConstructExtendedJointPolicy(), GeneralizedMAAStarPlannerForFactoredDecPOMDPDiscrete::ConstructExtendedJointPolicy(), BGforStageCreation::Fill_FirstOHtsI(), GMAA_MAA_ELSI::Fill_FirstOHtsI(), BGforStageCreation::Fill_joI_Array(), GMAA_MAA_ELSI::Fill_joI_Array(), FSAOHDist_NECOF::FSAOHDist_NECOF(), GetActionHistoryTree(), ArgumentUtils::GetHybridQheuristicFromArgs(), GetNrJointPolicies(), GetNrObservationHistoriesVector(), GetObservationHistoryTree(), IndividualBeliefJESP::IndividualBeliefJESP(), IndividualToJointActionHistoryIndex(), IndividualToJointActionObservationHistoryIndex(), IndividualToJointObservationHistoryIndex(), QHybrid::Initialize(), InitializeActionHistories(), InitializeActionObservationHistories(), InitializeJointActionHistories(), InitializeJointActionObservationHistories(), InitializeJointObservationHistories(), InitializeObservationHistories(), JointActionHistory::JointActionHistory(), JointActionObservationHistory::JointActionObservationHistory(), JointAOHIndexToIndividualActionObservationVectors(), JointObservationHistory::JointObservationHistory(), JointToIndividualActionObservationHistoryIndices(), JointToIndividualObservationHistoryIndices(), JESPExhaustivePlanner::Plan(), JESPDynamicProgrammingPlanner::Plan(), PrintActionHistories(), PrintActionObservationHistories(), PrintObservationHistories(), SimulationFactoredDecPOMDPDiscrete::RunSimulation(), SimulationDecPOMDPDiscrete::RunSimulationClusteredBG(), SimulationFactoredDecPOMDPDiscrete::RunSimulationsRandomActions(), TreeIncPruneBGPlanner::SaveStats(), GMAA_MAAstarCluster::SoftPrintClusteringStats(), GMAA_kGMAACluster::SoftPrintClusteringStats(), TreeIncPruneBGPlanner::SoftPrintStats(), JointPolicyPureVectorForClusteredBG::StartRecursiveConstructionPerAgent(), JointPolicyPureVectorForClusteredBG::StartRecursiveSoftPrintPerAgent(), TreeIncPruneBGPlanner::UnionNode(), IndividualBeliefJESP::Update(), and FSAOHDist_NECOF::Update().
size_t PlanningUnitMADPDiscrete::GetNrJointActionHistories | ( | ) | const |
Returns the number of joint action histories.
References _m_jointActionHistoryTreeVector.
|
inline |
Returns the number of jointActionObservation histories.
References _m_nrJointActionObservationHistories.
Referenced by QMDP::CacheJaohQValues().
|
inline |
return the number of joint actions.
References GetMADPDI().
Referenced by AgentPOMDP::Act(), AgentQMDP::Act(), AgentMDP::Act(), AlphaVectorPlanning::BackProject(), AlphaVectorPlanning::BackProjectFull(), MonahanBGPlanner::BackProjectMonahanBG(), AlphaVectorPlanning::BackProjectSparse(), AlphaVectorWeighted::BackProjectWeights(), MonahanBGPlanner::BackupStage(), MonahanPOMDPPlanner::BackupStage(), PerseusConstrainedPOMDPPlanner::BackupStage(), TreeIncPruneBGPlanner::BackupStage(), QBGPlanner_TreeIncPruneBnB::BackupStage(), PerseusBGPOMDPPlanner::BackupStageAll(), PerseusBGNSPlanner::BackupStageAll(), PerseusBGPlanner::BackupStageAll(), Perseus::BackupStageLeadOut(), PerseusBGNSPlanner::BackupStageSampling(), PerseusBGPlanner::BackupStageSampling(), PerseusBGPOMDPPlanner::BackupStageSamplingAlt(), PerseusBGPlanner::BackupStageSamplingAlt(), MonahanBGPlanner::BackupStageSlow(), AlphaVectorPOMDP::BeliefBackup(), AlphaVectorConstrainedPOMDP::BeliefBackup(), AlphaVectorBG::BeliefBackupBGIP_Solver(), AlphaVectorBG::BeliefBackupExhaustiveOnlyKeepMax(), AlphaVectorBG::BeliefBackupExhaustiveStoreAll(), AlphaVectorConstrainedPOMDP::BeliefBackupQ(), QMDP::CacheJaohQValues(), MonahanBGPlanner::ComputeAllGaoa(), QFunctionJAOHTree::ComputeQ(), QHybrid::ComputeQ(), QHybrid::ComputeRecursively(), QBG::ComputeRecursivelyNoCache(), GMAA_MAA_ELSI::ConstructBayesianGame(), ArgumentUtils::GetHybridQheuristicFromArgs(), AlphaVectorPlanning::GetImmediateRewardValueFunction(), Perseus::GetInitialQFunctions(), Perseus::GetInitialValueFunction(), GetJointActionHistoryIndex(), GetJointActionObservationHistoryIndex(), AlphaVectorBG::GetMask(), AgentBG::GetMaximizingActionIndex(), AgentBG::GetMaximizingBGIndex(), GetSuccessorJAHI(), GetSuccessorJAOHI(), MDPPolicyIteration::Initialize(), MDPPolicyIterationGPU::Initialize(), MDPValueIteration::Initialize(), QBGPlanner_TreeIncPruneBnB::Initialize(), SimulationDecPOMDPDiscrete::Initialize(), AlphaVectorPlanning::Initialize(), InitializeJointActionHistories(), InitializeJointActionObservationHistories(), QHybrid::Load(), MDPValueIteration::Plan(), MonahanPlanner::Plan(), MDPValueIteration::PlanSlow(), MDPPolicyIterationGPU::PlanSlow(), MDPPolicyIteration::PlanSlow(), AlphaVectorPlanning::SampleBeliefs(), AlphaVectorPlanning::SampleBeliefsNonStationary(), TreeIncPruneBGPlanner::SaveStats(), JointActionObservationHistory::SoftPrintJointIndices(), and TreeIncPruneBGPlanner::SoftPrintStats().
|
inline |
Returns the number of joint observation histories.
References _m_nrJointObservationHistories.
Referenced by GMAA_MAA_ELSI::CAVNP_quick_n_dirty2(), GMAA_MAA_ELSI::ConstructBayesianGame(), BayesianGameForDecPOMDPStage::Initialize(), DICEPSPlanner::Plan(), and ValueFunctionDecPOMDPDiscrete::ValueFunctionDecPOMDPDiscrete().
|
inline |
Returns the number of joint observation histories for time step ts.
|
inline |
Returns the number of joint observations.
References GetMADPDI().
Referenced by AlphaVectorPlanning::BackProject(), AlphaVectorPlanning::BackProjectFull(), MonahanBGPlanner::BackProjectMonahanBG(), AlphaVectorPlanning::BackProjectSparse(), MonahanBGPlanner::BackupStage(), TreeIncPruneBGPlanner::BackupStage(), QBGPlanner_TreeIncPruneBnB::BackupStage(), Perseus::BackupStageLeadOut(), AlphaVectorPOMDP::BeliefBackup(), AlphaVectorConstrainedPOMDP::BeliefBackup(), AlphaVectorBG::BeliefBackupBGIP_Solver(), AlphaVectorBG::BeliefBackupExhaustiveOnlyKeepMax(), AlphaVectorBG::BeliefBackupExhaustiveStoreAll(), AlphaVectorConstrainedPOMDP::BeliefBackupQ(), MonahanBGPlanner::ComputeAllGaoa(), MonahanBGPlanner::ComputeGaoa(), QHybrid::ComputeRecursively(), QBG::ComputeRecursivelyNoCache(), GetJointActionObservationHistoryIndex(), GetJointObservationHistoryIndex(), GetSuccessorJAOHI(), GetSuccessorJOHI(), TreeIncPruneBGPlanner::Initialize(), QBGPlanner_TreeIncPruneBnB::Initialize(), AlphaVectorPlanning::Initialize(), InitializeJointActionObservationHistories(), InitializeJointObservationHistories(), MonahanPOMDPPlanner::MonahanCrossSum(), MonahanBGPlanner::MonahanCrossSum(), JointActionObservationHistory::SoftPrintJointIndices(), and ValueFunctionDecPOMDPDiscrete::ValueFunctionDecPOMDPDiscrete().
LIndex PlanningUnitMADPDiscrete::GetNrJointPolicies | ( | ) | const |
Returns the number of joint policies.
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.
References _m_nrObservationHistories.
Referenced by GMAA_MAA_ELSI::CAVNP_quick_n_dirty2(), GMAA_MAA_ELSI::ConstructBayesianGame(), ArgumentUtils::GetHybridQheuristicFromArgs(), GetNrObservationHistoriesVector(), GetNrPolicies(), GetNrPolicyDomainElements(), GetObservationHistoryTree(), IndividualBeliefJESP::IndividualBeliefJESP(), QHybrid::Initialize(), DICEPSPlanner::Plan(), PolicyToDotGraph(), FSAOHDist_NECOF::Update(), and DICEPSPlanner::UpdateCEProbDistribution().
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.
const vector< size_t > PlanningUnitMADPDiscrete::GetNrObservationHistoriesVector | ( | ) | const |
Returns a vector with the number of OHs for each agent.
This calls GetNrObservationHistories(Index agentI)
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)
References GetNrAgents(), and GetNrObservationHistories().
|
inline |
Returns the number of observations vector.
References GetMADPDI().
Referenced by CreateActionObservationHistoryTree(), CreateObservationHistoryTree(), BayesianGameWithClusterInfo::Extend(), GetActionObservationHistoryIndex(), GetNrObservations(), GetObservationHistoryIndex(), GetSuccessorAOHI(), GetSuccessorOHI(), PolicyToDotGraph(), JointPolicyPureVectorForClusteredBG::RecursivelyFillPolicyForAgent(), JointPolicyPureVectorForClusteredBG::RecursivelyPrintPolicyForAgent(), TreeIncPruneBGPlanner::SaveStats(), GMAA_MAAstarCluster::SoftPrintClusteringStats(), GMAA_kGMAACluster::SoftPrintClusteringStats(), TreeIncPruneBGPlanner::SoftPrintStats(), IndividualBeliefJESP::Update(), and FSAOHDist_NECOF::Update().
|
inline |
Returns the number of observations of agent agentI.
References GetMADPDI(), and GetNrObservations().
Returns the number of policies for agentI.
References GetNrActions(), and GetNrObservationHistories().
Referenced by GetNrJointPolicies().
|
virtual |
Get the number of elements in the domain of an agent's policy.
Implements Interface_ProblemToPolicyDiscrete.
References _m_firstAOHIforT, _m_firstOHIforT, PolicyGlobals::AOHIST_INDEX, Globals::CastLIndexToIndex(), PlanningUnit::GetHorizon(), GetNrActionObservationHistories(), GetNrObservationHistories(), Globals::MAXHORIZON, PolicyGlobals::OHIST_INDEX, and PolicyGlobals::TYPE_INDEX.
size_t PlanningUnitMADPDiscrete::GetNrStates | ( | ) | const |
Returns the number of states.
References GetMADPDI(), and MultiAgentDecisionProcessDiscreteInterface::GetNrStates().
Referenced by AgentQMDP::Act(), AlphaVectorWeighted::AlphaVectorWeighted(), AlphaVectorPlanning::BackProject(), AlphaVectorPlanning::BackProjectFull(), MonahanBGPlanner::BackProjectMonahanBG(), AlphaVectorPlanning::BackProjectSparse(), AlphaVectorWeighted::BackProjectWeights(), PerseusPOMDPPlanner::BackupStage(), MonahanBGPlanner::BackupStage(), PerseusConstrainedPOMDPPlanner::BackupStage(), TreeIncPruneBGPlanner::BackupStage(), QBGPlanner_TreeIncPruneBnB::BackupStage(), PerseusBGPOMDPPlanner::BackupStageAll(), PerseusBGNSPlanner::BackupStageAll(), PerseusBGPlanner::BackupStageAll(), PerseusBGNSPlanner::BackupStageSampling(), PerseusBGPlanner::BackupStageSampling(), PerseusBGPOMDPPlanner::BackupStageSamplingAlt(), PerseusBGPlanner::BackupStageSamplingAlt(), AlphaVectorPOMDP::BeliefBackup(), AlphaVectorConstrainedPOMDP::BeliefBackup(), AlphaVectorBG::BeliefBackupBGIP_Solver(), AlphaVectorBG::BeliefBackupExhaustiveOnlyKeepMax(), AlphaVectorBG::BeliefBackupExhaustiveStoreAll(), AlphaVectorConstrainedPOMDP::BeliefBackupQ(), GMAA_MAA_ELSI::CAVNP_quick_n_dirty2(), QBGPlanner_TreeIncPruneBnB::CheckDominationPointWise(), MonahanBGPlanner::ComputeGaoa(), QFunctionJAOHTree::ComputeQ(), QBG::ComputeRecursivelyNoCache(), ArgumentUtils::GetHybridQheuristicFromArgs(), AlphaVectorPlanning::GetImmediateRewardValueFunction(), Perseus::GetInitialQFunctions(), Perseus::GetInitialValueFunction(), GetNewJointBeliefInterface(), IndividualBeliefJESP::IndividualBeliefJESP(), MDPPolicyIterationGPU::Initialize(), MDPPolicyIteration::Initialize(), MDPValueIteration::Initialize(), SimulationDecPOMDPDiscrete::Initialize(), AlphaVectorPlanning::Initialize(), MonahanPOMDPPlanner::MonahanCrossSum(), MonahanBGPlanner::MonahanCrossSum(), MDPValueIteration::Plan(), MonahanPlanner::Plan(), DICEPSPlanner::Plan(), MDPValueIteration::PlanSlow(), MDPPolicyIterationGPU::PlanSlow(), MDPPolicyIteration::PlanSlow(), BayesianGameForDecPOMDPStage::ProbRewardForjoahI(), GMAA_MAA_ELSI::ProbRewardForjoahI(), AlphaVectorPlanning::SampleBeliefs(), AlphaVectorPlanning::SampleBeliefsNonStationary(), IndividualBeliefJESP::Update(), and ValueFunctionDecPOMDPDiscrete::ValueFunctionDecPOMDPDiscrete().
|
inline |
Returns a ref to the o-th observation of agent agentI.
References GetMADPDI().
Referenced by PolicyToDotGraph(), ActionObservationHistory::SoftPrint(), ObservationHistory::SoftPrint(), and SoftPrintObservationHistory().
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).
References Globals::CastLIndexToIndex().
Referenced by BayesianGameWithClusterInfo::BayesianGameWithClusterInfo(), BGforStageCreation::Fill_joI_Array(), BayesianGameForDecPOMDPStage::Fill_joI_Array(), IndividualToJointObservationHistoryIndex(), and SoftPrintObservationHistory().
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.
References _m_firstOHIforT, Globals::CastLIndexToIndex(), ComputeHistoryIndex(), and GetNrObservations().
Referenced by JointToIndividualObservationHistoryIndices(), JointPolicyPureVectorForClusteredBG::StartRecursiveConstructionPerAgent(), and JointPolicyPureVectorForClusteredBG::StartRecursiveSoftPrintPerAgent().
ObservationHistoryTree * PlanningUnitMADPDiscrete::GetObservationHistoryTree | ( | Index | agentI, |
Index | ohI | ||
) | const |
Returns a pointer to observation history# ohI of agent# agentI.
References _m_observationHistoryTreeVectors, _m_params, DEBUG_PUD, PlanningUnitMADPDiscreteParameters::GetComputeIndividualObservationHistories(), GetNrAgents(), GetNrObservationHistories(), and ArgumentHandlers::size().
Referenced by ActionObservationHistory::ActionObservationHistory(), GMAA_MAA_ELSI::Fill_joI_Array(), GetSuccessorOHI(), GetTimeStepForOHI(), ActionObservationHistory::SoftPrint(), and SoftPrintObservationHistory().
|
inline |
References GetMADPDI().
Referenced by AlphaVectorPlanning::Initialize().
|
inline |
Returns P(joI | jaI, sucSI ). Arguments are time-ordered.
References GetMADPDI().
Referenced by ValueFunctionDecPOMDPDiscrete::CalculateVsjohRecursively(), and IndividualBeliefJESP::Update().
|
inline |
Get the parameters for this planning unit.
Referenced by AlphaVectorPlanning::BackProjectFull(), AlphaVectorConstrainedPOMDP::BeliefBackupQ(), GeneralizedMAAStarPlannerForDecPOMDPDiscrete::GeneralizedMAAStarPlannerForDecPOMDPDiscrete(), and GeneralizedMAAStarPlannerForFactoredDecPOMDPDiscrete::GeneralizedMAAStarPlannerForFactoredDecPOMDPDiscrete().
|
inline |
Returns a reference to the problem of the PlanningUnitMADPDiscrete.
References GetMADPDI().
Referenced by JESPDynamicProgrammingPlanner::DynamicProgrammingBestResponse().
|
inline |
References GetMADPDI().
Get a pointer to a State by index.
References GetMADPDI().
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.
References _m_firstAOHIforT, _m_params, Globals::CastLIndexToIndex(), GetActionObservationHistoryTree(), PlanningUnitMADPDiscreteParameters::GetComputeIndividualActionObservationHistories(), PlanningUnit::GetHorizon(), GetNrActions(), GetNrObservations(), and GetTimeStepForAOHI().
Referenced by JointActionObservationHistory::JointActionObservationHistory(), JointPolicyPureVectorForClusteredBG::RecursivelyFillPolicyForAgent(), and JointPolicyPureVectorForClusteredBG::RecursivelyPrintPolicyForAgent().
Returns the index of the successor of agent agI's action-observation history aohI via action aI and observation oI.
References _m_firstJAOHIforT, _m_params, PlanningUnitMADPDiscreteParameters::GetComputeJointActionObservationHistories(), PlanningUnit::GetHorizon(), TreeNode< Tcontained >::GetIndex(), GetJointActionObservationHistoryTree(), GetNrJointActions(), GetNrJointObservations(), and GetTimeStepForJAOHI().
Referenced by GetJAOHProbsRecursively().
Returns the index of the successor of observation history johI via joint observation joI.
I.e., johIsuc = (johI, joI).
References _m_firstJOHIforT, _m_params, Globals::CastLIndexToIndex(), PlanningUnitMADPDiscreteParameters::GetComputeJointObservationHistories(), PlanningUnit::GetHorizon(), GetJointObservationHistoryTree(), GetNrJointObservations(), and GetTimeStepForJOHI().
Referenced by ValueFunctionDecPOMDPDiscrete::CalculateVsjohRecursively(), BGforStageCreation::Fill_jaI_Array(), BayesianGameForDecPOMDPStage::Fill_jaI_Array(), and SimulationDecPOMDPDiscrete::RunSimulation().
Returns the index of the successor of observation history ohI of agentI via observation joI.
I.e., johIsuc = (johI, joI).
References _m_firstOHIforT, _m_params, Globals::CastLIndexToIndex(), PlanningUnitMADPDiscreteParameters::GetComputeIndividualObservationHistories(), PlanningUnit::GetHorizon(), GetNrObservations(), GetObservationHistoryTree(), and GetTimeStepForOHI().
Referenced by BayesianGameWithClusterInfo::BayesianGameWithClusterInfo(), PolicyToDotGraph(), JointPolicyPureVectorForClusteredBG::RecursivelyFillPolicyForAgent(), JointPolicyPureVectorForClusteredBG::RecursivelyPrintPolicyForAgent(), SimulationFactoredDecPOMDPDiscrete::RunSimulation(), IndividualBeliefJESP::Update(), and FSAOHDist_NECOF::Update().
Returns the time step of observation history ohI.
References _m_firstAHIforT, _m_params, GetActionHistoryTree(), PlanningUnitMADPDiscreteParameters::GetComputeIndividualActionHistories(), and PlanningUnit::GetHorizon().
Referenced by GetSuccessorAHI().
Returns the time step of joint action-observation historyaohI.
References _m_firstAOHIforT, _m_params, Globals::CastLIndexToIndex(), GetActionObservationHistoryTree(), PlanningUnitMADPDiscreteParameters::GetComputeIndividualActionObservationHistories(), and PlanningUnit::GetHorizon().
Referenced by GetSuccessorAOHI().
Returns the time step of joint observation history johI.
References _m_firstJAHIforT, _m_params, PlanningUnitMADPDiscreteParameters::GetComputeJointActionHistories(), PlanningUnit::GetHorizon(), and GetJointActionHistoryTree().
Referenced by GetSuccessorJAHI().
Returns the time step of joint action-observation historyjaohI.
References _m_firstJAOHIforT, _m_params, PlanningUnitMADPDiscreteParameters::GetComputeJointActionObservationHistories(), PlanningUnit::GetHorizon(), GetJointActionObservationHistoryTree(), JointActionObservationHistoryTree::GetLength(), and Globals::MAXHORIZON.
Referenced by QMDP::CacheJaohQValues(), GetJAOHProbs(), QHybrid::GetQ(), QAlphaVector::GetQ(), QAV< PerseusPOMDPPlanner >::GetQ(), QMDP::GetQNoCache(), GetSuccessorJAOHI(), JointAOHIndexToIndividualActionObservationVectors(), and JointToIndividualActionObservationHistoryIndices().
Returns the time step of joint observation history johI.
References _m_firstJOHIforT, _m_params, PlanningUnitMADPDiscreteParameters::GetComputeJointObservationHistories(), TreeNode< Tcontained >::GetContainedElement(), PlanningUnit::GetHorizon(), and GetJointObservationHistoryTree().
Referenced by GetSuccessorJOHI(), and JointToIndividualObservationHistoryIndices().
Returns the time step of observation history ohI.
References _m_firstOHIforT, _m_params, PlanningUnitMADPDiscreteParameters::GetComputeIndividualObservationHistories(), TreeNode< Tcontained >::GetContainedElement(), PlanningUnit::GetHorizon(), and GetObservationHistoryTree().
Referenced by GetSuccessorOHI(), PolicyToDotGraph(), and SoftPrintObservationHistory().
|
inline |
References GetMADPDI().
Referenced by AlphaVectorPlanning::AlphaVectorPlanning(), AlphaVectorPlanning::Initialize(), and MDPValueIteration::Plan().
|
inline |
Returns the trans. prob for state, joint action, suc state indices.
References GetMADPDI().
Referenced by AlphaVectorWeighted::BackProjectWeights(), ValueFunctionDecPOMDPDiscrete::CalculateVsjohRecursively(), MDPValueIteration::PlanSlow(), MDPPolicyIterationGPU::PlanSlow(), and MDPPolicyIteration::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.
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.
References GetMADPDI().
Referenced by TreeIncPruneBGPlanner::GetGaoa(), QBGPlanner_TreeIncPruneBnB::GetGaoa(), IndividualToJointActionHistoryIndex(), IndividualToJointActionIndices(), IndividualToJointActionObservationHistoryIndex(), SimulationDecPOMDPDiscrete::RunSimulationClusteredBG(), SimulationDecPOMDPDiscrete::RunSimulations(), SimulationFactoredDecPOMDPDiscrete::Step(), SimulationTOIDecPOMDPDiscrete::Step(), and IndividualBeliefJESP::Update().
|
inlinevirtual |
Returns the joint action index that corresponds to the vector of specified individual action indices.
Implements Interface_ProblemToPolicyDiscrete.
References GetMADPDI(), and IndividualToJointActionIndices().
LIndex 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.
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.
References GetJointObservationHistoryIndex(), GetNrAgents(), GetObservationHistoryArrays(), and IndividualToJointObservationIndices().
|
inline |
Returns the joint observation index that corresponds to the vector of specified individual observation indices.
References GetMADPDI().
Referenced by BayesianGameWithClusterInfo::Extend(), BGforStageCreation::Fill_joI_Array(), BayesianGameForDecPOMDPStage::Fill_joI_Array(), GMAA_MAA_ELSI::Fill_joI_Array(), TreeIncPruneBGPlanner::GetGaoa(), QBGPlanner_TreeIncPruneBnB::GetGaoa(), IndividualToJointActionObservationHistoryIndex(), IndividualToJointObservationHistoryIndex(), SimulationFactoredDecPOMDPDiscrete::Step(), SimulationTOIDecPOMDPDiscrete::Step(), and IndividualBeliefJESP::Update().
|
private |
Calls functions to initialize the planning unit.
References _m_initialized, _m_madp, DEBUG_PUD, Deinitialize(), PlanningUnit::GetHorizon(), 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.
References _m_actionHistoryTreeRootPointers, _m_actionHistoryTreeVectors, _m_firstAHIforT, _m_nrActionHistories, _m_nrActionHistoriesT, _m_params, CreateActionHistoryTree(), PlanningUnitMADPDiscreteParameters::GetComputeIndividualActionHistories(), PlanningUnit::GetHorizon(), GetMADPDI(), MultiAgentDecisionProcessDiscreteInterface::GetNrActions(), and GetNrAgents().
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.
References _m_actionObservationHistoryTreeRootPointers, _m_actionObservationHistoryTreeVectors, _m_firstAOHIforT, _m_nrActionObservationHistories, _m_nrActionObservationHistoriesT, _m_params, CreateActionObservationHistoryTree(), PlanningUnitMADPDiscreteParameters::GetComputeIndividualActionObservationHistories(), PlanningUnit::GetHorizon(), GetMADPDI(), MultiAgentDecisionProcessDiscreteInterface::GetNrActions(), GetNrAgents(), and MultiAgentDecisionProcessDiscreteInterface::GetNrObservations().
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.
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).
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, Globals::CastLIndexToIndex(), PlanningUnitMADPDiscreteParameters::GetComputeJointActionObservationHistories(), PlanningUnitMADPDiscreteParameters::GetComputeJointBeliefs(), PlanningUnit::GetHorizon(), MultiAgentDecisionProcessDiscreteInterface::GetISD(), History::GetLength(), GetMADPDI(), GetNewJointBeliefInterface(), GetNrAgents(), GetNrJointActions(), GetNrJointObservations(), JointActionObservationHistory::Print(), JointActionObservationHistoryTree::Print(), 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.
References _m_firstJOHIforT, _m_jointObservationHistoryTreeRoot, _m_jointObservationHistoryTreeVector, _m_nrJointObservationHistories, _m_nrJointObservationHistoriesT, _m_nrObservationHistoriesT, _m_params, Globals::CastLIndexToIndex(), 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.
References _m_firstOHIforT, _m_nrObservationHistories, _m_nrObservationHistoriesT, _m_observationHistoryTreeRootPointers, _m_observationHistoryTreeVectors, _m_params, CreateObservationHistoryTree(), PlanningUnitMADPDiscreteParameters::GetComputeIndividualObservationHistories(), PlanningUnit::GetHorizon(), GetMADPDI(), GetNrAgents(), and MultiAgentDecisionProcessDiscreteInterface::GetNrObservations().
Referenced by Initialize().
void PlanningUnitMADPDiscrete::JointAOHIndexToIndividualActionObservationVectors | ( | LIndex | 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
References GetJointActionObservationHistoryArrays(), GetNrAgents(), GetTimeStepForJAOHI(), JointToIndividualActionIndices(), and JointToIndividualObservationIndices().
Referenced by JointToIndividualActionObservationHistoryIndices().
void PlanningUnitMADPDiscrete::JointAOHIndexToIndividualActionObservationVectors | ( | LIndex | jaohI, |
std::vector< std::vector< Index > > & | indivAO_vec | ||
) | const |
computes the vector of action-observations corresponding to jaohI indivAO_vec[agentI][t] = aoI
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.
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.
References _m_jointActionHistoryTreeVector, and _m_nrJointActionHistories.
Returns a vector containing the indices of the indiv.
actions corresponding to the joint action jaI.
References GetMADPDI().
Referenced by AgentOnlinePlanningMDP::Act(), AgentPOMDP::Act(), AgentQMDP::Act(), AgentMDP::Act(), AgentBG::Act(), AgentQLearner::Act(), JointActionObservationHistory::JointActionObservationHistory(), JointAOHIndexToIndividualActionObservationVectors(), and SimulationDecPOMDPDiscrete::RunSimulationClusteredBG().
vector< Index > PlanningUnitMADPDiscrete::JointToIndividualActionObservationHistoryIndices | ( | LIndex | jaohI | ) | const |
Returns a vector containing the indices of the indiv.
act.-obs.history indices corresponding to the joint observation hist. joI.
References GetActionObservationHistoryIndex(), GetNrAgents(), GetTimeStepForJAOHI(), and JointAOHIndexToIndividualActionObservationVectors().
Referenced by GMAA_MAA_ELSI::CAVNP_quick_n_dirty2(), and JointToIndividualPolicyDomainIndices().
const vector< Index > & PlanningUnitMADPDiscrete::JointToIndividualActionObservationHistoryIndicesRef | ( | LIndex | jaohI | ) | const |
Returns a vector containing the indices of the indiv.
act.-obs.histories corresponding to the joint observation hist. joI.
References _m_jointActionObservationHistoryTreeVector, _m_nrJointActionObservationHistories, Globals::CastLIndexToIndex(), 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.
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.
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.
References GetMADPDI().
Referenced by SimulationDecPOMDPDiscrete::GetAction(), TreeIncPruneBGPlanner::GetObservationsFromDepth(), JointActionObservationHistory::JointActionObservationHistory(), JointAOHIndexToIndividualActionObservationVectors(), JointToIndividualObservationHistoryIndices(), and SimulationDecPOMDPDiscrete::RunSimulationClusteredBG().
|
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.
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.
References PolicyGlobals::AOHIST_INDEX, JointToIndividualActionObservationHistoryIndicesRef(), JointToIndividualObservationHistoryIndicesRef(), PolicyGlobals::OHIST_INDEX, and PolicyGlobals::TYPE_INDEX.
string PlanningUnitMADPDiscrete::PolicyToDotGraph | ( | const PolicyDiscretePure & | policy, |
Index | agentI, | ||
bool | labelEdges = true |
||
) | const |
Convert a policy to dot format (from the GraphViz tools).
References PolicyDiscretePure::GetActionIndex(), PlanningUnit::GetHorizon(), NamedDescribedEntity::GetName(), GetNrObservationHistories(), GetNrObservations(), GetObservation(), GetSuccessorOHI(), GetTimeStepForOHI(), and SoftPrintAction().
Referenced by ExportDotGraph().
void PlanningUnitMADPDiscrete::Print | ( | ) |
Prints info regarding the planning unit.
References _m_firstAHIforT, _m_firstAOHIforT, _m_firstOHIforT, _m_initialized, _m_jointActionHistoryTreeRoot, _m_jointActionObservationHistoryTreeRoot, _m_jointObservationHistoryTreeRoot, _m_nrActionHistories, _m_nrActionHistoriesT, _m_nrActionObservationHistories, _m_nrActionObservationHistoriesT, _m_nrJointActionHistories, _m_nrJointActionObservationHistories, _m_nrJointObservationHistories, _m_nrObservationHistories, _m_nrObservationHistoriesT, _m_params, PlanningUnitMADPDiscreteParameters::GetComputeIndividualActionHistories(), PlanningUnitMADPDiscreteParameters::GetComputeIndividualActionObservationHistories(), PlanningUnitMADPDiscreteParameters::GetComputeIndividualObservationHistories(), PlanningUnitMADPDiscreteParameters::GetComputeJointActionHistories(), PlanningUnitMADPDiscreteParameters::GetComputeJointActionObservationHistories(), PlanningUnitMADPDiscreteParameters::GetComputeJointObservationHistories(), JointActionObservationHistoryTree::Print(), TreeNode< Tcontained >::Print(), PlanningUnitMADPDiscreteParameters::Print(), PrintActionHistories(), PrintActionObservationHistories(), PrintObservationHistories(), and PrintTools::PrintVectorCout().
Referenced by Initialize().
void PlanningUnitMADPDiscrete::PrintActionHistories | ( | ) |
Prints the action histories for all agents.
References _m_actionHistoryTreeRootPointers, and GetNrAgents().
Referenced by Print().
void PlanningUnitMADPDiscrete::PrintActionObservationHistories | ( | ) |
Prints the actionObservation histories for all agents.
References _m_actionObservationHistoryTreeRootPointers, _m_params, PlanningUnitMADPDiscreteParameters::GetComputeIndividualActionObservationHistories(), and GetNrAgents().
Referenced by Print().
void PlanningUnitMADPDiscrete::PrintObservationHistories | ( | ) |
Prints the observation histories for all agents.
References _m_observationHistoryTreeRootPointers, and GetNrAgents().
Referenced by Print().
void PlanningUnitMADPDiscrete::RegisterJointActionObservationHistoryTree | ( | JointActionObservationHistoryTree * | jaoht | ) |
Register a new jaoht in the vector of indices.
References _m_jointActionObservationHistoryTreeMap, Globals::CastLIndexToIndex(), and TreeNode< Tcontained >::GetIndex().
|
protectedvirtual |
Do some sanity checks, can be overridden.
Reimplemented in PlanningUnitDecPOMDPDiscrete, and PlanningUnitTOIDecPOMDPDiscrete.
Referenced by Initialize(), and PlanningUnitDecPOMDPDiscrete::SanityCheck().
|
virtual |
Sets the horizon for the planning problem.
Also reinitializes the planning unit.
Reimplemented from PlanningUnit.
References Deinitialize(), Initialize(), and PlanningUnit::SetHorizon().
void PlanningUnitMADPDiscrete::SetParams | ( | const PlanningUnitMADPDiscreteParameters & | params | ) |
Sets the parameters for this planning unit.
Also reinitializes the planning unit.
References _m_params, Deinitialize(), and Initialize().
Referenced by NullPlanner::NullPlanner(), NullPlannerFactored::NullPlannerFactored(), and NullPlannerTOI::NullPlannerTOI().
void PlanningUnitMADPDiscrete::SetProblem | ( | MultiAgentDecisionProcessDiscreteInterface * | madp | ) |
Sets the problem for which to plan, using a pointer.
Also reinitializes the planning unit.
References _m_madp, DEBUG_PUD, Deinitialize(), Initialize(), PlanningUnit::SetProblem(), and MultiAgentDecisionProcessDiscreteInterface::SoftPrint().
Referenced by PlanningUnitDecPOMDPDiscrete::SetProblem().
soft prints action actionI of agent agentI.
Implements Interface_ProblemToPolicyDiscrete.
References GetAction().
Referenced by PolicyToDotGraph(), JointPolicyPureVectorForClusteredBG::RecursivelyPrintPolicyForAgent(), and JointPolicyPureVectorForClusteredBG::StartRecursiveSoftPrintPerAgent().
soft prints ObservationHistory ohIndex of agent agentI.
References _m_params, PlanningUnitMADPDiscreteParameters::GetComputeIndividualObservationHistories(), NamedDescribedEntity::GetName(), GetObservation(), GetObservationHistoryArrays(), GetObservationHistoryTree(), and GetTimeStepForOHI().
Referenced by JointPolicyPureVectorForClusteredBG::RecursivelyPrintPolicyForAgent(), SoftPrintPolicyDomainElement(), and JointPolicyPureVectorForClusteredBG::StartRecursiveSoftPrintPerAgent().
|
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.
References PolicyGlobals::AOHIST_INDEX, GetActionObservationHistoryTree(), PolicyGlobals::OHIST_INDEX, SoftPrintObservationHistory(), and PolicyGlobals::TYPE_INDEX.
|
protected |
A vector that stores pointers to the roots of the action history trees of each agent.
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.
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.
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.
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.
Referenced by CreateActionHistoryTree(), DeInitializeActionHistories(), GetSuccessorAHI(), GetTimeStepForAHI(), InitializeActionHistories(), and Print().
|
protected |
The _m_firstAOHIforT[aI][t] contains the first actionObservation history for time-step t of agent aI.
Referenced by CreateActionObservationHistoryTree(), DeInitializeActionObservationHistories(), GetActionObservationHistoryIndex(), GetNrPolicyDomainElements(), GetSuccessorAOHI(), GetTimeStepForAOHI(), InitializeActionObservationHistories(), and Print().
|
protected |
The _m_firstJAHIforT[t] contains the first joint action history for time-step t.
Referenced by DeInitializeJointActionHistories(), GetJointActionHistoryIndex(), GetSuccessorJAHI(), GetTimeStepForJAHI(), and InitializeJointActionHistories().
|
protected |
_m_firstJAOHIforT[t] contains the first joint actionObservation history for time-step t.
Referenced by DeInitializeJointActionObservationHistories(), GetJointActionObservationHistoryIndex(), GetSuccessorJAOHI(), GetTimeStepForJAOHI(), and InitializeJointActionObservationHistories().
|
protected |
The _m_firstJOHIforT[t] contains the first joint observation history for time-step t.
Referenced by DeInitializeJointObservationHistories(), GetJointObservationHistoryIndex(), GetSuccessorJOHI(), GetTimeStepForJOHI(), and InitializeJointObservationHistories().
|
protected |
The _m_firstOHIforT[aI][t] contains the first observation history for time-step t of agent aI.
Referenced by CreateObservationHistoryTree(), DeInitializeObservationHistories(), GetNrPolicyDomainElements(), GetObservationHistoryIndex(), GetSuccessorOHI(), GetTimeStepForOHI(), InitializeObservationHistories(), and Print().
|
private |
A bool indicating whether this Planning unit has been initialized.
Referenced by Deinitialize(), Initialize(), PlanningUnitMADPDiscrete(), and Print().
|
protected |
Stores the conditional probability of this joint belief.
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 )
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)
Referenced by DeInitializeJointActionObservationHistories(), GetJAOHProbs(), GetJointBeliefInterface(), and InitializeJointActionObservationHistories().
|
protected |
The root node of the joint action histories tree.
Referenced by DeInitializeJointActionHistories(), InitializeJointActionHistories(), and Print().
|
protected |
A vector which stores a JointActionHistoryTree pointer.
Used to give access to the all JointActionHistoryTree by index.
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.
Referenced by DeInitializeJointActionObservationHistories(), GetJointActionObservationHistoryTree(), InitializeJointActionObservationHistories(), and RegisterJointActionObservationHistoryTree().
|
protected |
The root node of the joint actionObservation histories tree.
Referenced by DeInitializeJointActionObservationHistories(), InitializeJointActionObservationHistories(), and Print().
|
protected |
A vector which stores JointActionObservationHistoryTree pointer.
Used to give access to the all JointActionObservationHistoryTree by index.
Referenced by DeInitializeJointActionObservationHistories(), GetJointActionObservationHistoryIndex(), GetJointActionObservationHistoryTree(), InitializeJointActionObservationHistories(), and JointToIndividualActionObservationHistoryIndicesRef().
|
protected |
The root node of the joint observation histories tree.
Referenced by DeInitializeJointObservationHistories(), InitializeJointObservationHistories(), and Print().
|
protected |
A vector which stores a JointObservationHistoryTree pointer.
Used to give access to the all JointObservationHistoryTree by index.
Referenced by DeInitializeJointObservationHistories(), GetJointObservationHistoryIndex(), GetJointObservationHistoryTree(), InitializeJointObservationHistories(), and JointToIndividualObservationHistoryIndicesRef().
|
private |
Referenced by GetMADPDI(), Initialize(), and SetProblem().
|
protected |
A vector that keeps track of the number of action histories per agent.
Referenced by CreateActionHistoryTree(), DeInitializeActionHistories(), GetNrActionHistories(), InitializeActionHistories(), and Print().
|
protected |
A vector that keeps track of the number of action histories per agent per time step.
_m_nrActionHistoriesT[agentI][t]
Referenced by CreateActionHistoryTree(), CreateActionObservationHistoryTree(), DeInitializeActionHistories(), InitializeActionHistories(), InitializeJointActionHistories(), InitializeJointActionObservationHistories(), and Print().
|
protected |
A vector that keeps track of the number of action-obs.
histories per agent.
Referenced by CreateActionObservationHistoryTree(), DeInitializeActionObservationHistories(), InitializeActionObservationHistories(), and Print().
|
protected |
Keeps track of the number of action-obs.
histories per agent per time step. _m_nrActionObservationHistoriesT[agentI][t]
Referenced by CreateActionObservationHistoryTree(), DeInitializeActionObservationHistories(), InitializeActionObservationHistories(), and Print().
|
protected |
The number of joint action histories.
Referenced by DeInitializeJointActionHistories(), GetJointActionHistoryIndex(), GetJointActionHistoryTree(), InitializeJointActionHistories(), JointToIndividualActionHistoryIndicesRef(), and Print().
|
protected |
The number of joint action histories per time-step.
Referenced by DeInitializeJointActionHistories(), and InitializeJointActionHistories().
|
protected |
The number of joint actionAction histories.
Referenced by DeInitializeJointActionObservationHistories(), GetJointActionObservationHistoryIndex(), GetNrJointActionObservationHistories(), InitializeJointActionObservationHistories(), JointToIndividualActionObservationHistoryIndicesRef(), and Print().
|
protected |
The number of joint actionObservation histories per time-step.
Referenced by DeInitializeJointActionObservationHistories(), and InitializeJointActionObservationHistories().
|
protected |
The number of joint observation histories.
Referenced by DeInitializeJointObservationHistories(), GetJointObservationHistoryIndex(), GetJointObservationHistoryTree(), GetNrJointObservationHistories(), InitializeJointObservationHistories(), JointToIndividualObservationHistoryIndicesRef(), and Print().
|
protected |
The number of joint observation histories per time-step.
Referenced by DeInitializeJointObservationHistories(), and InitializeJointObservationHistories().
|
protected |
A vector that keeps track of the number of observation histories per agent.
Referenced by CreateObservationHistoryTree(), DeInitializeObservationHistories(), GetNrObservationHistories(), InitializeObservationHistories(), and Print().
|
protected |
Keeps track of the number of observation histories per agent per time step.
_m_nrObservationHistoriesT[agentI][t]
Referenced by CreateObservationHistoryTree(), DeInitializeObservationHistories(), InitializeJointActionObservationHistories(), InitializeJointObservationHistories(), InitializeObservationHistories(), and Print().
|
protected |
A vector that stores pointers to the roots of the observation history trees of each agent.
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.
Referenced by CreateObservationHistoryTree(), DeInitializeObservationHistories(), GetObservationHistoryTree(), and InitializeObservationHistories().
|
private |
The parameters for this planning unit.
Referenced by AreCachedJointToIndivIndices(), DeInitializeJointActionObservationHistories(), GetJAOHProbGivenPred(), GetJAOHProbs(), GetJointActionObservationHistoryTree(), GetJointBeliefInterface(), GetNewJointBeliefInterface(), GetObservationHistoryTree(), GetSuccessorAHI(), GetSuccessorAOHI(), GetSuccessorJAHI(), GetSuccessorJAOHI(), GetSuccessorJOHI(), GetSuccessorOHI(), GetTimeStepForAHI(), GetTimeStepForAOHI(), GetTimeStepForJAHI(), GetTimeStepForJAOHI(), GetTimeStepForJOHI(), GetTimeStepForOHI(), InitializeActionHistories(), InitializeActionObservationHistories(), InitializeJointActionHistories(), InitializeJointActionObservationHistories(), InitializeJointObservationHistories(), InitializeObservationHistories(), PlanningUnitMADPDiscrete(), Print(), PrintActionObservationHistories(), SetParams(), and SoftPrintObservationHistory().