MultiAgentDecisionProcess
Release 0.2.1
|
PerseusStationary is Perseus for stationary policies. More...
#include <PerseusStationary.h>
Public Member Functions | |
void | ExportBeliefSet (const std::string &filename) const |
Exports the belief set in a simple matrix format. | |
void | ExportValueFunction (const std::string &filename) const |
Calls AlphaVectorPlanning::ExportValueFunction. | |
double | GetQ (const JointBeliefInterface &b, Index jaI) const |
double | GetQ (const JointBeliefInterface &b, Index jaI, int &betaMaxI) const |
double | GetQ (const JointBeliefInterface &b, Index t, Index jaI) const |
double | GetQ (const JointBeliefInterface &b, Index t, Index jaI, int &betaMaxI) const |
QFunctionsDiscrete | GetQFunctions () const |
ValueFunctionPOMDPDiscrete | GetValueFunction () const |
PerseusStationary (const PlanningUnitDecPOMDPDiscrete &pu) | |
(default) Constructor | |
void | SetBeliefSet (const BeliefSet &S) |
Sets the belief set S that Perseus should use. | |
void | SetValueFunction (const std::string &filename) |
Sets the value function. | |
virtual | ~PerseusStationary () |
Destructor. | |
![]() | |
bool | CheckConvergence (const std::vector< double > &VB, const std::vector< double > &VBnew, int iter) const |
std::string | GetIdentification () const |
int | GetVerbose () const |
void | Initialize () |
Perseus (const PlanningUnitDecPOMDPDiscrete &pu) | |
(default) Constructor | |
virtual void | Plan ()=0 |
int | SampleNotImprovedBeliefIndex (std::vector< bool > stillNeedToBeImproved, int nrNotImproved) const |
Sample an index of a belief in the set which has not been improved. | |
void | SetComputeVectorForEachBelief (bool compute) |
void | SetDryrun (bool dryrun) |
void | SetIdentification (std::string identification) |
void | SetInitializeWithImmediateReward (bool initReward) |
void | SetInitializeWithZero (bool initZero) |
void | SetMaximumNumberOfIterations (int nr) |
void | SetMinimumNumberOfIterations (int nr) |
void | SetResultsFilename (std::string filename) |
void | SetSaveIntermediateValueFunctions (bool save) |
void | SetSaveTimings (bool save) |
void | SetVerbose (int verbose) |
virtual | ~Perseus () |
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 | 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. |
Protected Attributes | |
BeliefSet * | _m_beliefs |
The belief set. | |
QFunctionsDiscrete | _m_qFunction |
The resulting Q functions, derived from _m_valueFunction. | |
ValueFunctionPOMDPDiscrete | _m_valueFunction |
The resulting value function. | |
![]() | |
bool | _m_beliefsInitialized |
Whether or not the belief set has been set. | |
double | _m_bestValue |
bool | _m_computeVectorForEachBelief |
bool | _m_dryrun |
std::string | _m_identification |
std::string | _m_resultsFilename |
bool | _m_storeIntermediateValueFunctions |
bool | _m_storeTimings |
std::string | _m_valueFunctionFilename |
Additional Inherited Members | |
![]() | |
static std::string | BackupTypeToString (const QAVParameters ¶ms) |
static QAVParameters | ProcessArguments (const ArgumentHandlers::Arguments &args) |
PerseusStationary is Perseus for stationary policies.
Definition at line 37 of file PerseusStationary.h.
PerseusStationary::PerseusStationary | ( | const PlanningUnitDecPOMDPDiscrete & | pu | ) |
(default) Constructor
Definition at line 34 of file PerseusStationary.cpp.
|
virtual |
Destructor.
Definition at line 41 of file PerseusStationary.cpp.
References _m_beliefs, and Perseus::_m_beliefsInitialized.
void PerseusStationary::ExportBeliefSet | ( | const std::string & | filename | ) | const |
Exports the belief set in a simple matrix format.
Definition at line 85 of file PerseusStationary.cpp.
References _m_beliefs, and Perseus::_m_beliefsInitialized.
|
virtual |
Calls AlphaVectorPlanning::ExportValueFunction.
Implements Perseus.
Definition at line 97 of file PerseusStationary.cpp.
References _m_valueFunction.
|
protectedvirtual |
Implements Perseus.
Definition at line 102 of file PerseusStationary.cpp.
References _m_beliefs, AlphaVectorPlanning::GetImmediateRewardValueFunction(), AlphaVectorPlanning::GetPU(), and BeliefValue::GetValues().
|
virtual |
Implements Perseus.
Definition at line 47 of file PerseusStationary.cpp.
References _m_qFunction, and BeliefValue::GetValue().
|
virtual |
Implements Perseus.
Definition at line 52 of file PerseusStationary.cpp.
References _m_qFunction, BeliefValue::GetMaximizingVectorIndex(), and BeliefInterface::InnerProduct().
|
virtual |
Implements Perseus.
Definition at line 61 of file PerseusStationary.cpp.
|
virtual |
Implements Perseus.
Definition at line 68 of file PerseusStationary.cpp.
|
inline |
Definition at line 77 of file PerseusStationary.h.
References _m_qFunction.
|
inline |
Definition at line 74 of file PerseusStationary.h.
References _m_valueFunction.
|
protectedvirtual |
Implements Perseus.
Definition at line 119 of file PerseusStationary.cpp.
References ArgumentHandlers::Arguments::nrBeliefs, AlphaVectorPlanning::SampleBeliefs(), SetBeliefSet(), and ArgumentHandlers::Arguments::uniqueBeliefs.
void PerseusStationary::SetBeliefSet | ( | const BeliefSet & | S | ) |
Sets the belief set S that Perseus should use.
If no belief is specified, one will be sampled using default settings.
Definition at line 77 of file PerseusStationary.cpp.
References _m_beliefs, and Perseus::_m_beliefsInitialized.
Referenced by InitializeBeliefs().
|
virtual |
Sets the value function.
Also updates _m_qFunction.
Implements Perseus.
Definition at line 110 of file PerseusStationary.cpp.
References _m_qFunction, _m_valueFunction, AlphaVectorPlanning::GetPU(), AlphaVectorPlanning::ImportValueFunction(), and AlphaVectorPlanning::ValueFunctionToQ().
|
protectedvirtual |
Reimplemented from Perseus.
Definition at line 127 of file PerseusStationary.cpp.
References _m_qFunction, _m_valueFunction, and AlphaVectorPlanning::ValueFunctionToQ().
|
protectedvirtual |
Reimplemented from Perseus.
Definition at line 135 of file PerseusStationary.cpp.
References _m_qFunction, and _m_valueFunction.
|
protected |
The belief set.
Definition at line 49 of file PerseusStationary.h.
Referenced by ExportBeliefSet(), GetImmediateRewardBeliefSet(), PerseusQFunctionPlanner::Plan(), PerseusPOMDPPlanner::Plan(), SetBeliefSet(), and ~PerseusStationary().
|
protected |
The resulting Q functions, derived from _m_valueFunction.
Definition at line 46 of file PerseusStationary.h.
Referenced by GetQ(), GetQFunctions(), SetValueFunction(), and StoreValueFunction().
|
protected |
The resulting value function.
Definition at line 44 of file PerseusStationary.h.
Referenced by ExportValueFunction(), GetValueFunction(), SetValueFunction(), and StoreValueFunction().