Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/utils/handlers/AdditionalHandler.h
169678 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4
// This program and the accompanying materials are made available under the
5
// terms of the Eclipse Public License 2.0 which is available at
6
// https://www.eclipse.org/legal/epl-2.0/
7
// This Source Code may also be made available under the following Secondary
8
// Licenses when the conditions for such availability set forth in the Eclipse
9
// Public License 2.0 are satisfied: GNU General Public License, version 2
10
// or later which is available at
11
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13
/****************************************************************************/
14
/// @file AdditionalHandler.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Jun 2021
17
///
18
// The XML-Handler for additionals loading
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include "CommonHandler.h"
24
25
// ===========================================================================
26
// class definitions
27
// ===========================================================================
28
29
class AdditionalHandler : public CommonHandler {
30
31
public:
32
/**@brief Constructor
33
* @param[in] filename Name of the parsed file
34
*/
35
AdditionalHandler(const std::string& filename);
36
37
/// @brief Destructor
38
virtual ~AdditionalHandler();
39
40
/// @brief begin parse attributes
41
bool beginParseAttributes(SumoXMLTag tag, const SUMOSAXAttributes& attrs);
42
43
/// @brief end parse attributes
44
void endParseAttributes();
45
46
/// @brief parse SumoBaseObject (it's called recursivelly)
47
void parseSumoBaseObject(CommonXMLStructure::SumoBaseObject* obj);
48
49
/// @brief run post parser tasks
50
virtual bool postParserTasks() = 0;
51
52
/// @name build functions
53
/// @{
54
/**@brief Builds a bus stop
55
* @param[in] sumoBaseObject sumo base object used for build
56
* @param[in] id The id of the bus stop
57
* @param[in] laneID The lane the bus stop is placed on
58
* @param[in] startPos Begin position of the bus stop on the lane
59
* @param[in] endPos End position of the bus stop on the lane
60
* @param[in] name Name of busStop
61
* @param[in] lines Names of the bus lines that halt on this bus stop
62
* @param[in] personCapacity larger numbers of persons trying to enter will create an upstream jam on the sidewalk.
63
* @param[in] parkingLength parking length
64
* @param[in[ color busStop color
65
* @param[in] friendlyPos enable or disable friendly position
66
* @param[in] angle busStop's angle
67
* @param[in] parameters generic parameters
68
*/
69
virtual bool buildBusStop(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,
70
const double startPos, const double endPos, const std::string& name, const std::vector<std::string>& lines,
71
const int personCapacity, const double parkingLength, const RGBColor& color, const bool friendlyPosition,
72
const double angle, const Parameterised::Map& parameters) = 0;
73
74
/**@brief Builds a train stop
75
* @param[in] sumoBaseObject sumo base object used for build
76
* @param[in] id The id of the train stop
77
* @param[in] laneID The lane the train stop is placed on
78
* @param[in] startPos Begin position of the train stop on the lane
79
* @param[in] endPos End position of the train stop on the lane
80
* @param[in] name Name of trainStop
81
* @param[in] lines Names of the train lines that halt on this train stop
82
* @param[in] personCapacity larger numbers of persons trying to enter will create an upstream jam on the sidewalk.
83
* @param[in] parkingLength parking length
84
* @param[in[ color trainStop color
85
* @param[in] friendlyPos enable or disable friendly position
86
* @param[in] angle trainStop's angle
87
* @param[in] parameters generic parameters
88
*/
89
virtual bool buildTrainStop(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,
90
const double startPos, const double endPos, const std::string& name, const std::vector<std::string>& lines,
91
const int personCapacity, const double parkingLength, const RGBColor& color, const bool friendlyPosition,
92
const double angle, const Parameterised::Map& parameters) = 0;
93
94
/**@brief Builds an Access
95
* @param[in] sumoBaseObject sumo base object used for build
96
* @param[in] busStop GNEAdditional of this Access belongs
97
* @param[in] laneID The lane the Access is placed on
98
* @param[in] pos position of the Access on the lane
99
* @param[in[ length length of the Access
100
* @param[in] friendlyPos enable or disable friendly position
101
* @param[in] parameters generic parameters
102
*/
103
virtual bool buildAccess(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& laneID, const std::string& pos,
104
const double length, const bool friendlyPos, const Parameterised::Map& parameters) = 0;
105
106
/**@brief Builds a container stop
107
* @param[in] sumoBaseObject sumo base object used for build
108
* @param[in] id The id of the container stop
109
* @param[in] laneID The lane the container stop is placed on
110
* @param[in] startPos Begin position of the container stop on the lane
111
* @param[in] endPos End position of the container stop on the lane
112
* @param[in] name Name of container stop
113
* @param[in] lines Names of the bus lines that halt on this container stop
114
* @param[in] containerCapacity larger numbers of containers
115
* @param[in] parkingLength parking length
116
* @param[in[ color containerStop color
117
* @param[in] friendlyPos enable or disable friendly position
118
* @param[in] angle containerStop's angle
119
* @param[in] parameters generic parameters
120
*/
121
virtual bool buildContainerStop(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,
122
const double startPos, const double endPos, const std::string& name, const std::vector<std::string>& lines,
123
const int containerCapacity, const double parkingLength, const RGBColor& color, const bool friendlyPosition,
124
const double angle, const Parameterised::Map& parameters) = 0;
125
126
/**@brief Builds a charging Station
127
* @param[in] sumoBaseObject sumo base object used for build
128
* @param[in] id The id of the charging Station
129
* @param[in] laneID The lane the charging Station is placed on
130
* @param[in] startPos Begin position of the charging Station on the lane
131
* @param[in] endPos End position of the charging Station on the lane
132
* @param[in] name Name of charging station
133
* @param[in] chargingPower power charged in every timeStep
134
* @param[in] efficiency efficiency of the charge
135
* @param[in] chargeInTransit enable or disable charge in transit
136
* @param[in] chargeDelay delay in the charge
137
* @param[in] chargeType charge type (normal, electric or fuel)
138
* @param[in] waitingTime waiting time until start charging
139
* @param[in] friendlyPos enable or disable friendly position
140
* @param[in] parkingAreaID the parking area the charging sttaion is located on
141
* @param[in] parameters generic parameters
142
*/
143
virtual bool buildChargingStation(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,
144
const double startPos, const double endPos, const std::string& name, const double chargingPower,
145
const double efficiency, const bool chargeInTransit, const SUMOTime chargeDelay, const std::string& chargeType,
146
const SUMOTime waitingTime, const bool friendlyPosition, const std::string& parkingAreaID,
147
const Parameterised::Map& parameters) = 0;
148
149
/**@brief Builds a Parking Area
150
* @param[in] sumoBaseObject sumo base object used for build
151
* @param[in] id The id of the Parking >Area
152
* @param[in] laneID The lane the Parking Area is placed on
153
* @param[in] startPos Begin position of the Parking Area on the lane
154
* @param[in] endPos End position of the Parking Area on the lane
155
* @param[in] departPos lane position in that vehicle must depart when leaves parkingArea
156
* @param[in] name Name of Parking Area
157
* @param[in] friendlyPos enable or disable friendly position
158
* @param[in] roadSideCapacity road side capacity of ParkingArea
159
* @param[in] width ParkingArea's width
160
* @param[in] length ParkingArea's length
161
* @param[in] angle ParkingArea's angle
162
* @param[in] lefthand enable or disable lefthand
163
* @param[in] parameters generic parameters
164
*/
165
virtual bool buildParkingArea(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,
166
const double startPos, const double endPos, const std::string& departPos, const std::string& name,
167
const std::vector<std::string>& lines, const bool friendlyPosition, const int roadSideCapacity, const bool onRoad,
168
const double width, const double length, const double angle, const bool lefthand, const Parameterised::Map& parameters) = 0;
169
170
/**@brief Builds a Parking Space
171
* @param[in] sumoBaseObject sumo base object used for build
172
* @param[in] x Position X
173
* @param[in] y Position Y
174
* @param[in] z Position Z
175
* @param[in] name Name of Parking Area
176
* @param[in] width ParkingArea's width
177
* @param[in] length ParkingArea's length
178
* @param[in] angle ParkingArea's angle
179
* @param[in] slope ParkingArea's slope (of this space)
180
* @param[in] parameters generic parameters
181
*/
182
virtual bool buildParkingSpace(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const double x, const double y, const double z,
183
const std::string& name, const std::string& width, const std::string& length, const std::string& angle,
184
const double slope, const Parameterised::Map& parameters) = 0;
185
186
/**@brief Builds a induction loop detector (E1)
187
* @param[in] sumoBaseObject sumo base object used for build
188
* @param[in] id The id of the detector
189
* @param[in] laneID The lane the detector is placed on
190
* @param[in] pos position of the detector on the lane
191
* @param[in] period the aggregation period the values the detector collects shall be summed up.
192
* @param[in] filename The path to the output file.
193
* @param[in] vtypes list of vehicle types to be reported
194
* @param[in] nextEdges list of edge ids that must all be part of the future route of the vehicle to qualify for detection
195
* @param[in] detectPersons detect persons instead of vehicles (pedestrians or passengers)
196
* @param[in] name E1 detector name
197
* @param[in] friendlyPos enable or disable friendly position
198
* @param[in] parameters generic parameters
199
*/
200
virtual bool buildE1Detector(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,
201
const double position, const SUMOTime period, const std::string& file, const std::vector<std::string>& vehicleTypes,
202
const std::vector<std::string>& nextEdges, const std::string& detectPersons, const std::string& name,
203
const bool friendlyPos, const Parameterised::Map& parameters) = 0;
204
205
/**@brief Builds a single-lane Area Detector (E2)
206
* @param[in] sumoBaseObject sumo base object used for build
207
* @param[in] id The id of the detector
208
* @param[in] laneID The lane the detector is placed on
209
* @param[in] pos position of the detector on the lane
210
* @param[in[ length length of the detector
211
* @param[in] period the aggregation period the values the detector collects shall be summed up.
212
* @param[in] trafficLight The traffic light that triggers aggregation when switching.
213
* @param[in] filename The path to the output file.
214
* @param[in] vtypes list of vehicle types to be reported
215
* @param[in] nextEdges list of edge ids that must all be part of the future route of the vehicle to qualify for detection
216
* @param[in] detectPersons detect persons instead of vehicles (pedestrians or passengers)
217
* @param[in] name E2 detector name
218
* @param[in] timeThreshold The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting
219
* @param[in] speedThreshold The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting
220
* @param[in] jamThreshold The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam
221
* @param[in] friendlyPos enable or disable friendly position
222
* @param[in] show detector in sumo-gui
223
* @param[in] parameters generic parameters
224
*/
225
virtual bool buildSingleLaneDetectorE2(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,
226
const double pos, const double length, const SUMOTime period, const std::string& trafficLight, const std::string& filename,
227
const std::vector<std::string>& vehicleTypes, const std::vector<std::string>& nextEdges, const std::string& detectPersons,
228
const std::string& name, const SUMOTime timeThreshold, const double speedThreshold, const double jamThreshold,
229
const bool friendlyPos, const bool show, const Parameterised::Map& parameters) = 0;
230
231
/**@brief Builds a multi-lane Area Detector (E2)
232
* @param[in] sumoBaseObject sumo base object used for build
233
* @param[in] id The id of the detector
234
* @param[in] laneIDs The lanes the detector is placed on
235
* @param[in] pos position of the detector on the first lane
236
* @param[in] endPos position of the detector on the last lane
237
* @param[in] period the aggregation period the values the detector collects shall be summed up.
238
* @param[in] trafficLight The traffic light that triggers aggregation when switching.
239
* @param[in] filename The path to the output file.
240
* @param[in] vtypes list of vehicle types to be reported
241
* @param[in] nextEdges list of edge ids that must all be part of the future route of the vehicle to qualify for detection
242
* @param[in] detectPersons detect persons instead of vehicles (pedestrians or passengers)
243
* @param[in] name E2 detector name
244
* @param[in] timeThreshold The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting
245
* @param[in] speedThreshold The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting
246
* @param[in] jamThreshold The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam
247
* @param[in] friendlyPos enable or disable friendly position
248
* @param[in] show detector in sumo-gui
249
* @param[in] parameters generic parameters
250
*/
251
virtual bool buildMultiLaneDetectorE2(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::vector<std::string>& laneIDs,
252
const double pos, const double endPos, const SUMOTime period, const std::string& trafficLight, const std::string& filename,
253
const std::vector<std::string>& vehicleTypes, const std::vector<std::string>& nextEdges, const std::string& detectPersons,
254
const std::string& name, const SUMOTime timeThreshold, const double speedThreshold, const double jamThreshold,
255
const bool friendlyPos, const bool show, const Parameterised::Map& parameters) = 0;
256
257
/**@brief Builds a multi entry exit detector (E3)
258
* @param[in] sumoBaseObject sumo base object used for build
259
* @param[in] id The id of the detector
260
* @param[in] pos position of the detector in the map
261
* @param[in] period the aggregation period the values the detector collects shall be summed up.
262
* @param[in] filename The path to the output file.
263
* @param[in] vtypes list of vehicle types to be reported
264
* @param[in] nextEdges list of edge ids that must all be part of the future route of the vehicle to qualify for detection
265
* @param[in] detectPersons detect persons instead of vehicles (pedestrians or passengers)
266
* @param[in] name E2 detector name
267
* @param[in] timeThreshold The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting
268
* @param[in] speedThreshold The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting
269
* @param[in] openEntry enable or disable open Entry
270
* @param[in] expectedArrival Whether no warning should be issued when a vehicle arrives within the detector area
271
* @param[in] parameters generic parameters
272
*/
273
virtual bool buildDetectorE3(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const Position& pos, const SUMOTime period,
274
const std::string& filename, const std::vector<std::string>& vehicleTypes, const std::vector<std::string>& nextEdges,
275
const std::string& detectPersons, const std::string& name, const SUMOTime timeThreshold, const double speedThreshold,
276
const bool openEntry, const bool expectedArrival, const Parameterised::Map& parameters) = 0;
277
278
/**@brief Builds a entry detector (E3)
279
* @param[in] sumoBaseObject sumo base object used for build
280
* @param[in] laneID The lane in which the entry detector is placed on
281
* @param[in] pos position of the entry detector on the lane
282
* @param[in] friendlyPos enable or disable friendly position
283
* @param[in] parameters generic parameters
284
*/
285
virtual bool buildDetectorEntry(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& laneID, const double pos, const bool friendlyPos,
286
const Parameterised::Map& parameters) = 0;
287
288
/**@brief Builds a exit detector (E3)
289
* @param[in] sumoBaseObject sumo base object used for build
290
* @param[in] laneID The lane in which the exit detector is placed on
291
* @param[in] pos position of the exit detector on the lane
292
* @param[in] friendlyPos enable or disable friendly position
293
* @param[in] parameters generic parameters
294
*/
295
virtual bool buildDetectorExit(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& laneID, const double pos, const bool friendlyPos,
296
const Parameterised::Map& parameters) = 0;
297
298
/**@brief Builds a Instant Induction Loop Detector (E1Instant)
299
* @param[in] sumoBaseObject sumo base object used for build
300
* @param[in] id The id of the detector
301
* @param[in] laneID The lane the detector is placed on
302
* @param[in] pos position of the detector on the lane
303
* @param[in] filename The path to the output file.
304
* @param[in] name E2 detector name
305
* @param[in] vtypes list of vehicle types to be reported
306
* @param[in] nextEdges list of edge ids that must all be part of the future route of the vehicle to qualify for detection
307
* @param[in] detectPersons detect persons instead of vehicles (pedestrians or passengers)
308
* @param[in] friendlyPos enable or disable friendly position
309
* @param[in] parameters generic parameters
310
*/
311
virtual bool buildDetectorE1Instant(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,
312
const double pos, const std::string& filename, const std::vector<std::string>& vehicleTypes,
313
const std::vector<std::string>& nextEdges, const std::string& detectPersons, const std::string& name,
314
const bool friendlyPos, const Parameterised::Map& parameters) = 0;
315
316
/**@brief builds a microscopic calibrator over a lane
317
* @param[in] id The id of the calibrator
318
* @param[in] laneID The lane the calibrator is placed at
319
* @param[in] pos The position on the edge the calibrator lies at
320
* @param[in] name Calibrator name
321
* @param[in] outfile te file in which write results
322
* @param[in] jamThreshold A threshold value to detect and clear unexpected jamming
323
* @param[in] vTypes space separated list of vehicle type ids to consider
324
* @param[in] parameters generic parameters
325
*/
326
virtual bool buildLaneCalibrator(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,
327
const double pos, const std::string& name, const std::string& outfile, const SUMOTime period, const std::string& routeprobe,
328
const double jamThreshold, const std::vector<std::string>& vTypes, const Parameterised::Map& parameters) = 0;
329
330
/**@brief builds a microscopic calibrator over an edge
331
* @param[in] sumoBaseObject sumo base object used for build
332
* @param[in] id The id of the calibrator
333
* @param[in] edgeID The edge the calibrator is placed at
334
* @param[in] pos The position on the edge the calibrator lies at
335
* @param[in] name Calibrator name
336
* @param[in] outfile te file in which write results
337
* @param[in] centerAfterCreation center camera after creation
338
* @param[in] routeProbe route probe vinculated with this calibrator
339
* @param[in] jamThreshold A threshold value to detect and clear unexpected jamming
340
* @param[in] vTypes space separated list of vehicle type ids to consider
341
* @param[in] parameters generic parameters
342
*/
343
virtual bool buildEdgeCalibrator(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& edgeID,
344
const double pos, const std::string& name, const std::string& outfile, const SUMOTime period, const std::string& routeprobe,
345
const double jamThreshold, const std::vector<std::string>& vTypes, const Parameterised::Map& parameters) = 0;
346
347
/**@brief builds a calibrator flow
348
* @param[in] sumoBaseObject sumo base object used for build
349
* @param[in] vehicleParameter calibratorFlow parameter
350
*/
351
virtual bool buildCalibratorFlow(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameter) = 0;
352
353
/**@brief builds a rerouter
354
* @param[in] sumoBaseObject sumo base object used for build
355
* @param[in] id The id of the rerouter
356
* @param[in] pos position of the rerouter in the map
357
* @param[in] edgeIDs The edges the rerouter is placed at
358
* @param[in] prob The probability the rerouter reoutes vehicles with
359
* @param[in] name Calibrator name
360
* @param[in] parameters generic parameters
361
*/
362
virtual bool buildRerouter(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const Position& pos,
363
const std::vector<std::string>& edgeIDs, const double prob, const std::string& name, const bool off, const bool optional,
364
const SUMOTime timeThreshold, const std::vector<std::string>& vTypes, const Parameterised::Map& parameters) = 0;
365
366
/**@brief builds a rerouter interval
367
* @param[in] sumoBaseObject sumo base object used for build
368
* @param[in] begin begin of interval
369
* @param[in] end end of interval
370
*/
371
virtual bool buildRerouterInterval(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOTime begin, const SUMOTime end) = 0;
372
373
/**@brief builds a closing lane reroute
374
* @param[in] sumoBaseObject sumo base object used for build
375
* @param[in] closedLane closed lane
376
* @param[in] permissions vClasses disallowed for the lane
377
*/
378
virtual bool buildClosingLaneReroute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& closedLane, SVCPermissions permissions) = 0;
379
380
/**@brief builds a closing edge reroute
381
* @param[in] sumoBaseObject sumo base object used for build
382
* @param[in] closedEdgeID closed edge
383
* @param[in] permissions vClasses disallowed for the lane
384
*/
385
virtual bool buildClosingReroute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& closedEdgeID, SVCPermissions permissions) = 0;
386
387
/**@brief builds a dest prob reroute
388
* @param[in] sumoBaseObject sumo base object used for build
389
* @param[in] newEdgeDestinationID new edge destination ID
390
* @param[in] probability rerouting probability
391
*/
392
virtual bool buildDestProbReroute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& newEdgeDestinationID, const double probability) = 0;
393
394
/**@brief builds a parking area reroute
395
* @param[in] sumoBaseObject sumo base object used for build
396
* @param[in] newParkignAreaID new parkingArea ID
397
* @param[in] probability rerouting probability
398
*/
399
virtual bool buildParkingAreaReroute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& newParkignAreaID, const double probability, const bool visible) = 0;
400
401
/**@brief builds a route prob reroute
402
* @param[in] sumoBaseObject sumo base object used for build
403
* @param[in] newRouteID new route ID
404
* @param[in] probability rerouting probability
405
*/
406
virtual bool buildRouteProbReroute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& newRouteID, const double probability) = 0;
407
408
/**@brief builds a Route probe
409
* @param[in] sumoBaseObject sumo base object used for build
410
* @param[in] id The id of the routeprobe
411
* @param[in] edgeID The edges the routeprobe is placed at
412
* @param[in] period the aggregation period the values the routeprobe collects shall be summed up.
413
* @param[in] name Calibrator name
414
* @param[in] file The file to read the routeprobe definitions from
415
* @param[in] begin The time at which to start generating output
416
* @param[in] vtypes list of vehicle types to be affected
417
* @param[in] parameters generic parameters
418
*/
419
virtual bool buildRouteProbe(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& edgeID, const SUMOTime period,
420
const std::string& name, const std::string& file, const SUMOTime begin, const std::vector<std::string>& vTypes,
421
const Parameterised::Map& parameters) = 0;
422
423
/**@brief Builds a VariableSpeedSign (lane speed additional)
424
* @param[in] sumoBaseObject sumo base object used for build
425
* @param[in] id The id of the lane speed additional
426
* @param[in] destLanes List of lanes affected by this speed additional
427
* @param[in] name VSS name
428
* @param[in] vtypes list of vehicle types to be affected
429
* @param[in] parameters generic parameters
430
*/
431
virtual bool buildVariableSpeedSign(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const Position& pos,
432
const std::vector<std::string>& laneIDs, const std::string& name, const std::vector<std::string>& vTypes,
433
const Parameterised::Map& parameters) = 0;
434
435
/**@brief Builds a VariableSpeedSign Step
436
* @param[in] sumoBaseObject sumo base object used for build
437
* @param[in] time step's time
438
* @param[in] speed new step's speed
439
*/
440
virtual bool buildVariableSpeedSignStep(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOTime time, const double speed) = 0;
441
442
/**@brief Builds a vaporizer (lane speed additional)
443
* @param[in] sumoBaseObject sumo base object used for build
444
* @param[in] edgeID edge in which this vaporizer is placed
445
* @param[in] from time in which this vaporizer start
446
* @param[in] endTime time in which this vaporizer ends
447
* @param[in] name Vaporizer name
448
* @param[in] parameters generic parameters
449
*/
450
virtual bool buildVaporizer(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& edgeID, const SUMOTime from,
451
const SUMOTime endTime, const std::string& name, const Parameterised::Map& parameters) = 0;
452
453
/**@brief Builds a TAZ (Traffic Assignment Zone)
454
* @param[in] sumoBaseObject sumo base object used for build
455
* @param[in] id TAZ ID
456
* @param[in] shape TAZ shape
457
* @param[in] center shape center
458
* @param[in] fill Whether the TAZ shall be filled
459
* @param[in] edgeIDs list of edges (note: This will create GNETAZSourceSinks/Sinks with default values)
460
* @param[in] name Vaporizer name
461
* @param[in] parameters generic parameters
462
*/
463
virtual bool buildTAZ(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const PositionVector& shape,
464
const Position& center, const bool fill, const RGBColor& color, const std::vector<std::string>& edgeIDs,
465
const std::string& name, const Parameterised::Map& parameters) = 0;
466
467
/**@brief Builds a TAZSource (Traffic Assignment Zone)
468
* @param[in] sumoBaseObject sumo base object used for build
469
* @param[in] TAZ Traffic Assignment Zone in which this TAZSource is palced
470
* @param[in] edgeID edge in which TAZSource is placed
471
* @param[in] departWeight depart weight of TAZSource
472
*/
473
virtual bool buildTAZSource(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& edgeID, const double departWeight) = 0;
474
475
/**@brief Builds a TAZSink (Traffic Assignment Zone)
476
* @param[in] net net in which element will be inserted
477
* @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y
478
* @param[in] TAZ Traffic Assignment Zone in which this TAZSink is palced
479
* @param[in] edgeID edge in which TAZSink is placed
480
* @param[in] arrivalWeight arrival weight of TAZSink
481
*/
482
virtual bool buildTAZSink(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& edgeID, const double arrivalWeight) = 0;
483
484
/**@brief build traction substation
485
* @param[in] id Traction substation ID
486
* @param[in] pos Position of traction substation in view (optional)
487
* @param[in] voltage Voltage of at connection point for the overhead wire
488
* @param[in] currentLimit Current limit of the feeder line
489
* @param[in] parameters generic parameters
490
*/
491
virtual bool buildTractionSubstation(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const Position& pos,
492
const double voltage, const double currentLimit, const Parameterised::Map& parameters) = 0;
493
494
/**@brief build overhead wire
495
* @param[in] id Overhead wire ID
496
* @param[in] lane Lane over which the segment is placed
497
* @param[in] substationId Substation to which the circuit is connected
498
* @param[in] laneIDs list of consecutive lanes of the circuit
499
* @param[in] startPos Starting position in the specified lane
500
* @param[in] endPos Ending position in the specified lane
501
* @param[in] friendlyPos enable or disable friendly position
502
* @param[in] forbiddenInnerLanes Inner lanes, where placing of overhead wire is restricted
503
* @param[in] parameters generic parameters
504
*/
505
virtual bool buildOverheadWire(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& substationId,
506
const std::vector<std::string>& laneIDs, const double startPos, const double endPos, const bool friendlyPos,
507
const std::vector<std::string>& forbiddenInnerLanes, const Parameterised::Map& parameters) = 0;
508
509
/**@brief build overhead wire clamp
510
* @param[in] id Overhead wire clamp ID
511
* @param[in] overheadWireIDStartClamp ID of the overhead wire segment, to the start of which the overhead wire clamp is connected
512
* @param[in] laneIDStartClamp ID of the overhead wire segment lane of overheadWireIDStartClamp
513
* @param[in] overheadWireIDEndClamp ID of the overhead wire segment, to the end of which the overhead wire clamp is connected
514
* @param[in] laneIDEndClamp ID of the overhead wire segment lane of overheadWireIDEndClamp
515
* @param[in] parameters generic parameters
516
*/
517
virtual bool buildOverheadWireClamp(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& overheadWireIDStartClamp,
518
const std::string& laneIDStartClamp, const std::string& overheadWireIDEndClamp, const std::string& laneIDEndClamp,
519
const Parameterised::Map& parameters) = 0;
520
521
/**@brief Builds a polygon using the given values
522
* @param[in] sumoBaseObject sumo base object used for build
523
* @param[in] id The name of the polygon
524
* @param[in] type The (abstract) type of the polygon
525
* @param[in] color The color of the polygon
526
* @param[in] layer The layer of the polygon
527
* @param[in] angle The rotation of the polygon
528
* @param[in] imgFile The raster image of the polygon
529
* @param[in] shape The shape of the polygon
530
* @param[in] geo specify if shape was loaded as GEO coordinate
531
* @param[in] fill Whether the polygon shall be filled
532
* @param[in] lineWidth Line width when drawing unfilled polygon
533
* @param[in] name polygon name
534
* @param[in] parameters generic parameters
535
*/
536
virtual bool buildPolygon(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& type,
537
const RGBColor& color, const double layer, const double angle, const std::string& imgFile, const PositionVector& shape,
538
const bool geo, const bool fill, const double lineWidth, const std::string& name, const Parameterised::Map& parameters) = 0;
539
540
/**@brief Builds a POI using the given values
541
* @param[in] sumoBaseObject sumo base object used for build
542
* @param[in] id The name of the POI
543
* @param[in] type The (abstract) type of the POI
544
* @param[in] color The color of the POI
545
* @param[in] x POI's x position
546
* @param[in] y POI's y position
547
* @param[in] icon The icon of the POI
548
* @param[in] layer The layer of the POI
549
* @param[in] angle The rotation of the POI
550
* @param[in] imgFile The raster image of the POI
551
* @param[in] width The width of the POI image
552
* @param[in] height The height of the POI image
553
* @param[in] name POI name
554
* @param[in] parameters generic parameters
555
*/
556
virtual bool buildPOI(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& type,
557
const RGBColor& color, const double x, const double y, const std::string& icon, const double layer,
558
const double angle, const std::string& imgFile, const double width, const double height, const std::string& name,
559
const Parameterised::Map& parameters) = 0;
560
561
/**@brief Builds a POI over lane using the given values
562
* @param[in] sumoBaseObject sumo base object used for build
563
* @param[in] id The name of the POI
564
* @param[in] type The (abstract) type of the POI
565
* @param[in] color The color of the POI
566
* @param[in] laneID The Lane in which this POI is placed
567
* @param[in] posOverLane The position over Lane
568
* @param[in] friendlyPos enable or disable friendly position
569
* @param[in] posLat The position lateral over Lane
570
* @param[in] icon The icon of the POI
571
* @param[in] layer The layer of the POI
572
* @param[in] angle The rotation of the POI
573
* @param[in] imgFile The raster image of the POI
574
* @param[in] width The width of the POI image
575
* @param[in] height The height of the POI image
576
* @param[in] name POI name
577
* @param[in] parameters generic parameters
578
*/
579
virtual bool buildPOILane(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& type, const RGBColor& color,
580
const std::string& laneID, const double posOverLane, const bool friendlyPosition, const double posLat, const std::string& icon,
581
const double layer, const double angle, const std::string& imgFile, const double width, const double height, const std::string& name,
582
const Parameterised::Map& parameters) = 0;
583
584
/**@brief Builds a POI in GEO coordinaten using the given values
585
* @param[in] sumoBaseObject sumo base object used for build
586
* @param[in] id The name of the POI
587
* @param[in] type The (abstract) type of the POI
588
* @param[in] color The color of the POI
589
* @param[in] lon POI's longitud
590
* @param[in] lat POI's latitud
591
* @param[in] icon The icon of the POI
592
* @param[in] layer The layer of the POI
593
* @param[in] angle The rotation of the POI
594
* @param[in] imgFile The raster image of the POI
595
* @param[in] width The width of the POI image
596
* @param[in] height The height of the POI image
597
* @param[in] name POI name
598
* @param[in] parameters generic parameters
599
*/
600
virtual bool buildPOIGeo(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& type,
601
const RGBColor& color, const double lon, const double lat, const std::string& icon, const double layer,
602
const double angle, const std::string& imgFile, const double width, const double height, const std::string& name,
603
const Parameterised::Map& parameters) = 0;
604
605
/**@brief Builds a JuPedSim walkable area using the given values
606
* @param[in] sumoBaseObject sumo base object used for build
607
* @param[in] id The name of the walkable area
608
* @param[in] shape The shape of the walkable area
609
* @param[in] geo specify if shape was loaded as GEO
610
* @param[in] name walkable area name
611
* @param[in] parameters generic parameters
612
*/
613
virtual bool buildJpsWalkableArea(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const PositionVector& shape,
614
bool geo, const std::string& name, const Parameterised::Map& parameters) = 0;
615
616
/**@brief Builds a JuPedSim obstacle using the given values
617
* @param[in] sumoBaseObject sumo base object used for build
618
* @param[in] id The name of the obstacle
619
* @param[in] shape The shape of the obstacle
620
* @param[in] geo specify if shape was loaded as GEO
621
* @param[in] name obstacle name
622
* @param[in] parameters generic parameters
623
*/
624
virtual bool buildJpsObstacle(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const PositionVector& shape,
625
bool geo, const std::string& name, const Parameterised::Map& parameters) = 0;
626
627
/// @}
628
629
private:
630
/// @name parse additional attributes
631
/// @{
632
/// @brief parse busStop attributes
633
void parseBusStopAttributes(const SUMOSAXAttributes& attrs);
634
635
/// @brief parse trainStop attributes
636
void parseTrainStopAttributes(const SUMOSAXAttributes& attrs);
637
638
/// @brief parse access attributes
639
void parseAccessAttributes(const SUMOSAXAttributes& attrs);
640
641
/// @brief parse containerStop attributes
642
void parseContainerStopAttributes(const SUMOSAXAttributes& attrs);
643
644
/// @brief parse chargingStation attributes
645
void parseChargingStationAttributes(const SUMOSAXAttributes& attrs);
646
647
/// @brief parse parking area attributes
648
void parseParkingAreaAttributes(const SUMOSAXAttributes& attrs);
649
650
/// @brief parse parking space attributes
651
void parseParkingSpaceAttributes(const SUMOSAXAttributes& attrs);
652
653
/// @brief parse E1 attributes
654
void parseE1Attributes(const SUMOSAXAttributes& attrs);
655
656
/// @brief parse E2 attributes
657
void parseE2Attributes(const SUMOSAXAttributes& attrs);
658
659
/// @brief parse E3 attributes
660
void parseE3Attributes(const SUMOSAXAttributes& attrs);
661
662
/// @brief parse entry attributes
663
void parseEntryAttributes(const SUMOSAXAttributes& attrs);
664
665
/// @brief parse exist attributes
666
void parseExitAttributes(const SUMOSAXAttributes& attrs);
667
668
/// @brief parse E1 instant attributes
669
void parseE1InstantAttributes(const SUMOSAXAttributes& attrs);
670
671
/// @brief parse TAZ attributes
672
void parseTAZAttributes(const SUMOSAXAttributes& attrs);
673
674
/// @brief parse TAZ source attributes
675
void parseTAZSourceAttributes(const SUMOSAXAttributes& attrs);
676
677
/// @brief parse TAZ sink attributes
678
void parseTAZSinkAttributes(const SUMOSAXAttributes& attrs);
679
680
/// @brief parse variable speed sign attributes
681
void parseVariableSpeedSignAttributes(const SUMOSAXAttributes& attrs);
682
683
/// @brief parse variable speed sign step attributes
684
void parseVariableSpeedSignStepAttributes(const SUMOSAXAttributes& attrs);
685
686
/// @brief parse calibrator attributes
687
void parseCalibratorAttributes(const SUMOSAXAttributes& attrs);
688
689
/// @brief parse calibrator flow attributes
690
void parseCalibratorFlowAttributes(const SUMOSAXAttributes& attrs);
691
692
/// @brief parse rerouter attributes
693
void parseRerouterAttributes(const SUMOSAXAttributes& attrs);
694
695
/// @brief parse rerouter interval attributes
696
void parseRerouterIntervalAttributes(const SUMOSAXAttributes& attrs);
697
698
/// @brief parse closing lane reroute attributes
699
void parseClosingLaneRerouteAttributes(const SUMOSAXAttributes& attrs);
700
701
/// @brief parse closing reroute attributes
702
void parseClosingRerouteAttributes(const SUMOSAXAttributes& attrs);
703
704
/// @brief parse dest prob reroute attributes
705
void parseDestProbRerouteAttributes(const SUMOSAXAttributes& attrs);
706
707
/// @brief parse parking area reroute attributes
708
void parseParkingAreaRerouteAttributes(const SUMOSAXAttributes& attrs);
709
710
/// @brief parse route prob reroute attributes
711
void parseRouteProbRerouteAttributes(const SUMOSAXAttributes& attrs);
712
713
/// @brief parse route probe attributes
714
void parseRouteProbeAttributes(const SUMOSAXAttributes& attrs);
715
716
/// @brief parse vaporizer attributes
717
void parseVaporizerAttributes(const SUMOSAXAttributes& attrs);
718
719
/// @brief parse traction substation
720
void parseTractionSubstation(const SUMOSAXAttributes& attrs);
721
722
/// @brief parse overhead wire segment
723
void parseOverheadWire(const SUMOSAXAttributes& attrs);
724
725
/// @brief parse overhead wire clamp
726
void parseOverheadWireClamp(const SUMOSAXAttributes& attrs);
727
728
// @brief parse poly attributes
729
void parsePolyAttributes(const SUMOSAXAttributes& attrs);
730
731
/// @brief parse POI attributes
732
void parsePOIAttributes(const SUMOSAXAttributes& attrs);
733
734
/// @brief parse juPedSim walkable area attributes
735
void parseJpsWalkableAreaAttributes(const SUMOSAXAttributes& attrs);
736
737
/// @brief parse juPedSim obstacle attributes
738
void parseJpsObstacleAttributes(const SUMOSAXAttributes& attrs);
739
740
/// @}
741
742
/// @brief check calibrator flow parents
743
bool checkCalibratorFlowParents();
744
745
/// @brief check detect persons
746
bool checkDetectPersons(const SumoXMLTag currentTag, const std::string& id, const std::string& detectPersons);
747
748
/// @brief invalidate default onstructor
749
AdditionalHandler() = delete;
750
751
/// @brief invalidate copy constructor
752
AdditionalHandler(const AdditionalHandler& s) = delete;
753
754
/// @brief invalidate assignment operator
755
AdditionalHandler& operator=(const AdditionalHandler& s) = delete;
756
};
757
758