00001 //---------------------------------------------------------------------- 00002 // The Motion Strategy Library (MSL) 00003 //---------------------------------------------------------------------- 00004 // 00005 // Copyright (c) 1998-2000 Iowa State University and Steve LaValle. 00006 // All Rights Reserved. 00007 // 00008 // Permission to use, copy, and distribute this software and its 00009 // documentation is hereby granted free of charge, provided that 00010 // (1) it is not a component of a commercial product, and 00011 // (2) this notice appears in all copies of the software and 00012 // related documentation. 00013 // 00014 // Iowa State University and the author make no representations 00015 // about the suitability or fitness of this software for any purpose. 00016 // It is provided "as is" without express or implied warranty. 00017 //---------------------------------------------------------------------- 00018 00019 #ifndef MSL_PLANNER_H 00020 #define MSL_PLANNER_H 00021 00022 #include <LEDA/file.h> 00023 #include <LEDA/graph.h> 00024 #include <LEDA/list.h> 00025 #include <LEDA/polygon.h> 00026 #include <LEDA/vector.h> 00027 00028 #include "solver.h" 00029 00030 #include <LEDA/REDEFINE_NAMES.h> 00031 00033 00034 class Planner: public Solver { 00035 protected: 00036 random_source R; 00037 00039 vector RandomState(); 00040 00042 vector NormalState(vector mean, double sd); 00043 00044 public: 00046 list<vector> Path; 00047 00049 list<vector> Policy; 00050 00052 vector GapState; 00053 00056 bool Holonomic; 00057 00059 vector GapError; 00060 00062 GRAPH<vector,vector> G; 00063 00065 GRAPH<vector,vector> G2; 00066 00068 list<double> TimeList; 00069 00071 list<vector> StateList; 00072 00074 list<vector> InputList; 00075 00077 int NumNodes; 00078 00080 double PlannerDeltaT; 00081 00083 Planner(Problem *problem); 00084 00086 virtual ~Planner() {}; 00087 00089 virtual void Reset(); 00090 00092 virtual void Construct() = 0; 00093 00095 virtual bool Plan() = 0; 00096 00098 void RecordSolution(const list<node> &glist, 00099 const list<node> &g2list); 00100 00101 void RecordSolution(const list<node> &glist); 00102 00104 virtual void WriteGraphs(const string &fname); 00105 00107 virtual void ReadGraphs(const string &fname); 00108 00110 bool GapSatisfied(const vector &x1, const vector &x2); 00111 }; 00112 00113 00114 00115 #include <LEDA/UNDEFINE_NAMES.h> 00116 00117 #endif 00118 00119 00120