MultiAgentDecisionProcess
|
FactoredDecPOMDPDiscreteInterface is the interface for a Dec-POMDP with factored states. More...
#include <FactoredDecPOMDPDiscreteInterface.h>
Public Member Functions | |
virtual FactoredDecPOMDPDiscreteInterface * | Clone () const =0 |
Returns a pointer to a copy of this class. More... | |
virtual const Scope & | GetAgentScopeForLRF (Index LRF) const =0 |
Get all the agents in the scope of an LRF. More... | |
virtual const FactoredQFunctionScopeForStage | GetImmediateRewardScopes () const =0 |
Returns all scopes of the immediate reward function in one object. More... | |
virtual RewardModel * | GetLRF (Index LRF) const =0 |
Returns a pointer to the LRF-th reward model component. More... | |
virtual double | GetLRFReward (Index LRF, Index s_e, Index ja_e) const =0 |
Returns reward for LRF, given ja_e - the joint index for a group action for the subset of agents as specified by the agent scope of LRF. More... | |
virtual double | GetLRFReward (Index LRF, const std::vector< Index > &sI_e, const std::vector< Index > &jaI_e) const =0 |
virtual double | GetLRFRewardFlat (Index LRF, Index flat_s, Index full_ja) const =0 |
might be necessary? Returns reward for LRF, given a flat state index, and a full joint action. More... | |
virtual size_t | GetNrLRFs () const =0 |
Get the number of LRFs in the factored representation. More... | |
virtual double | GetReward (const std::vector< Index > &sIs, const std::vector< Index > &aIs) const =0 |
virtual const Scope & | GetStateFactorScopeForLRF (Index LRF) const =0 |
Get all the state factors in the scope of an LRF. More... | |
virtual void | Print () const =0 |
virtual Index | RestrictedActionVectorToJointIndex (Index LRF, const std::vector< Index > &actionVec_e) const =0 |
convert an action vector of restricted scope to a joint index a_e. More... | |
virtual Index | RestrictedStateVectorToJointIndex (Index LRF, const std::vector< Index > &stateVec_e) const =0 |
Get the vector of Factor indices corresponding to stateI. More... | |
virtual std::string | SoftPrint () const =0 |
Prints some information on the MultiAgentDecisionProcessDiscreteInterface. More... | |
virtual | ~FactoredDecPOMDPDiscreteInterface () |
(default) Constructor More... | |
Public Member Functions inherited from DecPOMDPDiscreteInterface | |
virtual void | CreateNewRewardModel ()=0 |
Creates a new reward model mapping. More... | |
virtual double | GetReward (Index sI, Index jaI) const =0 |
Return the reward for state, joint action indices. More... | |
virtual RGet * | GetRGet () const =0 |
virtual void | SetReward (Index sI, Index jaI, double r)=0 |
Set the reward for state, joint action indices. More... | |
virtual void | SetReward (Index sI, Index jaI, Index sucSI, double r)=0 |
Set the reward for state, joint action , suc. state indices. More... | |
virtual void | SetReward (Index sI, Index jaI, Index sucSI, Index joI, double r)=0 |
Set the reward for state, joint action, suc.state, joint obs indices. More... | |
virtual | ~DecPOMDPDiscreteInterface () |
import the GetReward function from the base class in current scope. More... | |
Public Member Functions inherited from DecPOMDPInterface | |
virtual double | GetDiscount () const =0 |
Returns the discount parameter. More... | |
virtual double | GetReward (State *s, JointAction *ja) const =0 |
Function that returns the reward for a state and joint action. More... | |
virtual reward_t | GetRewardType () const =0 |
Returns the reward type. More... | |
virtual void | SetDiscount (double d)=0 |
Sets the discount parameter to 0 < d <= 1. More... | |
virtual void | SetReward (State *s, JointAction *ja, double r)=0 |
Function that sets the reward for a state and joint action. More... | |
virtual void | SetRewardType (reward_t r)=0 |
Sets the reward type to reward_t r. More... | |
virtual | ~DecPOMDPInterface () |
Virtual destructor. More... | |
Public Member Functions inherited from POSGInterface | |
virtual double | GetDiscountForAgent (Index agentI) const =0 |
Returns the discount parameter. More... | |
virtual double | GetRewardForAgent (Index agentI, State *s, JointAction *ja) const =0 |
Function that returns the reward for a state and joint action. More... | |
virtual reward_t | GetRewardTypeForAgent (Index agentI) const =0 |
Returns the reward type. More... | |
virtual void | SetDiscountForAgent (Index agentI, double d)=0 |
Sets the discount parameter to 0 < d <= 1. More... | |
virtual void | SetRewardForAgent (Index agentI, State *s, JointAction *ja, double r)=0 |
Function that sets the reward for an agent, state and joint action. More... | |
virtual void | SetRewardTypeForAgent (Index agentI, reward_t r)=0 |
Sets the reward type to reward_t r. More... | |
virtual | ~POSGInterface () |
Virtual destructor. More... | |
Public Member Functions inherited from MultiAgentDecisionProcessInterface | |
virtual const Scope & | GetAllAgentScope () const =0 |
virtual size_t | GetNrAgents () const =0 |
Return the number of agents. More... | |
virtual std::string | GetUnixName () const =0 |
Returns the base part of the problem filename. More... | |
virtual | ~MultiAgentDecisionProcessInterface () |
Destructor. More... | |
Public Member Functions inherited from MultiAgentDecisionProcessDiscreteInterface | |
virtual const Action * | GetAction (Index agentI, Index a) const =0 |
Return a ref to the a-th action of agent agentI. More... | |
virtual bool | GetEventObservability () const |
Whether observation models are P(o|s,a) or P(o|s,a,s'). More... | |
virtual double | GetInitialStateProbability (Index sI) const =0 |
virtual StateDistribution * | GetISD () const =0 |
Returns the complete initial state distribution. More... | |
virtual const JointAction * | GetJointAction (Index i) const =0 |
Return a ref to the i-th joint action. More... | |
virtual const JointObservation * | GetJointObservation (Index i) const =0 |
Return a ref to the i-th joint observation. More... | |
virtual const std::vector < size_t > & | GetNrActions () const =0 |
Return the number of actions vector. More... | |
virtual size_t | GetNrActions (Index AgentI) const =0 |
Return the number of actions of agent agentI. More... | |
virtual size_t | GetNrJointActions () const =0 |
Return the number of joint actions. More... | |
virtual size_t | GetNrJointActions (const Scope &agScope) const =0 |
Get the number of joint actions the agents in agScope can form. More... | |
virtual size_t | GetNrJointObservations () const =0 |
Return the number of joint observations. More... | |
virtual const std::vector < size_t > & | GetNrObservations () const =0 |
Return the number of observations vector. More... | |
virtual size_t | GetNrObservations (Index AgentI) const =0 |
Return the number of observations of agent agentI. More... | |
virtual size_t | GetNrStates () const =0 |
Return the number of states. More... | |
virtual const Observation * | GetObservation (Index agentI, Index a) const =0 |
Return a ref to the a-th observation of agent agentI. More... | |
virtual const ObservationModelDiscrete * | GetObservationModelDiscretePtr () const =0 |
Returns a pointer to the underlying observation model. More... | |
virtual double | GetObservationProbability (Index jaI, Index sucSI, Index joI) const =0 |
Return the probability of joint observation joI: P(joI|jaI,sucSI). More... | |
virtual double | GetObservationProbability (Index sI, Index jaI, Index sucSI, Index joI) const |
virtual OGet * | GetOGet () const =0 |
virtual const State * | GetState (Index i) const =0 |
Returns a pointer to state i. More... | |
virtual TGet * | GetTGet () const =0 |
virtual const TransitionModelDiscrete * | GetTransitionModelDiscretePtr () const =0 |
Returns a pointer to the underlying transition model. More... | |
virtual double | GetTransitionProbability (Index sI, Index jaI, Index sucSI) const =0 |
Return the probability of successor state sucSI: P(sucSI|sI,jaI). More... | |
virtual Index | IndividualToJointActionIndices (const Index *AI_ar) const =0 |
Returns the joint action index that corresponds to the array of specified individual action indices. More... | |
virtual Index | IndividualToJointActionIndices (const std::vector< Index > &indivActionIndices) const =0 |
Returns the joint action index that corresponds to the vector of specified individual action indices. More... | |
virtual Index | IndividualToJointActionIndices (const std::vector< Index > &ja_e, const Scope &agSC) const =0 |
indiv->joint for a restricted set (Scope) of agents More... | |
virtual Index | IndividualToJointObservationIndices (const std::vector< Index > &indivObservationIndices) const =0 |
Returns the joint observation index that corresponds to the vector of specified individual observation indices. More... | |
virtual Index | IndividualToJointObservationIndices (const std::vector< Index > &jo_e, const Scope &agSC) const |
indiv->joint for a restricted set (Scope) of agents More... | |
virtual const std::vector < Index > & | JointToIndividualActionIndices (Index jaI) const =0 |
Returns a vector of indices to indiv. More... | |
virtual std::vector< Index > | JointToIndividualActionIndices (Index ja_e, const Scope &agSC) const =0 |
joint->indiv for a restricted set (Scope) of agents More... | |
virtual const std::vector < Index > & | JointToIndividualObservationIndices (Index joI) const =0 |
Returns a vector of indices to indiv. More... | |
virtual std::vector< Index > | JointToIndividualObservationIndices (Index jo_e, const Scope &agSC) const |
joint->indiv for a restricted set (Scope) of agents More... | |
virtual Index | JointToRestrictedJointActionIndex (Index jaI, const Scope &agSc_e) const =0 |
Converts a global joint action index jaI to a restricted joint action index ja_e, for agents scope agSc_e Returns a vector of indices to indiv. More... | |
virtual Index | JointToRestrictedJointObservationIndex (Index joI, const Scope &agSc_e) const |
Converts a global joint observation index joI to a restricted joint observation index jo_e, for agents scope agSc_e Returns a vector of indices to indiv. More... | |
virtual Index | SampleInitialState () const =0 |
Sample a state according to the initial state PDF. More... | |
virtual Index | SampleJointObservation (Index jaI, Index sucI) const =0 |
Sample an observation - needed for simulations. More... | |
virtual Index | SampleJointObservation (Index sI, Index jaI, Index sucI) const |
virtual Index | SampleSuccessorState (Index sI, Index jaI) const =0 |
Sample a successor state - needed by simulations. More... | |
virtual | ~MultiAgentDecisionProcessDiscreteInterface () |
Destructor. More... | |
Public Member Functions inherited from MultiAgentDecisionProcessDiscreteFactoredStatesInterface | |
virtual Scope | AgentScopeBackup (const Scope &stateScope, const Scope &agentScope) const =0 |
virtual void | CacheFlatModels (bool sparse) |
virtual Index | FactorValueIndicesToStateIndex (const std::vector< Index > &fv) const =0 |
convert std::vector of (indices of) factor values to (flat) state index. More... | |
virtual Index | FactorValueIndicesToStateIndex (const std::vector< Index > &s_e_vec, const Scope &sfSC) const =0 |
convert an local state vector s_e_vec of scope sfScope to a joint index. More... | |
virtual const TwoStageDynamicBayesianNetwork * | Get2DBN () const |
Copy assignment operator. More... | |
virtual const Scope & | GetAllStateFactorScope () const =0 |
Convenience function to quickly get the full state scope. More... | |
virtual const FactoredStateDistribution * | GetFactoredISD () const =0 |
virtual size_t | GetNrStateFactorInstantiations (const Scope &sfScope) const =0 |
Get the number of joint instantiations for the factors in sfScope. More... | |
virtual size_t | GetNrStateFactors () const =0 |
Get the number of state components. -no is inherited from. More... | |
virtual const size_t | GetNrValuesForFactor (Index sf) const =0 |
Get the number of possible values for a particular factor. More... | |
virtual const std::vector < size_t > & | GetNrValuesPerFactor () const =0 |
Get the number of possible assignments or values to each factor. More... | |
virtual const StateFactorDiscrete * | GetStateFactorDiscrete (Index sfacI) const =0 |
virtual void | SampleInitialState (std::vector< Index > &sIs) const =0 |
virtual void | SampleJointObservation (const std::vector< Index > &aIs, const std::vector< Index > &sucIs, std::vector< Index > &oIs) const =0 |
virtual void | SampleSuccessorState (const std::vector< Index > &sIs, const std::vector< Index > &aIs, std::vector< Index > &sucIs) const =0 |
std::string | SoftPrintState (Index sI) const |
SoftPrints information on the MultiAgentDecisionProcessDiscrete. More... | |
virtual Index | StateIndexToFactorValueIndex (Index factor, Index s) const =0 |
Get the value of a particular state factor given a joint flat state. More... | |
virtual std::vector< Index > | StateIndexToFactorValueIndices (Index stateI) const =0 |
Get the vector of FactorValue indices corresponding to stateI used to be called virtual vector<Index> GetStateFactorValues(Index stateI) const. More... | |
virtual std::vector< Index > | StateIndexToFactorValueIndices (Index s_e, const Scope &sfSC) const =0 |
convert an local state index s_e to a vector of state factors (with scope sfScope). More... | |
virtual Scope | StateScopeBackup (const Scope &stateScope, const Scope &agentScope) const =0 |
virtual | ~MultiAgentDecisionProcessDiscreteFactoredStatesInterface () |
(default) Constructor More... | |
FactoredDecPOMDPDiscreteInterface is the interface for a Dec-POMDP with factored states.
It declares the get/set reward functions.
FactoredDecPOMDPDiscrete represents a factored DecPOMDPDiscrete FactoredDecPOMDPDiscreteInterface is an interface (i.e. pure abstract class) for a discrete factored DEC-POMDP model. Classes that implement this interface are, for instance, FactoredDecPOMDPDiscrete.
Because a factored Dec-POMDP can also be accessed as a regular Dec-POMDP (i.e., by indexing 'flat' states), this interface also derives from DecPOMDPDiscreteInterface (which defines the get/set-reward functions for a regular (non-factored) discrete Dec-POMDP).
The `LRFs' in this code refer to edges of the graph constructed from the factored immediate reward function. (i.e., each `edge' corresponds to a local reward function)
a `flat state' - a state s=<x_1...x_nrFactors> (which specifies a value for each state factor).
a `full joint action' - a joint action that specifies an action for each individual agent.
a `joint/group action' - an action for a subset of agents.
|
inlinevirtual |
(default) Constructor
Destructor.Can't make a virt.destr. pure abstract!
|
pure virtual |
Returns a pointer to a copy of this class.
Implements DecPOMDPDiscreteInterface.
Implemented in FactoredDecPOMDPDiscrete, ProblemFireFightingFactored, ProblemAloha, ProblemFOBSFireFightingFactored, and FactoredMMDPDiscrete.
|
pure virtual |
Get all the agents in the scope of an LRF.
Implemented in FactoredDecPOMDPDiscrete.
|
pure virtual |
Returns all scopes of the immediate reward function in one object.
Implemented in FactoredDecPOMDPDiscrete.
|
pure virtual |
Returns a pointer to the LRF-th reward model component.
Implemented in FactoredDecPOMDPDiscrete.
|
pure virtual |
Returns reward for LRF, given ja_e - the joint index for a group action for the subset of agents as specified by the agent scope of LRF.
s_e - the (joint) index of the subset of factors specified by the state factor scope of LRF.
For instance, let the agents scope of LRF be <1,3>, then group action <3,5> means that agent 1 select action 3, while agent 3 performs its 5th action. Using indextools we can find agSc_jaI. E.g. agSc_jaI = IndividualToJointIndices( <3,5>, <6,6> ) (where <6,6> is a vector which specifies the number of actions per agent, see IndexTools.h for more info).
Implemented in FactoredDecPOMDPDiscrete.
Referenced by FactoredQLastTimeStepOrElse::GetLocalQValue().
|
pure virtual |
Implemented in FactoredDecPOMDPDiscrete.
|
pure virtual |
might be necessary? Returns reward for LRF, given a flat state index, and a full joint action.
Implemented in FactoredDecPOMDPDiscrete.
|
pure virtual |
Get the number of LRFs in the factored representation.
Implemented in FactoredDecPOMDPDiscrete.
Referenced by FactoredQLastTimeStepOrElse::Initialize().
|
pure virtual |
Implemented in FactoredDecPOMDPDiscrete.
Referenced by SimulationFactoredDecPOMDPDiscrete::Step().
|
pure virtual |
Get all the state factors in the scope of an LRF.
Implemented in FactoredDecPOMDPDiscrete.
Referenced by FactoredQLastTimeStepOrElse::GetStateFactorScopeForLQF().
|
pure virtual |
Implemented in FactoredDecPOMDPDiscrete.
|
pure virtual |
convert an action vector of restricted scope to a joint index a_e.
This is a convenience function that performs indiv->joint action index conversion for a specific edge e (LRF). (i.e., this function is typically called when requesting the immediate reward)
Implemented in FactoredDecPOMDPDiscrete.
|
pure virtual |
Get the vector of Factor indices corresponding to stateI.
convert a state vector of restricted scope to a joint index s_e.
This is a convenience function that performs indiv->joint state index conversion for a specific edge e (LRF).
Implemented in FactoredDecPOMDPDiscrete.
Referenced by FactoredQLastTimeStepOrElse::GetLocalQValue().
|
pure virtual |
Prints some information on the MultiAgentDecisionProcessDiscreteInterface.
Implements MultiAgentDecisionProcessDiscreteInterface.
Implemented in FactoredDecPOMDPDiscrete, and FactoredMMDPDiscrete.