00001 #ifndef PL_Juan_h 00002 #define PL_Juan_h 1 00003 00004 #pragma warning( disable : 4250 ) 00005 #include "Planners\PL_Boolean_Output.h" 00006 #include "Planners\PL_OpenGL.h" 00007 #include "JMA_aca_structs.h" 00008 00009 class PL_Juan : 00010 public PL_Boolean_Output, 00011 virtual public PL_OpenGL 00012 { 00013 public: 00014 PL_Juan(); 00015 virtual ~PL_Juan(); 00016 virtual bool Plan (); 00017 virtual bool Save (const char *filename) const; 00018 virtual void SetStartConfig (const Configuration& configuration); 00019 virtual bool Load (const char *filename); 00020 virtual bool DrawExplicit () const; 00021 00022 protected: 00023 void Initialize(); 00024 double MyDistanceFunc (const Configuration& conf1, const Configuration& conf2) const; 00025 int MyRandomPath (int id_landmark, const int id_embryo, const int n_dof, const JMA_Configuration init_conf, JMA_Configuration* embryo) const; 00026 int SimplifyIdsTrajectory (const JMA_Roadmap_Tree* tree, const int list[], int n_nodes, int new_list[], int* new_n_nodes) const; 00027 static int GetNAncestors (const JMA_Roadmap_Tree* tree, const int landmark_id); 00028 int Search (JMA_Roadmap_Tree* tree) const; 00029 int MyLocalPlanner (const Configuration& start_conf, Configuration& local_minima) const; 00030 int MyGoalFunc (const Configuration& config) const; 00031 int MyPtpCollision (const Configuration& start_conf, const Configuration& local_minima) const; 00032 void InitRoadmapTree (JMA_Roadmap_Tree* tree, const int n_dof, const int n_embryos, const JMA_Configuration init_conf) const; 00033 void Explore (JMA_Roadmap_Tree* tree) const; 00034 void GenerateNewEmbryo( JMA_Roadmap_Tree* tree, const int id_landmark, const int id_embryo) const; 00035 static void GetIdsPath( const JMA_Roadmap_Tree* tree, const int landmark_id, int list_ids[], int* n_landmarks); 00036 void UpdateRoadmapTree( JMA_Roadmap_Tree* tree ) const; 00037 void ComputeEmbryoDistance (JMA_Roadmap_Tree* tree, JMA_Configuration* embryo) const; 00038 void CopyTrajectoryToPath (); 00039 private: 00040 int ids_list[ 500 ]; 00041 JMA_Roadmap_Tree* tree; 00042 JMA_Configuration init_conf; 00043 int numberOfEmbryos; 00044 int numberOfLandmarks; 00045 bool m_Initialized : 1; 00046 }; 00047 #endif