|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // A lane area vehicles can halt at 00008 /****************************************************************************/ 00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00010 // Copyright (C) 2001-2011 DLR (http://www.dlr.de/) and contributors 00011 /****************************************************************************/ 00012 // 00013 // This program is free software; you can redistribute it and/or modify 00014 // it under the terms of the GNU General Public License as published by 00015 // the Free Software Foundation; either version 2 of the License, or 00016 // (at your option) any later version. 00017 // 00018 /****************************************************************************/ 00019 #ifndef MSBusStop_h 00020 #define MSBusStop_h 00021 00022 00023 // =========================================================================== 00024 // included modules 00025 // =========================================================================== 00026 #ifdef _MSC_VER 00027 #include <windows_config.h> 00028 #else 00029 #include <config.h> 00030 #endif 00031 00032 #include <vector> 00033 #include <map> 00034 #include <string> 00035 #include "MSTrigger.h" 00036 00037 00038 // =========================================================================== 00039 // class declarations 00040 // =========================================================================== 00041 class MSLane; 00042 00043 00044 // =========================================================================== 00045 // class definitions 00046 // =========================================================================== 00059 class MSBusStop : public MSTrigger { 00060 public: 00070 MSBusStop(const std::string& id, 00071 const std::vector<std::string> &lines, MSLane& lane, 00072 SUMOReal begPos, SUMOReal endPos) throw(); 00073 00074 00076 virtual ~MSBusStop() throw(); 00077 00078 00083 const MSLane& getLane() const throw(); 00084 00085 00090 SUMOReal getBeginLanePosition() const throw(); 00091 00092 00097 SUMOReal getEndLanePosition() const throw(); 00098 00099 00111 void enter(void* what, SUMOReal beg, SUMOReal end) throw(); 00112 00113 00123 void leaveFrom(void* what) throw(); 00124 00125 00130 SUMOReal getLastFreePos() const throw(); 00131 00132 00133 protected: 00140 void computeLastFreePos() throw(); 00141 00142 00143 protected: 00145 std::vector<std::string> myLines; 00146 00148 std::map<void*, std::pair<SUMOReal, SUMOReal> > myEndPositions; 00149 00151 MSLane& myLane; 00152 00154 SUMOReal myBegPos; 00155 00157 SUMOReal myEndPos; 00158 00160 SUMOReal myLastFreePos; 00161 00162 00163 private: 00165 MSBusStop(const MSBusStop&); 00166 00168 MSBusStop& operator=(const MSBusStop&); 00169 00170 00171 }; 00172 00173 00174 #endif 00175 00176 /****************************************************************************/ 00177