MultiAgentDecisionProcess
Release 0.2.1
|
AlphaVectorBG implements Bayesian Game specific functionality for alpha-vector based planning. More...
#include <AlphaVectorBG.h>
Public Member Functions | |
AlphaVectorBG (const PlanningUnitDecPOMDPDiscrete &pu) | |
(default) Constructor | |
AlphaVector | BeliefBackup (const JointBeliefInterface &b, Index a, const GaoVectorSet &G, const ValueFunctionPOMDPDiscrete &V, BGBackupType type=BGIP_SOLVER_EXHAUSTIVE) const |
virtual | ~AlphaVectorBG () |
Destructor. | |
![]() | |
AlphaVectorPlanning (const PlanningUnitDecPOMDPDiscrete &pu) | |
(default) Constructor | |
GaoVectorSet | BackProject (const ValueFunctionPOMDPDiscrete &v) const |
Back projects a value function. | |
GaoVectorSet | BackProject (const VectorSet &v) const |
Back projects a value function, represented as a VectorSet. | |
GaoVectorSet | BackProjectMonahan (const QFunctionsDiscrete &Qs) const |
GaoVectorSet | BackProjectMonahan (const ValueFunctionPOMDPDiscrete &V) const |
VectorSet | CrossSum (const VectorSet &A, const VectorSet &B) const |
Compute the cross-sum of two vector sets. | |
void | ExportPOMDPFile (const std::string &filename) const |
Exports the POMDP to file named filename. | |
ValueFunctionPOMDPDiscrete | GetImmediateRewardValueFunction () const |
Returns the value function induced by the reward model. | |
const PlanningUnitDecPOMDPDiscrete * | GetPU () const |
Returns a ref to the PlanningUnit. | |
void | Initialize () |
void | MonahanCrossSum (const GaoVectorSet &G, ValueFunctionPOMDPDiscrete &V, Index a, bool doIncPrune) const |
ValueFunctionPOMDPDiscrete | Prune (const ValueFunctionPOMDPDiscrete &V) const |
Prune a valuefunction. | |
VectorSet | Prune (const VectorSet &V) const |
Prune a VectorSet. | |
BeliefSet | SampleBeliefs (ArgumentHandlers::Arguments args) const |
Sample a belief set according to the arguments. | |
QFunctionsDiscrete | ValueFunctionToQ (const ValueFunctionPOMDPDiscrete &V) const |
virtual | ~AlphaVectorPlanning () |
Destructor. | |
![]() | |
void | AddTimedEvent (const std::string &id, clock_t duration) |
Adds event of certain duration, e.g., an external program call. | |
std::vector< double > | GetTimedEventDurations (const std::string &id) |
Returns all stored durations (in s) for a particular event. | |
void | LoadTimers (const std::string &filename) |
Load timing info from file filename. | |
void | PrintTimers () const |
Print stored timing info. | |
void | PrintTimersSummary () const |
Sums data and prints out a summary. | |
void | SaveTimers (const std::string &filename) const |
Save collected timing info to file filename. | |
void | SaveTimers (std::ofstream &of) const |
Save collected timing info to ofstream of. | |
void | StartTimer (const std::string &id) const |
Start to time an event identified by id. | |
void | StopTimer (const std::string &id) const |
Stop to time an event identified by id. | |
TimedAlgorithm () | |
(default) Constructor | |
virtual | ~TimedAlgorithm () |
Destructor. |
Static Public Member Functions | |
static std::string | SoftPrintBackupType (BGBackupType bgBackupType) |
![]() | |
static void | ExportBeliefSet (const BeliefSet &B, const std::string &filename) |
Exports a belief set to a file. | |
static void | ExportPOMDPFile (const std::string &filename, const PlanningUnitDecPOMDPDiscrete *pu) |
Exports the POMDP represented by pu to file named filename. | |
static void | ExportValueFunction (const std::string &filename, const ValueFunctionPOMDPDiscrete &V) |
Exports a value function V to file named filename. | |
static void | ExportValueFunction (const std::string &filename, const QFunctionsDiscrete &Q) |
Exports a Q functions Q to file named filename. | |
static void | ExportValueFunction (const std::string &filename, const QFunctionsDiscreteNonStationary &Q) |
Exports a Q functions Q to file named filename. | |
static std::vector< int > | GetDuplicateIndices (const VectorSet &V) |
Returns a vector<int> which for each vector k in V specifies whether it is unique, in which case vector<int>[k] is set to -1, or whether it is a duplicate of another vector l in V, in which case vector<int>[k] is set to the index of l, where 0 <= l < V.size()). | |
static ValueFunctionPOMDPDiscrete | GetImmediateRewardValueFunction (const PlanningUnitDecPOMDPDiscrete *pu) |
Returns the value function induced by the reward model of pu. | |
static ValueFunctionPOMDPDiscrete | ImportValueFunction (const std::string &filename) |
Imports a value function from a file named filename. | |
static QFunctionsDiscreteNonStationary | ImportValueFunction (const std::string &filename, size_t nr, size_t nrA, size_t nrS) |
static ValueFunctionPOMDPDiscrete | QFunctionsToValueFunction (const QFunctionsDiscrete &Q) |
static QFunctionsDiscrete | ValueFunctionToQ (const ValueFunctionPOMDPDiscrete &V, size_t nrA, size_t nrS) |
static bool | VectorIsInValueFunction (const AlphaVector &alpha, const ValueFunctionPOMDPDiscrete &V) |
Private Member Functions | |
AlphaVector | BeliefBackupBGIP_Solver (const JointBeliefInterface &b, Index a, const GaoVectorSet &G, const ValueFunctionPOMDPDiscrete &V, BGBackupType type) const |
AlphaVector | BeliefBackupExhaustiveOnlyKeepMax (const JointBeliefInterface &b, Index a, const GaoVectorSet &G, const ValueFunctionPOMDPDiscrete &V) const |
AlphaVector | BeliefBackupExhaustiveStoreAll (const JointBeliefInterface &b, Index a, const GaoVectorSet &G, const ValueFunctionPOMDPDiscrete &V) const |
std::vector< std::vector< bool > > | GetMask (const ValueFunctionPOMDPDiscrete &V) const |
Private Attributes | |
BayesianGameIdenticalPayoff * | _m_bgip |
AlphaVectorBG implements Bayesian Game specific functionality for alpha-vector based planning.
Definition at line 47 of file AlphaVectorBG.h.
AlphaVectorBG::AlphaVectorBG | ( | const PlanningUnitDecPOMDPDiscrete & | pu | ) |
(default) Constructor
Definition at line 46 of file AlphaVectorBG.cpp.
References _m_bgip, MultiAgentDecisionProcessDiscreteInterface::GetNrActions(), PlanningUnitMADPDiscrete::GetNrAgents(), MultiAgentDecisionProcessDiscreteInterface::GetNrObservations(), and PlanningUnitDecPOMDPDiscrete::GetReferred().
|
virtual |
AlphaVector AlphaVectorBG::BeliefBackup | ( | const JointBeliefInterface & | b, |
Index | a, | ||
const GaoVectorSet & | G, | ||
const ValueFunctionPOMDPDiscrete & | V, | ||
BGBackupType | type = BGIP_SOLVER_EXHAUSTIVE |
||
) | const |
Definition at line 62 of file AlphaVectorBG.cpp.
References BeliefBackupBGIP_Solver(), BeliefBackupExhaustiveOnlyKeepMax(), BeliefBackupExhaustiveStoreAll(), BGIP_SOLVER_ALTERNATINGMAXIMIZATION, BGIP_SOLVER_ALTERNATINGMAXIMIZATION_100STARTS, BGIP_SOLVER_EXHAUSTIVE, AlphaVector::Equal(), EXHAUSTIVE_ONLYKEEPMAX, EXHAUSTIVE_STOREALL, BeliefInterface::Size(), TimedAlgorithm::StartTimer(), and TimedAlgorithm::StopTimer().
Referenced by PerseusBGPlanner::BackupStageAll(), PerseusBGPlanner::BackupStageSampling(), and PerseusBGPlanner::BackupStageSamplingAlt().
|
private |
Definition at line 135 of file AlphaVectorBG.cpp.
References _m_bgip, BGIP_SOLVER_ALTERNATINGMAXIMIZATION, BGIP_SOLVER_ALTERNATINGMAXIMIZATION_100STARTS, BGIP_SOLVER_EXHAUSTIVE, PlanningUnitDecPOMDPDiscrete::GetDiscount(), JointPolicyPureVector::GetIndex(), JointPolicyPureVector::GetJointActionIndex(), BayesianGameIdenticalPayoffSolver< JP >::GetJointPolicyPureVector(), GetMask(), BeliefValue::GetMaximizingVectorIndexAndValue(), PlanningUnitMADPDiscrete::GetNrJointActions(), PlanningUnitMADPDiscrete::GetNrJointObservations(), PlanningUnitMADPDiscrete::GetNrStates(), AlphaVectorPlanning::GetPU(), PlanningUnitDecPOMDPDiscrete::GetReward(), AlphaVector::SetAction(), AlphaVector::SetBetaI(), BayesianGameBase::SetProbability(), BayesianGameIdenticalPayoff::SetUtility(), AlphaVector::SetValue(), and BayesianGameIdenticalPayoffSolver< JP >::Solve().
Referenced by BeliefBackup().
|
private |
Definition at line 219 of file AlphaVectorBG.cpp.
References _m_bgip, PlanningUnitDecPOMDPDiscrete::GetDiscount(), JointPolicyPureVector::GetJointActionIndex(), GetMask(), BeliefValue::GetMaximizingVectorIndex(), PlanningUnitMADPDiscrete::GetNrJointActions(), PlanningUnitMADPDiscrete::GetNrJointObservations(), PlanningUnitMADPDiscrete::GetNrStates(), AlphaVectorPlanning::GetPU(), PlanningUnitDecPOMDPDiscrete::GetReward(), BeliefInterface::InnerProduct(), AlphaVector::SetAction(), AlphaVector::SetBetaI(), and AlphaVector::SetValue().
Referenced by BeliefBackup().
|
private |
Definition at line 317 of file AlphaVectorBG.cpp.
References _m_bgip, PlanningUnitDecPOMDPDiscrete::GetDiscount(), JointPolicyPureVector::GetJointActionIndex(), GetMask(), BeliefValue::GetMaximizingVectorIndex(), PlanningUnitMADPDiscrete::GetNrJointActions(), PlanningUnitMADPDiscrete::GetNrJointObservations(), BayesianGameBase::GetNrJointPolicies(), PlanningUnitMADPDiscrete::GetNrStates(), AlphaVectorPlanning::GetPU(), PlanningUnitDecPOMDPDiscrete::GetReward(), AlphaVector::SetAction(), AlphaVector::SetBetaI(), and AlphaVector::SetValue().
Referenced by BeliefBackup().
|
private |
Definition at line 117 of file AlphaVectorBG.cpp.
References PlanningUnitMADPDiscrete::GetNrJointActions(), and AlphaVectorPlanning::GetPU().
Referenced by BeliefBackupBGIP_Solver(), BeliefBackupExhaustiveOnlyKeepMax(), and BeliefBackupExhaustiveStoreAll().
|
static |
Definition at line 403 of file AlphaVectorBG.cpp.
References BGIP_SOLVER_ALTERNATINGMAXIMIZATION, BGIP_SOLVER_ALTERNATINGMAXIMIZATION_100STARTS, BGIP_SOLVER_EXHAUSTIVE, EXHAUSTIVE_ONLYKEEPMAX, and EXHAUSTIVE_STOREALL.
|
private |
Definition at line 51 of file AlphaVectorBG.h.
Referenced by AlphaVectorBG(), BeliefBackupBGIP_Solver(), BeliefBackupExhaustiveOnlyKeepMax(), BeliefBackupExhaustiveStoreAll(), and ~AlphaVectorBG().