|
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-2012 DLR (http://www.dlr.de/) and contributors 00011 /****************************************************************************/ 00012 // 00013 // This file is part of SUMO. 00014 // SUMO is free software: you can redistribute it and/or modify 00015 // it under the terms of the GNU General Public License as published by 00016 // the Free Software Foundation, either version 3 of the License, or 00017 // (at your option) any later version. 00018 // 00019 /****************************************************************************/ 00020 #ifndef MSBusStop_h 00021 #define MSBusStop_h 00022 00023 00024 // =========================================================================== 00025 // included modules 00026 // =========================================================================== 00027 #ifdef _MSC_VER 00028 #include <windows_config.h> 00029 #else 00030 #include <config.h> 00031 #endif 00032 00033 #include <vector> 00034 #include <map> 00035 #include <string> 00036 #include "MSTrigger.h" 00037 00038 00039 // =========================================================================== 00040 // class declarations 00041 // =========================================================================== 00042 class MSLane; 00043 00044 00045 // =========================================================================== 00046 // class definitions 00047 // =========================================================================== 00060 class MSBusStop : public MSTrigger { 00061 public: 00071 MSBusStop(const std::string& id, 00072 const std::vector<std::string> &lines, MSLane& lane, 00073 SUMOReal begPos, SUMOReal endPos) ; 00074 00075 00077 virtual ~MSBusStop() ; 00078 00079 00084 const MSLane& getLane() const ; 00085 00086 00091 SUMOReal getBeginLanePosition() const ; 00092 00093 00098 SUMOReal getEndLanePosition() const ; 00099 00100 00112 void enter(void* what, SUMOReal beg, SUMOReal end) ; 00113 00114 00124 void leaveFrom(void* what) ; 00125 00126 00131 SUMOReal getLastFreePos() const ; 00132 00133 00134 protected: 00141 void computeLastFreePos() ; 00142 00143 00144 protected: 00146 std::vector<std::string> myLines; 00147 00149 std::map<void*, std::pair<SUMOReal, SUMOReal> > myEndPositions; 00150 00152 MSLane& myLane; 00153 00155 SUMOReal myBegPos; 00156 00158 SUMOReal myEndPos; 00159 00161 SUMOReal myLastFreePos; 00162 00163 00164 private: 00166 MSBusStop(const MSBusStop&); 00167 00169 MSBusStop& operator=(const MSBusStop&); 00170 00171 00172 }; 00173 00174 00175 #endif 00176 00177 /****************************************************************************/ 00178