00001 //###################################################################### 00002 // 00003 // GraspIt! 00004 // Copyright (C) 2002-2009 Columbia University in the City of New York. 00005 // All rights reserved. 00006 // 00007 // GraspIt! is free software: you can redistribute it and/or modify 00008 // it under the terms of the GNU General Public License as published by 00009 // the Free Software Foundation, either version 3 of the License, or 00010 // (at your option) any later version. 00011 // 00012 // GraspIt! is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License 00018 // along with GraspIt!. If not, see <http://www.gnu.org/licenses/>. 00019 // 00020 // Author(s): Matei T. Ciocarlie 00021 // 00022 // $Id: guidedPlanner.h,v 1.7 2009/07/24 14:39:59 cmatei Exp $ 00023 // 00024 //###################################################################### 00025 00026 #ifndef _guidedplanner_h_ 00027 #define _guidedplanner_h_ 00028 00029 #include <vector> 00030 #include <list> 00031 #include <QObject> 00032 00033 #include "search.h" 00034 #include "simAnnPlanner.h" 00035 00036 class Hand; 00037 class GraspPlanningState; 00038 class SearchEnergy; 00039 class SimAnn; 00040 00042 00077 class GuidedPlanner : public SimAnnPlanner 00078 { 00079 Q_OBJECT 00080 protected: 00082 int mMaxChildren; 00084 std::vector<SimAnnPlanner*> mChildPlanners; 00085 00087 std::list<GraspPlanningState*> mChildSeeds; 00088 00090 00094 std::list<GraspPlanningState*> mAvoidList; 00095 00097 00098 bool mChildClones; 00100 00101 bool mChildThreads; 00102 00104 void startChild(const GraspPlanningState *s); 00106 void stopChild(SimAnnPlanner *pl); 00108 void checkChildren(); 00109 00111 void mainLoop(); 00112 public: 00114 int mBestListSize; 00116 int mChildSeedSize; 00118 float mDistanceThreshold; 00120 float mMinChildEnergy; 00122 SearchEnergyType mChildEnergyType; 00124 int mMaxChildSteps; 00125 00126 GuidedPlanner(Hand *h); 00127 ~GuidedPlanner(); 00128 virtual PlannerType getType(){return PLANNER_MT;} 00129 00131 void startPlanner(); 00133 void stopPlanner(); 00135 void pausePlanner(); 00137 bool resetPlanner(); 00138 void setMaxChildren(int c){mMaxChildren=c;} 00139 }; 00140 00141 #endif