MultiAgentDecisionProcess  Release 0.2.1
PerseusStationary Class Reference

PerseusStationary is Perseus for stationary policies. More...

#include <PerseusStationary.h>

+ Inheritance diagram for PerseusStationary:
+ Collaboration diagram for PerseusStationary:

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.
- Public Member Functions inherited from Perseus
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.
- Public Member Functions inherited from AlphaVectorPlanning
 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.
- Public Member Functions inherited from TimedAlgorithm
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 Member Functions

std::vector< double > GetImmediateRewardBeliefSet () const
void InitializeBeliefs (int nrB, bool uniquify)
void StoreValueFunction (const ValueFunctionPOMDPDiscrete &V)
void StoreValueFunction (const QFunctionsDiscrete &Q)
- Protected Member Functions inherited from Perseus
GaoVectorSet BackupStageLeadIn (const ValueFunctionPOMDPDiscrete &V) const
void BackupStageLeadOut (GaoVectorSet Gao) const
QFunctionsDiscreteNonStationary GetInitialNonStationaryQFunctions () const
QFunctionsDiscrete GetInitialQFunctions () const
ValueFunctionPOMDPDiscrete GetInitialValueFunction () const
template<class VF >
void PlanEndOfIteration (const VF &V)
void PlanEndOfIteration () const
void PlanLeadIn ()
void PlanLeadOut ()
template<class VF >
void PlanStartOfIteration (int iter, const std::vector< double > &VB, const VF &V) const
void PrintMaxRewardInBeliefSet () const
 Prints the maximum immediate reward present in the belief set.
virtual void StoreValueFunction (const QFunctionsDiscreteNonStationary &Q)
void UpdateValueFunctionName ()

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.
- Protected Attributes inherited from Perseus
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 Public Member Functions inherited from Perseus
static std::string BackupTypeToString (const QAVParameters &params)
static QAVParameters ProcessArguments (const ArgumentHandlers::Arguments &args)

Detailed Description

PerseusStationary is Perseus for stationary policies.

Definition at line 37 of file PerseusStationary.h.

Constructor & Destructor Documentation

PerseusStationary::PerseusStationary ( const PlanningUnitDecPOMDPDiscrete pu)

(default) Constructor

Definition at line 34 of file PerseusStationary.cpp.

PerseusStationary::~PerseusStationary ( )
virtual

Destructor.

Definition at line 41 of file PerseusStationary.cpp.

References _m_beliefs, and Perseus::_m_beliefsInitialized.

Member Function Documentation

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.

void PerseusStationary::ExportValueFunction ( const std::string &  filename) const
virtual

Calls AlphaVectorPlanning::ExportValueFunction.

Implements Perseus.

Definition at line 97 of file PerseusStationary.cpp.

References _m_valueFunction.

std::vector< double > PerseusStationary::GetImmediateRewardBeliefSet ( ) const
protectedvirtual
double PerseusStationary::GetQ ( const JointBeliefInterface b,
Index  jaI 
) const
virtual

Implements Perseus.

Definition at line 47 of file PerseusStationary.cpp.

References _m_qFunction, and BeliefValue::GetValue().

double PerseusStationary::GetQ ( const JointBeliefInterface b,
Index  jaI,
int &  betaMaxI 
) const
virtual
double PerseusStationary::GetQ ( const JointBeliefInterface b,
Index  t,
Index  jaI 
) const
virtual

Implements Perseus.

Definition at line 61 of file PerseusStationary.cpp.

double PerseusStationary::GetQ ( const JointBeliefInterface b,
Index  t,
Index  jaI,
int &  betaMaxI 
) const
virtual

Implements Perseus.

Definition at line 68 of file PerseusStationary.cpp.

QFunctionsDiscrete PerseusStationary::GetQFunctions ( ) const
inline

Definition at line 77 of file PerseusStationary.h.

References _m_qFunction.

ValueFunctionPOMDPDiscrete PerseusStationary::GetValueFunction ( ) const
inline

Definition at line 74 of file PerseusStationary.h.

References _m_valueFunction.

void PerseusStationary::InitializeBeliefs ( int  nrB,
bool  uniquify 
)
protectedvirtual
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().

void PerseusStationary::SetValueFunction ( const std::string &  filename)
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().

void PerseusStationary::StoreValueFunction ( const ValueFunctionPOMDPDiscrete V)
protectedvirtual

Reimplemented from Perseus.

Definition at line 127 of file PerseusStationary.cpp.

References _m_qFunction, _m_valueFunction, and AlphaVectorPlanning::ValueFunctionToQ().

void PerseusStationary::StoreValueFunction ( const QFunctionsDiscrete Q)
protectedvirtual

Reimplemented from Perseus.

Definition at line 135 of file PerseusStationary.cpp.

References _m_qFunction, and _m_valueFunction.

Member Data Documentation

BeliefSet* PerseusStationary::_m_beliefs
protected
QFunctionsDiscrete PerseusStationary::_m_qFunction
protected

The resulting Q functions, derived from _m_valueFunction.

Definition at line 46 of file PerseusStationary.h.

Referenced by GetQ(), GetQFunctions(), SetValueFunction(), and StoreValueFunction().

ValueFunctionPOMDPDiscrete PerseusStationary::_m_valueFunction
protected

The resulting value function.

Definition at line 44 of file PerseusStationary.h.

Referenced by ExportValueFunction(), GetValueFunction(), SetValueFunction(), and StoreValueFunction().


The documentation for this class was generated from the following files: