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