SUMO - Simulation of Urban MObility
MSBusStop.h
Go to the documentation of this file.
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 class SUMOVehicle;
00044 
00045 
00046 // ===========================================================================
00047 // class definitions
00048 // ===========================================================================
00061 class MSBusStop : public MSTrigger {
00062 public:
00072     MSBusStop(const std::string& id,
00073               const std::vector<std::string> &lines, MSLane& lane,
00074               SUMOReal begPos, SUMOReal endPos) ;
00075 
00076 
00078     virtual ~MSBusStop() ;
00079 
00080 
00085     const MSLane& getLane() const ;
00086 
00087 
00092     SUMOReal getBeginLanePosition() const ;
00093 
00094 
00099     SUMOReal getEndLanePosition() const ;
00100 
00101 
00113     void enter(SUMOVehicle* what, SUMOReal beg, SUMOReal end) ;
00114 
00115 
00125     void leaveFrom(SUMOVehicle* what) ;
00126 
00127 
00132     SUMOReal getLastFreePos(SUMOVehicle &forVehicle) const ;
00133 
00134 
00135 protected:
00142     void computeLastFreePos() ;
00143 
00144 
00145 protected:
00147     std::vector<std::string> myLines;
00148 
00150     std::map<SUMOVehicle*, std::pair<SUMOReal, SUMOReal> > myEndPositions;
00151 
00153     MSLane& myLane;
00154 
00156     SUMOReal myBegPos;
00157 
00159     SUMOReal myEndPos;
00160 
00162     SUMOReal myLastFreePos;
00163 
00164 
00165 private:
00167     MSBusStop(const MSBusStop&);
00168 
00170     MSBusStop& operator=(const MSBusStop&);
00171 
00172 
00173 };
00174 
00175 
00176 #endif
00177 
00178 /****************************************************************************/
00179 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines