LEMUR Packages: ompl_lemur or_lemur pr_bgl prpy_lemur
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Groups Pages
Family.h
Go to the documentation of this file.
1 
7 namespace ompl_lemur
8 {
9 
10 // a family is a collection of subsets
11 // each backed by a spaceinformationptr
12 // along with set relations thereof
13 //
14 // this is passed as input to the family planner
15 //
16 // callers manipulate this directly;
17 // ideally this is the only thing holding si ptrs between calls
18 struct Family
19 {
20  std::set<std::string> sets;
21 
22  // andecedents, consequent
23  typedef std::pair< std::set<std::string>, std::string > Relation;
24  std::set<Relation> relations;
25 
26  void add_inclusion(std::string subset, std::string superset)
27  {
28  std::set<std::string> subsets;
29  subsets.insert(subset);
30  relations.insert(std::make_pair(subsets, superset));
31  }
32 
33  void add_intersection(std::string subset, std::set<std::string> & supersets)
34  {
35  relations.insert(std::make_pair(supersets, subset));
36  std::set<std::string> subsets;
37  subsets.insert(subset);
38  for (std::set<std::string>::iterator sit=supersets.begin(); sit!=supersets.end(); sit++)
39  relations.insert(std::make_pair(subsets, *sit));
40  }
41 };
42 
43 } // namespace ompl_lemur
Definition: Family.h:18