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:
00080     GUILane(const std::string& id, SUMOReal maxSpeed,
00081             SUMOReal length, MSEdge* const edge, unsigned int numericalID,
00082             const PositionVector& shape, SUMOReal width,
00083             const SUMOVehicleClasses& allowed,
00084             const SUMOVehicleClasses& disallowed) ;
00085 
00086 
00088     ~GUILane() ;
00089 
00090 
00091 
00094 
00104     const VehCont& getVehiclesSecure() const ;
00105 
00106 
00112     void releaseVehicles() const ;
00114 
00115 
00116 
00119 
00122     bool moveCritical(SUMOTime t);
00123 
00126     bool setCritical(SUMOTime t, std::vector<MSLane*> &into);
00127 
00130     bool integrateNewVehicle(SUMOTime t);
00132 
00133 
00134 
00135     void detectCollisions(SUMOTime timestep);
00136 
00137 
00138     GUILaneWrapper* buildLaneWrapper(unsigned int index);
00139     MSVehicle* removeVehicle(MSVehicle* remVehicle);
00140 
00141 protected:
00143     void swapAfterLaneChange(SUMOTime t);
00144 
00156     virtual void incorporateVehicle(MSVehicle* veh, SUMOReal pos, SUMOReal speed,
00157                                     const MSLane::VehCont::iterator& at,
00158                                     MSMoveReminder::Notification notification = MSMoveReminder::NOTIFICATION_DEPARTED) ;
00159 
00160 
00161 private:
00163     mutable MFXMutex myLock;
00164 
00165 
00166 };
00167 
00168 
00169 #endif
00170 
00171 /****************************************************************************/
00172 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines