00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MSL_FDP_H
00020 #define MSL_FDP_H
00021
00022 #include <queue>
00023 #include <vector>
00024 using namespace std;
00025
00026
00027 #include "marray.h"
00028 #include "planner.h"
00029 #include "tree.h"
00030 #include "vector.h"
00031 #include "defs.h"
00032 #include "mslio.h"
00033
00034 #define UNVISITED 0
00035 #define VISITED 1 // Visited by the first tree, G
00036 #define COLLISION 2
00037 #define VISITED2 3 // Visited by the second tree, G2
00038 #define GOAL 4 // Lies in goal region (not used in base class)
00039
00040
00062
00063
00064
00065 class FDP: public IncrementalPlanner {
00066 protected:
00067
00069 priority_queue<MSLNode*,vector<MSLNode*>,MSLNodeGreater> Q;
00070
00072 MultiArray<int> *Grid;
00073
00075 vector<int> GridDimensions;
00076
00078 int GridDefaultResolution;
00079
00081 MSLVector Quantization;
00082
00083 virtual double SearchCost(double initcost,
00084 MSLNode* &n,
00085 MSLNode* &nn);
00086
00087 virtual vector<int> StateToIndices(const MSLVector &x);
00088
00089 virtual MSLVector IndicesToState(const vector<int> &indices);
00090
00091 public:
00092
00094 FDP(Problem *problem);
00095
00097 ~FDP() {};
00098
00100 int SatisfiedCount;
00101
00103 virtual void Reset();
00104
00106 virtual bool Plan();
00107
00108 };
00109
00110
00111
00113 class FDPStar: public FDP {
00114 protected:
00115 virtual double SearchCost(double initcost,
00116 MSLNode* &n,
00117 MSLNode* &nn);
00118 public:
00119 FDPStar(Problem *p);
00120 };
00121
00122
00124 class FDPBestFirst: public FDP {
00125 protected:
00126 virtual double SearchCost(double initcost,
00127 MSLNode* &n,
00128 MSLNode* &nn);
00129 public:
00130 FDPBestFirst(Problem *p);
00131 };
00132
00133
00135 class FDPBi: public FDP {
00136 protected:
00137
00139 priority_queue<MSLNode*,vector<MSLNode*>,MSLNodeGreater> Q2;
00140
00142 void RecoverSolution(MSLNode* &n1, MSLNode* &n2);
00143
00144 public:
00145
00147 FDPBi(Problem *problem);
00148
00150 ~FDPBi() {};
00151
00153 virtual void Reset();
00154
00156 virtual bool Plan();
00157 };
00158
00159
00160 #endif
00161
00162