SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00009 // Representation of a lane over a junction 00010 /****************************************************************************/ 00011 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00012 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors 00013 /****************************************************************************/ 00014 // 00015 // This file is part of SUMO. 00016 // SUMO is free software: you can redistribute it and/or modify 00017 // it under the terms of the GNU General Public License as published by 00018 // the Free Software Foundation, either version 3 of the License, or 00019 // (at your option) any later version. 00020 // 00021 /****************************************************************************/ 00022 #ifndef GUIInternalLane_h 00023 #define GUIInternalLane_h 00024 00025 00026 // =========================================================================== 00027 // included modules 00028 // =========================================================================== 00029 #ifdef _MSC_VER 00030 #include <windows_config.h> 00031 #else 00032 #include <config.h> 00033 #endif 00034 00035 #include <string> 00036 #include <utility> 00037 #include <microsim/MSInternalLane.h> 00038 #include <microsim/MSEdge.h> 00039 #include <utils/geom/Position.h> 00040 #include <utils/geom/PositionVector.h> 00041 00042 00043 // =========================================================================== 00044 // class declarations 00045 // =========================================================================== 00046 class MSVehicle; 00047 class MSNet; 00048 class MFXMutex; 00049 00050 00051 // =========================================================================== 00052 // class definitions 00053 // =========================================================================== 00060 class GUIInternalLane : public MSInternalLane { 00061 public: 00076 GUIInternalLane(const std::string& id, SUMOReal maxSpeed, 00077 SUMOReal length, MSEdge* const edge, unsigned int numericalID, 00078 const PositionVector& shape, SUMOReal width, 00079 SVCPermissions permissions); 00080 00081 00083 ~GUIInternalLane() ; 00084 00085 00086 00089 00099 const VehCont& getVehiclesSecure() const ; 00100 00101 00107 void releaseVehicles() const ; 00109 00110 00111 00114 00117 bool moveCritical(SUMOTime t); 00118 00121 bool setCritical(SUMOTime t, std::vector<MSLane*> &into); 00122 00125 bool integrateNewVehicle(SUMOTime t); 00127 00128 GUILaneWrapper* buildLaneWrapper(unsigned int index); 00129 00130 void detectCollisions(SUMOTime timestep); 00131 MSVehicle* removeVehicle(MSVehicle* remVehicle); 00132 00133 protected: 00135 void swapAfterLaneChange(SUMOTime t); 00136 00148 virtual void incorporateVehicle(MSVehicle* veh, SUMOReal pos, SUMOReal speed, 00149 const MSLane::VehCont::iterator& at, 00150 MSMoveReminder::Notification notification = MSMoveReminder::NOTIFICATION_DEPARTED) ; 00151 00152 00153 private: 00155 mutable MFXMutex myLock; 00156 00157 }; 00158 00159 00160 #endif 00161 00162 /****************************************************************************/ 00163