Go to the documentation of this file.00001
00009 #ifndef PruneAlphaPlane_H
00010 #define PruneAlphaPlane_H
00011
00012 #include "MOMDP.h"
00013 #include "AlphaPlane.h"
00014 using namespace std;
00015 using namespace momdp;
00016 namespace momdp
00017 {
00018 class AlphaPlanePool;
00019 class PruneAlphaPlane
00020 {
00021 public:
00022 PruneAlphaPlane();
00023
00024 SharedPointer<MOMDP> problem;
00025 AlphaPlanePool* alphaPlanePool;
00026 int lastPruneNumPlanes;
00027
00028 double global_delta;
00029
00030 double pruneTime;
00031 int numPrune;
00032
00033
00034 void setup(SharedPointer<MOMDP> _problem, AlphaPlanePool* _alphaPlanePool)
00035 {
00036 lastPruneNumPlanes = 0;
00037
00038 problem = _problem;
00039 alphaPlanePool = _alphaPlanePool;
00040 global_delta = 0.1;
00041
00042 pruneTime = 0.0;
00043 numPrune = 0;
00044
00045 }
00047
00049 void prune(void);
00050 void prunePlanes(void);
00051 void pruneNotCertedAndNotUsed(void);
00052 void updateCertsAndUses(int timeStamp);
00053
00054
00055 int countUses(void);
00056 int countUsedPlanes(void);
00057 int countCerts(void);
00058 int countCertedPlanes(void);
00059 void resetUseds(void);
00060
00061 void pruneDynamicDeltaVersion(int timeStamp, int&, int&);
00062
00063 void Sanity();
00064 void setDelta(double newDelta);
00065
00066 protected:
00068
00070 void updateCorners(SharedPointer<AlphaPlane> plane, std::vector<double, std::allocator<double> >* values, std::vector<SharedPointer<AlphaPlane>, std::allocator<SharedPointer<AlphaPlane> > >* indices);
00071 void updateCerts(SharedPointer<AlphaPlane> plane, double delta, int timeStamp);
00072 void updateMax(SharedPointer<AlphaPlane> plane, double delta, int timeStamp);
00073 void updateUsesByCorners(void);
00074 void updateCertsByDeltaDominance(double delta, int timeStamp);
00075
00076
00077
00078 void resetAlphaPlaneStateMachine();
00079 void computePruneStats(int *oP, int *uP);
00080
00081
00082
00083
00084
00085 static bool isMax(SharedPointer<AlphaPlane> alphaPlane);
00086
00087 };
00088 };
00089
00090 #endif // PRUNEALPHA_H