00001 //---------------------------------------------------------------------- 00002 // The Motion Strategy Library (MSL) 00003 //---------------------------------------------------------------------- 00004 // 00005 // Copyright (c) University of Illinois and Steven M. LaValle. 00006 // All Rights Reserved. 00007 // 00008 // Permission to use, copy, and distribute this software and its 00009 // documentation is hereby granted free of charge, provided that 00010 // (1) it is not a component of a commercial product, and 00011 // (2) this notice appears in all copies of the software and 00012 // related documentation. 00013 // 00014 // The University of Illinois and the author make no representations 00015 // about the suitability or fitness of this software for any purpose. 00016 // It is provided "as is" without express or implied warranty. 00017 //---------------------------------------------------------------------- 00018 00019 #ifndef MSL_PRM_H 00020 #define MSL_PRM_H 00021 00022 #include <queue> 00023 00024 #include "planner.h" 00025 #include "util.h" 00026 #include "disjointsets.h" 00027 00028 00036 00037 class PRM: public RoadmapPlanner { 00038 protected: 00039 virtual list<MSLVertex*> NeighboringVertices(const MSLVector &x); 00040 virtual bool Connect(const MSLVector &x1, const MSLVector &x2, MSLVector &u); 00041 virtual MSLVector ChooseState(int i, int maxnum, int dim); 00042 MSLVector QuasiRandomStateHammersley(int i, int maxnum, int dim); 00043 MSLVector QuasiRandomStateHalton(int i, int dim); 00044 MSLVector QuasiRandomStateSukharev(int i, int maxnum, int dim); 00046 double StepSize; // Derived from DeltaT using the model 00047 int MaxNeighbors; 00048 int MaxEdgesPerVertex; 00049 public: 00050 00052 double Radius; 00053 00055 DisjointSets<MSLVertex*> ds; 00056 00058 int SatisfiedCount; 00059 00061 bool QuasiRandom; 00062 00064 bool QuasiRandomSukharev; 00065 00067 double SukharevDispersion; 00068 00070 int SukharevPointsPerAxis; 00071 00073 bool QuasiRandomHammersley; 00074 00076 PRM(Problem *problem); 00077 00079 virtual ~PRM() {}; 00080 00082 virtual void Construct(); 00083 00085 virtual bool Plan(); 00086 }; 00087 00088 00089 #endif 00090