00001 #ifndef SEARCH_ENGINE_H 00002 #define SEARCH_ENGINE_H 00003 00004 #include "globals.h" 00005 00006 class SearchEngine 00007 { 00008 private: 00009 bool solved; 00010 bool solved_at_least_once; 00011 Plan plan; 00012 PlanTrace path; 00013 public: 00014 enum status 00015 { 00016 SOLVED, 00017 FAILED, 00018 SOLVED_COMPLETE, 00019 IN_PROGRESS, 00020 FAILED_TIMEOUT, 00021 SOLVED_TIMEOUT 00022 }; 00023 protected: 00024 virtual enum status step() = 0; 00025 00026 void set_plan(const Plan &plan); 00027 void set_path(const PlanTrace &states); 00028 public: 00029 SearchEngine(); 00030 virtual ~SearchEngine(); 00031 virtual void statistics(time_t & current_time) const; 00032 virtual void initialize() {} 00033 virtual void dump_everything() const = 0; 00034 bool found_solution() const; 00035 bool found_at_least_one_solution() const; 00036 const Plan &get_plan() const; 00037 const PlanTrace& get_path() const; 00038 enum status search(); 00039 }; 00040 00041 #endif