SUMO - Simulation of Urban MObility
GUIVehicleControl.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2003-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // The class responsible for building and deletion of vehicles (gui-version)
18 /****************************************************************************/
19 #ifndef GUIVehicleControl_h
20 #define GUIVehicleControl_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <vector>
31 
32 
33 // ===========================================================================
34 // class declarations
35 // ===========================================================================
36 class MFXMutex;
37 
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
53 public:
56 
57 
60 
61 
64 
78  const MSRoute* route, MSVehicleType* type,
79  const bool ignoreStopErrors, const bool fromRouteFile = true);
81 
82 
91  bool addVehicle(const std::string& id, SUMOVehicle* v);
92 
93 
101  void deleteVehicle(SUMOVehicle* v, bool discard = false);
102 
103 
110  void insertVehicleIDs(std::vector<GUIGlID>& into, bool listParking, bool listTeleporting);
111 
112 
116  virtual int getHaltingVehicleNo() const;
117 
119  virtual std::pair<double, double> getVehicleMeanSpeeds() const;
120 
122  void secureVehicles();
123 
125  void releaseVehicles();
126 
127 
128 private:
130  mutable MFXMutex myLock;
131 
132 
133 private:
136 
139 
140 
141 };
142 
143 
144 #endif
145 
146 /****************************************************************************/
147 
virtual std::pair< double, double > getVehicleMeanSpeeds() const
get current absolute and relative mean vehicle speed in the network
The class responsible for building and deletion of vehicles (gui-version)
MFXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
GUIVehicleControl()
Constructor.
void releaseVehicles()
unlock access to vehicle removal/additions for thread synchronization
SUMOVehicle * buildVehicle(SUMOVehicleParameter *defs, const MSRoute *route, MSVehicleType *type, const bool ignoreStopErrors, const bool fromRouteFile=true)
Builds a vehicle, increases the number of built vehicles.
void insertVehicleIDs(std::vector< GUIGlID > &into, bool listParking, bool listTeleporting)
Returns the list of all known vehicles by gl-id.
The car-following model and parameter.
Definition: MSVehicleType.h:66
Representation of a vehicle.
Definition: SUMOVehicle.h:60
bool addVehicle(const std::string &id, SUMOVehicle *v)
Tries to insert the vehicle into the internal vehicle container.
GUIVehicleControl & operator=(const GUIVehicleControl &s)
invalidated assignment operator
Structure representing possible vehicle parameter.
void secureVehicles()
lock access to vehicle removal/additions for thread synchronization
~GUIVehicleControl()
Destructor.
void deleteVehicle(SUMOVehicle *v, bool discard=false)
Deletes the vehicle.
The class responsible for building and deletion of vehicles.
virtual int getHaltingVehicleNo() const
Returns the number of halting vehicles.