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 /****************************************************************************/
16 // The class responsible for building and deletion of vehicles (gui-version)
17 /****************************************************************************/
18 #ifndef GUIVehicleControl_h
19 #define GUIVehicleControl_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <vector>
28 #include <fx.h>
31 
32 
33 // ===========================================================================
34 // class definitions
35 // ===========================================================================
47 public:
50 
51 
54 
55 
58 
72  const MSRoute* route, MSVehicleType* type,
73  const bool ignoreStopErrors, const bool fromRouteFile = true);
75 
76 
85  bool addVehicle(const std::string& id, SUMOVehicle* v);
86 
87 
95  void deleteVehicle(SUMOVehicle* v, bool discard = false);
96 
97 
104  void insertVehicleIDs(std::vector<GUIGlID>& into, bool listParking, bool listTeleporting);
105 
106 
110  virtual int getHaltingVehicleNo() const;
111 
113  virtual std::pair<double, double> getVehicleMeanSpeeds() const;
114 
116  void secureVehicles();
117 
119  void releaseVehicles();
120 
121 
122 private:
124  mutable FXMutex myLock;
125 
126 
127 private:
130 
133 
134 
135 };
136 
137 
138 #endif
139 
140 /****************************************************************************/
141 
MSVehicleType
The car-following model and parameter.
Definition: MSVehicleType.h:65
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:61
GUIVehicleControl::operator=
GUIVehicleControl & operator=(const GUIVehicleControl &s)
invalidated assignment operator
SUMOVehicle
Representation of a vehicle.
Definition: SUMOVehicle.h:60
GUIVehicleControl::secureVehicles
void secureVehicles()
lock access to vehicle removal/additions for thread synchronization
Definition: GUIVehicleControl.cpp:102
GUIVehicleControl
The class responsible for building and deletion of vehicles (gui-version)
Definition: GUIVehicleControl.h:46
SUMOVehicleParameter
Structure representing possible vehicle parameter.
Definition: SUMOVehicleParameter.h:297
GUIVehicleControl::~GUIVehicleControl
~GUIVehicleControl()
Destructor.
Definition: GUIVehicleControl.cpp:40
MSRoute
Definition: MSRoute.h:66
GUIVehicleControl::deleteVehicle
void deleteVehicle(SUMOVehicle *v, bool discard=false)
Deletes the vehicle.
Definition: GUIVehicleControl.cpp:68
GUIVehicleControl::getHaltingVehicleNo
virtual int getHaltingVehicleNo() const
Returns the number of halting vehicles.
Definition: GUIVehicleControl.cpp:75
GUIVehicleControl::getVehicleMeanSpeeds
virtual std::pair< double, double > getVehicleMeanSpeeds() const
get current absolute and relative mean vehicle speed in the network
Definition: GUIVehicleControl.cpp:82
GUIVehicleControl::GUIVehicleControl
GUIVehicleControl()
Constructor.
Definition: GUIVehicleControl.cpp:36
GUIVehicleControl::GUIVehicleControl
GUIVehicleControl(const GUIVehicleControl &s)
invalidated copy constructor
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:49
GUIVehicleControl::releaseVehicles
void releaseVehicles()
unlock access to vehicle removal/additions for thread synchronization
Definition: GUIVehicleControl.cpp:108
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:89
config.h
MSVehicleControl
The class responsible for building and deletion of vehicles.
Definition: MSVehicleControl.h:71
GUIVehicleControl::myLock
FXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
Definition: GUIVehicleControl.h:124
MSVehicleControl.h