AlphaPlanePool.h
Go to the documentation of this file.
00001 #ifndef AlphaPlanePool_H
00002 #define AlphaPlanePool_H
00003 
00004 #include "Bound.h"
00005 #include "Backup.h"
00006 #include "AlphaPlane.h"
00007 #include "IndexedTuple.h"
00008 #include "PruneAlphaPlane.h"
00009 
00010 #include <exception>
00011 #include <list>
00012 #include <vector>
00013 #include <stdexcept>
00014 using namespace std;
00015 using namespace momdp;
00016 namespace momdp 
00017 {
00018         class AlphaPlanePoolDataTuple :public Tuple
00019         {
00020         public:
00021                 int ALPHA_TIME_STAMP;
00022                 list<SharedPointer<AlphaPlane> >* ALPHA_PLANES; /*alpha planes which dominate at this SharedPointer<Belief> */
00023         };
00024 
00025 
00026         class AlphaPlanePool :  public Bound<AlphaPlane>
00027         {
00028         public:
00029                 AlphaPlanePool(Backup<AlphaPlane> *_backupEngine)
00030                 {
00031                         this->setBackupEngine(_backupEngine);
00032                 }
00033                 PruneAlphaPlane* pruneEngine;
00034 
00035                 virtual ~AlphaPlanePool(void)
00036                 {
00037                 }
00038 
00039 
00040 
00041                 virtual SharedPointer<AlphaPlane> backup(BeliefTreeNode * node)
00042                 {
00043                         SharedPointer<AlphaPlane> result = backupEngine->backup(node);
00044                         for(size_t i = 0 ; i < onBackup.size(); i++)
00045                         {
00046                                 (*onBackup[i])(solver, node, result);
00047                         }
00048                         throw runtime_error("Not finished...");
00049                         return result;
00050                 }
00051 
00052 
00053                 SharedPointer<MOMDP> problem;
00054                 void setProblem(SharedPointer<MOMDP> p)
00055                 {
00056                         problem = p;
00057                 }
00058                 void setSolver(PointBasedAlgorithm *p)
00059                 {
00060                         //solver = p;
00061                 }
00062                 BeliefCache *beliefCache;
00063                 void setBeliefCache(BeliefCache *p)
00064                 {
00065                         beliefCache = p;
00066                 }
00067 
00068 
00069                 IndexedTuple<AlphaPlanePoolDataTuple> *dataTable;
00070                 void setDataTable(IndexedTuple<AlphaPlanePoolDataTuple> *p)
00071                 {
00072                         dataTable = p;
00073                 }
00074 
00075                 SharedPointer<AlphaPlane> getBestAlphaPlane(SharedPointer<belief_vector>& b);
00076                 SharedPointer<AlphaPlane> getBestAlphaPlane(BeliefTreeNode& cn);        
00077                 SharedPointer<AlphaPlane> getBestAlphaPlane1(SharedPointer<belief_vector>& b);
00078                 SharedPointer<AlphaPlane> getBestAlphaPlane( SharedPointer<belief_vector>& b, int index );  //  belief, belief index
00079         
00080                 virtual double getValue(SharedPointer<belief_vector>& belief);
00081                 // TODO:: Phase out this
00082                 virtual SharedPointer<AlphaPlane> getValueAlpha(SharedPointer<Belief>& belief);
00083 
00084                 virtual double getValue(SharedPointer<belief_vector>& belief, SharedPointer<AlphaPlane>* bestAlpha);
00085 
00086                 list<SharedPointer<AlphaPlane> > planes;
00087                 void addAlphaPlane(SharedPointer<AlphaPlane> plane);
00088         private:
00089                 
00090                 
00091         };
00092 }
00093 
00094 #endif 
00095 


appl
Author(s): petercai
autogenerated on Tue Jan 7 2014 11:02:28