SUMO - Simulation of Urban MObility
GUILane.h
Go to the documentation of this file.
00001 /****************************************************************************/
00009 // Representation of a lane in the micro simulation (gui-version)
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 GUILane_h
00023 #define GUILane_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 <fx.h>
00036 #include <string>
00037 #include <utility>
00038 #include <microsim/MSLane.h>
00039 #include <microsim/MSEdge.h>
00040 #include <utils/geom/Position.h>
00041 #include <utils/geom/PositionVector.h>
00042 #include "GUILaneWrapper.h"
00043 
00044 
00045 // ===========================================================================
00046 // class declarations
00047 // ===========================================================================
00048 class MSVehicle;
00049 class MSNet;
00050 class MFXMutex;
00051 
00052 
00053 // ===========================================================================
00054 // class definitions
00055 // ===========================================================================
00064 class GUILane : public MSLane {
00065 public:
00079     GUILane(const std::string& id, SUMOReal maxSpeed,
00080             SUMOReal length, MSEdge* const edge, unsigned int numericalID,
00081             const PositionVector& shape, SUMOReal width,
00082             SVCPermissions permissions);
00083 
00084 
00086     ~GUILane() ;
00087 
00088 
00089 
00092 
00102     const VehCont& getVehiclesSecure() const ;
00103 
00104 
00110     void releaseVehicles() const ;
00112 
00113 
00114 
00117 
00120     bool moveCritical(SUMOTime t);
00121 
00124     bool setCritical(SUMOTime t, std::vector<MSLane*> &into);
00125 
00128     bool integrateNewVehicle(SUMOTime t);
00130 
00131 
00132 
00133     void detectCollisions(SUMOTime timestep);
00134 
00135 
00136     GUILaneWrapper* buildLaneWrapper(unsigned int index);
00137     MSVehicle* removeVehicle(MSVehicle* remVehicle);
00138 
00139 protected:
00141     void swapAfterLaneChange(SUMOTime t);
00142 
00154     virtual void incorporateVehicle(MSVehicle* veh, SUMOReal pos, SUMOReal speed,
00155                                     const MSLane::VehCont::iterator& at,
00156                                     MSMoveReminder::Notification notification = MSMoveReminder::NOTIFICATION_DEPARTED) ;
00157 
00158 
00159 private:
00161     mutable MFXMutex myLock;
00162 
00163 
00164 };
00165 
00166 
00167 #endif
00168 
00169 /****************************************************************************/
00170 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines