SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSVehicleTransfer.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // A mover of vehicles that got stucked due to grid locks
9 // This class also serves as container for parking vehicles
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef MSVehicleTransfer_h
23 #define MSVehicleTransfer_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <string>
36 #include <vector>
37 
38 
39 // ===========================================================================
40 // class declarations
41 // ===========================================================================
42 class MSVehicle;
43 class MSEdge;
44 
45 
46 // ===========================================================================
47 // class definitions
48 // ===========================================================================
65 public:
67  virtual ~MSVehicleTransfer();
68 
69 
78  void addVeh(const SUMOTime t, MSVehicle* veh);
79 
80 
89  void checkInsertions(SUMOTime time);
90 
91 
96  bool hasPending() const;
97 
99  const std::set<const MSVehicle*>& getParkingVehicles(const MSLane* lane) const;
100 
104  static MSVehicleTransfer* getInstance();
105 
108 
109 private:
112 
113 
114 protected:
125  bool myParking;
126 
132  VehicleInformation(MSVehicle* veh, SUMOTime proceedTime, bool parking)
133  : myVeh(veh), myProceedTime(proceedTime), myParking(parking) { }
134 
135  };
136 
137 
139  typedef std::vector<VehicleInformation> VehicleInfVector;
140 
143 
145  typedef std::map<const MSLane*, std::set<const MSVehicle*> > ParkingVehicles;
147 
150 
152  static const std::set<const MSVehicle*> myEmptyVehicleSet;
153 
154 };
155 
156 
157 #endif
158 
159 /****************************************************************************/
160 
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:77
static MSVehicleTransfer * myInstance
The static singleton-instance.
Holds the information needed to move the vehicle over the network.
static const SUMOReal TeleportMinSpeed
The minimum speed while teleporting.
MSVehicleTransfer()
Constructor.
VehicleInfVector myVehicles
The information about stored vehicles to move virtually.
bool hasPending() const
Checks whether stored vehicles are present.
virtual ~MSVehicleTransfer()
Destructor.
std::map< const MSLane *, std::set< const MSVehicle * > > ParkingVehicles
The map from lanes to parking vehicles.
bool myParking
whether the vehicle is or was parking
const std::set< const MSVehicle * > & getParkingVehicles(const MSLane *lane) const
return parking vehicles on the given lane
A road/street connecting two junctions.
Definition: MSEdge.h:73
void addVeh(const SUMOTime t, MSVehicle *veh)
Adds a vehicle to this transfer object.
void checkInsertions(SUMOTime time)
Checks "movement" of stored vehicles.
SUMOTime myProceedTime
The time at which the vehicle should be moved virtually one edge further.
static const std::set< const MSVehicle * > myEmptyVehicleSet
an empty vector for convenience
ParkingVehicles myParkingVehicles
static MSVehicleTransfer * getInstance()
Returns the instance of this object.
std::vector< VehicleInformation > VehicleInfVector
Definition of a container for vehicle information.
VehicleInformation(MSVehicle *veh, SUMOTime proceedTime, bool parking)
Constructor.
#define SUMOReal
Definition: config.h:215
MSVehicle * myVeh
The vehicle itself.
Representation of a lane in the micro simulation.
Definition: MSLane.h:77