00001
00002
00003
00004
00005 #ifndef PL_Sandros_h
00006 #define PL_Sandros_h 1
00007
00008 #pragma warning ( disable : 4250 )
00009
00010
00011
00012 #include "Planners\PL_GraphBase.h"
00013
00014
00015 #include <LEDA/node_map.h>
00016 #include <LEDA/node_pq.h>
00017 #include <LEDA/node_set.h>
00018 #include <LEDA/queue.h>
00019
00020 #define NODEINU true
00021 #define NODEINV false
00022 #define LEDA_CHECKING_OFF
00023
00024
00025
00026
00027
00028
00029
00030
00031 enum NodeInUVorPsPt{
00032 NodeInU,
00033 NodeInV,
00034 NodeInPs,
00035 NodeInPt,
00036 Nothing
00037 };
00038
00039 class PL_Sandros
00040 :
00041
00042
00043
00044 public PL_GraphBase
00045 {
00046 public:
00047
00048 PL_Sandros();
00049
00050 virtual ~PL_Sandros();
00051
00052
00053 virtual bool Plan ();
00054
00055
00056 virtual bool Save (const char *filename) const;
00057
00058 virtual bool Load (const char *filename);
00059
00060
00061 virtual bool DrawExplicit () const;
00062
00063 virtual void SetStartConfig( const Configuration& config );
00064 virtual void SetGoalConfig ( const Configuration& config );
00065
00066 virtual void SetCollisionDetector (CD_BasicStyle* collisionDetector);
00067
00068 virtual void ClearGraph();
00069
00070 int GetRefinedNode (int i);
00071 void SetValue(int m_Grid,int m_Neighbor,int m_Tolerance);
00072
00073 protected:
00074
00075 SuccessResultType plan_success;
00076 BOOL m_bNoOtherSequence;
00077 BOOL m_bResolutionLimit;
00078
00079
00080 node_pq<int>* m_quenQ;
00081
00082
00083 node_map<node> m_nodePs;
00084 queue<node>* m_quenQ1;
00085
00086 node_map<node> m_nodePt;
00087 node_map<int> m_refine_level;
00088 node_map<bool> m_nodeInPsIsland;
00089
00090 node_map<Configuration> m_nodeInUPs;
00091
00092 node_map<NodeInUVorPsPt> m_nodeUVPsPt;
00093 edge_map<bool> m_bEdgeHiden;
00094
00095 edge_array<double> m_c;
00096
00097
00098 int Tolerance;
00099 int seedofa;
00100 int dof;
00101 int current_res;
00102 double ThreshHold;
00103 double stride;
00104 int nextNo;
00105 Configuration NodeRefinedc;
00106 node NodeRefined;
00107
00108 protected:
00109
00110 void ConstructGraph();
00111 bool SearchForSequence(node_list& L);
00112 double DistanceSandros(const node& n1,const node& n2);
00113 void InitailizeGraph();
00114 void DealwithSequence(const node_list& L);
00115 edge FindEdgeBetweenTwoNodes(const node& n1,const node& n2);
00116 void SaveSandrosPath(const node_list& L);
00117 node GenerateNewNode(int res,const node n1);
00118 bool IsInterferingSan(const Configuration& n1,const node& n2,Configuration& p);
00119 bool IsNeighber(const node& n3,const node& n2);
00120 node GenerateNewNodeGrid(int res,const node n1,int no);
00121 node FindNextNodeToRefined();
00122 bool IsNeighberSan(const Configuration& c1,const node& n2);
00123
00124 };
00125
00126 #endif