00001 #ifndef PL_ACA_CONNECT_h
00002 #define PL_ACA_CONNECT_h 1
00003 #pragma warning( disable : 4250 )
00004 #include "Planners\PL_Boolean_Output.h"
00005 #include "Planners\PL_OpenGL.h"
00006 #include "JMA_aca_structs.h"
00007
00008 class PL_ACA_CONNECT : public PL_Boolean_Output,
00009 virtual public PL_OpenGL
00010 {
00011 public:
00012 virtual ~PL_ACA_CONNECT();
00013 virtual bool Plan ();
00014 virtual void SetStart_and_GoalConfig(const Configuration& configuration1, const Configuration& configuration2);
00015 virtual bool DrawExplicit () const;
00016 protected:
00017 double get_distance(const Configuration& conf1, const Configuration& conf2) const;
00018 void MyRandomPath (int id_landmark, const int id_embryo, const int n_dof, const JMA_Configuration init_conf, JMA_Configuration* embryo) const;
00019 static int GetNAncestors (const JMA_Roadmap_Tree* tree, const int landmark_id);
00020 bool Search (JMA_Roadmap_Tree* temp_tree1, JMA_Roadmap_Tree* temp_tree2);
00021 void InitRoadmapTree (JMA_Roadmap_Tree* ptr_tree1, const int n_dof, const int n_embryos, const JMA_Configuration init_conf, JMA_Roadmap_Tree* ptr_tree2, const JMA_Configuration goal_conf) const;
00022 void Explore (JMA_Roadmap_Tree* tree) const;
00023 void GenerateNewEmbryo (JMA_Roadmap_Tree* tree, const int id_landmark, const int id_embryo) const;
00024 void GetIdsPath (JMA_Roadmap_Tree* ptr_tree1, JMA_Roadmap_Tree* ptr_tree2);
00025 void UpdateRoadmapTree (JMA_Roadmap_Tree* tree) const;
00026 void ComputeEmbryoDistance (JMA_Roadmap_Tree* tree, JMA_Configuration* embryo) const;
00027 void get_nearest_node(Configuration* the_node, JMA_Roadmap_Tree* temp_tree2, Configuration* the_nearest_node) ;
00028 bool get_new_node(Configuration* the_current_node, Configuration* the_nearest_node, Configuration* the_new_node) const;
00029 void advance(JMA_Roadmap_Tree* temp_tree1, JMA_Roadmap_Tree* temp_tree2);
00030 void optimization();
00031 private:
00032 int ids_list[ 2000 ], new_ids_list[2000];
00033 JMA_Roadmap_Tree tree1, tree2,temp_tree;
00034
00035
00036 JMA_Configuration init_conf, goal_conf;
00037 Configuration current_node,nearest_node, new_node;
00038 int numberOfEmbryos;
00039 int numberOfLandmarks, nearest_node_id;
00040 int mark, end_of_array, pointer;
00041
00042 private:
00043
00044 };
00045
00046 #endif