|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // Representation of a lane in the micro simulation (gui-version) 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 GUILane_h 00020 #define GUILane_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 <fx.h> 00033 #include <string> 00034 #include <utility> 00035 #include <microsim/MSLane.h> 00036 #include <microsim/MSEdge.h> 00037 #include <utils/geom/Position.h> 00038 #include <utils/geom/PositionVector.h> 00039 #include "GUILaneWrapper.h" 00040 00041 00042 // =========================================================================== 00043 // class declarations 00044 // =========================================================================== 00045 class MSVehicle; 00046 class MSNet; 00047 class MFXMutex; 00048 00049 00050 // =========================================================================== 00051 // class definitions 00052 // =========================================================================== 00061 class GUILane : public MSLane { 00062 public: 00077 GUILane(const std::string& id, SUMOReal maxSpeed, 00078 SUMOReal length, MSEdge* const edge, unsigned int numericalID, 00079 const PositionVector& shape, SUMOReal width, 00080 const SUMOVehicleClasses& allowed, 00081 const SUMOVehicleClasses& disallowed) throw(); 00082 00083 00085 ~GUILane() throw(); 00086 00087 00088 00091 00101 const VehCont& getVehiclesSecure() const throw(); 00102 00103 00109 void releaseVehicles() const throw(); 00111 00112 00113 00116 00119 bool moveCritical(SUMOTime t); 00120 00123 bool setCritical(SUMOTime t, std::vector<MSLane*> &into); 00124 00127 bool integrateNewVehicle(SUMOTime t); 00129 00130 00131 00132 void detectCollisions(SUMOTime timestep); 00133 00134 00135 GUILaneWrapper* buildLaneWrapper(unsigned int index); 00136 MSVehicle* removeVehicle(MSVehicle* remVehicle); 00137 00138 protected: 00140 void swapAfterLaneChange(SUMOTime t); 00141 00153 virtual void incorporateVehicle(MSVehicle* veh, SUMOReal pos, SUMOReal speed, 00154 const MSLane::VehCont::iterator& at, 00155 MSMoveReminder::Notification notification = MSMoveReminder::NOTIFICATION_DEPARTED) throw(ProcessError); 00156 00157 00158 private: 00160 mutable MFXMutex myLock; 00161 00162 00163 }; 00164 00165 00166 #endif 00167 00168 /****************************************************************************/ 00169