Eclipse 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-2019 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>
29 #include <fx.h>
32 
33 
34 // ===========================================================================
35 // class definitions
36 // ===========================================================================
48 public:
51 
52 
55 
56 
59 
73  const MSRoute* route, MSVehicleType* type,
74  const bool ignoreStopErrors, const bool fromRouteFile = true);
76 
77 
86  bool addVehicle(const std::string& id, SUMOVehicle* v);
87 
88 
96  void deleteVehicle(SUMOVehicle* v, bool discard = false);
97 
98 
105  void insertVehicleIDs(std::vector<GUIGlID>& into, bool listParking, bool listTeleporting);
106 
107 
111  virtual int getHaltingVehicleNo() const;
112 
114  virtual std::pair<double, double> getVehicleMeanSpeeds() const;
115 
117  void secureVehicles();
118 
120  void releaseVehicles();
121 
122 
123 private:
125  mutable FXMutex myLock;
126 
127 
128 private:
131 
134 
135 
136 };
137 
138 
139 #endif
140 
141 /****************************************************************************/
142 
MSVehicleType
The car-following model and parameter.
Definition: MSVehicleType.h:66
GUIGlObject.h
GUIVehicleControl::addVehicle
bool addVehicle(const std::string &id, SUMOVehicle *v)
Tries to insert the vehicle into the internal vehicle container.
Definition: GUIVehicleControl.cpp:62
GUIVehicleControl::operator=
GUIVehicleControl & operator=(const GUIVehicleControl &s)
invalidated assignment operator
SUMOVehicle
Representation of a vehicle.
Definition: SUMOVehicle.h:61
GUIVehicleControl::secureVehicles
void secureVehicles()
lock access to vehicle removal/additions for thread synchronization
Definition: GUIVehicleControl.cpp:103
GUIVehicleControl
The class responsible for building and deletion of vehicles (gui-version)
Definition: GUIVehicleControl.h:47
SUMOVehicleParameter
Structure representing possible vehicle parameter.
Definition: SUMOVehicleParameter.h:291
GUIVehicleControl::~GUIVehicleControl
~GUIVehicleControl()
Destructor.
Definition: GUIVehicleControl.cpp:41
MSRoute
Definition: MSRoute.h:67
GUIVehicleControl::deleteVehicle
void deleteVehicle(SUMOVehicle *v, bool discard=false)
Deletes the vehicle.
Definition: GUIVehicleControl.cpp:69
GUIVehicleControl::getHaltingVehicleNo
virtual int getHaltingVehicleNo() const
Returns the number of halting vehicles.
Definition: GUIVehicleControl.cpp:76
GUIVehicleControl::getVehicleMeanSpeeds
virtual std::pair< double, double > getVehicleMeanSpeeds() const
get current absolute and relative mean vehicle speed in the network
Definition: GUIVehicleControl.cpp:83
GUIVehicleControl::GUIVehicleControl
GUIVehicleControl()
Constructor.
Definition: GUIVehicleControl.cpp:37
GUIVehicleControl::buildVehicle
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.
Definition: GUIVehicleControl.cpp:50
GUIVehicleControl::releaseVehicles
void releaseVehicles()
unlock access to vehicle removal/additions for thread synchronization
Definition: GUIVehicleControl.cpp:109
GUIVehicleControl::insertVehicleIDs
void insertVehicleIDs(std::vector< GUIGlID > &into, bool listParking, bool listTeleporting)
Returns the list of all known vehicles by gl-id.
Definition: GUIVehicleControl.cpp:90
config.h
MSVehicleControl
The class responsible for building and deletion of vehicles.
Definition: MSVehicleControl.h:72
GUIVehicleControl::myLock
FXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
Definition: GUIVehicleControl.h:125
MSVehicleControl.h