00001 00015 #ifndef SPATIAL_TEMPORAL_LEARNING_OFFLINE_ITEM_SEARCHER_H_ 00016 #define SPATIAL_TEMPORAL_LEARNING_OFFLINE_ITEM_SEARCHER_H_ 00017 00018 // World Item Search 00019 #include "GeoLifeEntry.h" 00020 00021 // worldlib 00022 #include "worldlib/remote/Node.h" 00023 #include "worldlib/model/TaskModel.h" 00024 #include "worldlib/world/World.h" 00025 00026 // Boost 00027 #include <boost/random.hpp> 00028 00029 // C++ Standard Library 00030 #include <vector> 00031 00032 namespace rail 00033 { 00034 namespace spatial_temporal_learning 00035 { 00036 00044 class OfflineItemSearcher : public worldlib::remote::Node 00045 { 00046 public: 00048 static const int NUM_GEOLIFE_ROWS = 10; 00050 static const int NUM_GEOLIFE_COLUMNS = 10; 00051 00057 OfflineItemSearcher(); 00058 00064 virtual ~OfflineItemSearcher(); 00065 00071 void run(); 00072 00073 private: 00082 void loadGeoLife(const std::string &directory); 00083 00090 void runGeoLifeExperiment(); 00091 00102 std::string getGeoLifeSurface(const double latitude, const double longitude) const; 00103 00111 void printItemList(const std::vector<worldlib::world::Item> &objects) const; 00112 00120 void printSurfaceList(const std::vector<worldlib::world::Surface> &surfaces) const; 00121 00123 boost::mt19937 random_; 00124 00126 std::vector<GeoLifeEntry> geolife_; 00128 double min_lat_, max_lat_, min_lng_, max_lng_; 00129 00131 worldlib::remote::InteractiveWorldModelClient *interactive_world_model_client_; 00133 worldlib::remote::SpatialWorldClient *spatial_world_client_; 00134 00136 worldlib::world::World world_, interactive_world_; 00137 00139 worldlib::model::TaskModel interactive_world_task_model_; 00140 }; 00141 00142 } 00143 } 00144 00145 #endif