estar/base.hpp

Go to the documentation of this file.
00001 /* 
00002  * Copyright (C) 2005 Roland Philippsen <roland dot philippsen at gmx net>
00003  * 
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License, or
00007  * (at your option) any later version.
00008  * 
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  * 
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00017  * USA
00018  */
00019 
00020 
00021 #ifndef ESTAR_BASE_HPP
00022 #define ESTAR_BASE_HPP
00023 
00024 
00025 #include <estar/numeric.hpp>
00026 #include <boost/graph/adjacency_list.hpp>
00027 
00028 
00029 namespace estar {
00030   
00031   
00036   typedef enum {
00038     NONE,                       // 0 = b00
00040     OPEN,                       // 1 = b01
00042     GOAL,                       // 2 = b10
00044     OPNG                        // 3 = b11
00045   } flag_t;
00046   
00047 
00052   const char * flag_name(flag_t p);
00053   
00054   
00056   // cspace traits
00057   
00059   typedef boost::vecS cspace_OutEdgeListS;
00060 
00062   typedef boost::vecS cspace_VertexListS;
00063 
00065   typedef boost::undirectedS cspace_DirectedS;
00066 
00068   typedef boost::adjacency_list_traits<cspace_OutEdgeListS,
00069                                        cspace_VertexListS,
00070                                        cspace_DirectedS> cspace_traits;
00071 
00073   typedef cspace_traits::vertex_descriptor vertex_t;
00074   
00075   
00077   // vertex properties
00078   
00080   struct value_p    { typedef boost::vertex_property_tag kind; };
00081   
00083   struct meta_p     { typedef boost::vertex_property_tag kind; };
00084   
00086   struct rhs_p      { typedef boost::vertex_property_tag kind; };
00087   
00089   struct flag_p     { typedef boost::vertex_property_tag kind; };
00090   
00091   
00093   // cspace graph and supplementary traits
00094   
00096   typedef boost::property<value_p, double,
00097           boost::property<meta_p, double,
00098           boost::property<rhs_p, double,
00099           boost::property<flag_p, flag_t
00100           > > > > cspace_vertex_property;
00101   
00103   typedef boost::adjacency_list<cspace_OutEdgeListS,
00104                                 cspace_VertexListS,
00105                                 cspace_DirectedS,
00106                                 cspace_vertex_property> cspace_t;
00107 
00109   typedef boost::graph_traits<cspace_t>::adjacency_iterator adjacency_it;
00110   
00112   typedef boost::graph_traits<cspace_t>::vertex_iterator    vertex_it;
00113   
00114   
00116   // property map types
00117   
00119   typedef
00120   boost::property_map<cspace_t, boost::vertex_index_t>::type vertexid_map_t;
00121   
00123   typedef boost::property_map<cspace_t, value_p>::type    value_map_t;
00124 
00126   typedef boost::property_map<cspace_t, meta_p>::type     meta_map_t;
00127 
00129   typedef boost::property_map<cspace_t, rhs_p>::type      rhs_map_t;
00130 
00132   typedef boost::property_map<cspace_t, flag_p>::type     flag_map_t;
00133   
00134 } // namespace estar
00135 
00136 #endif // ESTAR_BASE_HPP

doxygen SourceForge.net Logo
E* Interpolated Graph Replanner Wed Dec 12 18:55:40 2007