Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
NLTriggerBuilder.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2002-2023 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/****************************************************************************/
22// Builds trigger objects for microsim
23/****************************************************************************/
24#pragma once
25#include <config.h>
26
27#include <string>
28#include <vector>
30
31
32// ===========================================================================
33// class declarations
34// ===========================================================================
35class MSTrigger;
36class MSNet;
38class NLHandler;
40class MSLane;
41class MSEdge;
42class MSStoppingPlace;
43class MSCalibrator;
44class MSRouteProbe;
45
47
48
49// ===========================================================================
50// class definitions
51// ===========================================================================
61public:
64
65
67 virtual ~NLTriggerBuilder();
68
69
74 void setHandler(NLHandler* handler);
75
76
86 void buildVaporizer(const SUMOSAXAttributes& attrs);
87
88
93
94
110 const std::string& base);
111
112
119 void parseAndBuildRerouter(MSNet& net, const SUMOSAXAttributes& attrs);
120
121
129 void parseAndBuildStoppingPlace(MSNet& net, const SUMOSAXAttributes& attrs, const SumoXMLTag element);
130
131
148 virtual void beginParkingArea(MSNet& net,
149 const std::string& id, const std::vector<std::string>& lines,
150 MSLane* lane, double frompos, double topos,
151 unsigned int capacity,
152 double width, double length, double angle, const std::string& name,
153 bool onRoad,
154 const std::string& departPos,
155 bool lefthand);
156
157
171 void addLotEntry(double x, double y, double z,
172 double width, double length,
173 double angle, double slope);
174
175
176
183 void addAccess(MSNet& net, const SUMOSAXAttributes& attrs);
184
185
192 void parseAndBeginParkingArea(MSNet& net, const SUMOSAXAttributes& attrs);
193
194
199 void parseAndAddLotEntry(const SUMOSAXAttributes& attrs);
200
201
206 virtual void endParkingArea();
207
212 virtual void endStoppingPlace();
213
214
222
230
238
246
256
264 void parseAndBuildCalibrator(MSNet& net, const SUMOSAXAttributes& attrs,
265 const std::string& base);
267
268
270
271
272protected:
281
282
295 const std::string& id, const std::vector<MSLane*>& destLanes,
296 const std::string& file);
297
298
312 virtual void buildStoppingPlace(MSNet& net, std::string id, std::vector<std::string> lines, MSLane* lane,
313 double frompos, double topos, const SumoXMLTag element, std::string string,
314 int personCapacity, double parkingLength, RGBColor& color);
315
331 virtual void buildChargingStation(MSNet& net, const std::string& id, MSLane* lane, double frompos, double topos, const std::string& name,
332 double chargingPower, double efficiency, bool chargeInTransit, SUMOTime chargeDelay);
333
346 virtual void buildOverheadWireSegment(MSNet& net, const std::string& id, MSLane* lane, double frompos, double topos, bool voltageSource);
347
359 void buildInnerOverheadWireSegments(MSNet& net, const MSLane* connection, const MSLane* frontConnection, const MSLane* behindConnection);
360
371 void buildTractionSubstation(MSNet& net, std::string id, double voltage, double currentLimit);
372
373 virtual void buildOverheadWireClamp(MSNet& net, const std::string& id, MSLane* lane_start, MSLane* lane_end);
374
386 virtual MSCalibrator* buildCalibrator(MSNet& net,
387 const std::string& id, MSEdge* edge, MSLane* lane, double pos,
388 const std::string& file, const std::string& outfile,
389 const SUMOTime freq,
390 const MSRouteProbe* probe,
391 const double invalidJamThreshold,
392 const std::string& vTypes);
393
406 const std::string& id, const MSEdge* edge, double pos,
407 const std::string& file, const std::string& outfile,
408 const SUMOTime freq,
409 MSRouteProbe* probe,
410 const double invalidJamThreshold,
411 const std::string& vTypes);
412
413
424 const std::string& id, MSEdgeVector& edges,
425 double prob, bool off, SUMOTime timeThreshold,
426 const std::string& vTypes);
428
429
430protected:
433
445 std::string getFileName(const SUMOSAXAttributes& attrs,
446 const std::string& base,
447 const bool allowEmpty = false);
448
449
461 MSLane* getLane(const SUMOSAXAttributes& attrs,
462 const std::string& tt, const std::string& tid);
463
464
478 double getPosition(const SUMOSAXAttributes& attrs,
479 MSLane* lane, const std::string& tt, const std::string& tid, MSEdge* edge = 0);
481
482
483protected:
490
492};
long long int SUMOTime
Definition GUI.h:36
std::vector< MSEdge * > MSEdgeVector
Definition MSEdge.h:73
SumoXMLTag
Numbers representing SUMO-XML - element names.
Calibrates the flow on a segment to a specified one.
Calibrates the flow on a segment to a specified one.
A road/street connecting two junctions.
Definition MSEdge.h:77
Representation of a lane in the micro simulation.
Definition MSLane.h:84
Changes the speed allowed on a set of lanes.
The simulated network and simulation perfomer.
Definition MSNet.h:88
A lane area vehicles can halt at.
Writes routes of vehicles passing a certain edge.
A lane area vehicles can halt at.
Reroutes vehicles passing an edge.
The XML-Handler for network loading.
Definition NLHandler.h:79
Builds trigger objects for microsim.
virtual MSTriggeredRerouter * buildRerouter(MSNet &net, const std::string &id, MSEdgeVector &edges, double prob, bool off, SUMOTime timeThreshold, const std::string &vTypes)
builds an rerouter
NLTriggerBuilder()
Constructor.
virtual void buildOverheadWireClamp(MSNet &net, const std::string &id, MSLane *lane_start, MSLane *lane_end)
MSParkingArea * myParkingArea
definition of the currently parsed parking area
void parseAndBuildTractionSubstation(MSNet &net, const SUMOSAXAttributes &attrs)
Parses its values and builds a traction substation.
void addAccess(MSNet &net, const SUMOSAXAttributes &attrs)
Parses the values and adds an access point to the currently parsed stopping place.
void parseAndBuildOverheadWireSegment(MSNet &net, const SUMOSAXAttributes &attrs)
Parses its values and builds an overhead wire segment.
void parseAndBuildCalibrator(MSNet &net, const SUMOSAXAttributes &attrs, const std::string &base)
Parses his values and builds a mesoscopic or microscopic calibrator.
double getPosition(const SUMOSAXAttributes &attrs, MSLane *lane, const std::string &tt, const std::string &tid, MSEdge *edge=0)
returns the position on the lane checking it
void buildInnerOverheadWireSegments(MSNet &net, const MSLane *connection, const MSLane *frontConnection, const MSLane *behindConnection)
Builds an overhead wire inner segments.
virtual MSLaneSpeedTrigger * buildLaneSpeedTrigger(MSNet &net, const std::string &id, const std::vector< MSLane * > &destLanes, const std::string &file)
Builds a lane speed trigger.
virtual void endParkingArea()
End a parking area.
void parseAndBuildLaneSpeedTrigger(MSNet &net, const SUMOSAXAttributes &attrs, const std::string &base)
Parses his values and builds a lane speed trigger.
void parseAndAddLotEntry(const SUMOSAXAttributes &attrs)
Parses his values and adds a lot entry to current parking area.
NLHandler * myHandler
The parent handler to set for subhandlers.
MSLane * getLane(const SUMOSAXAttributes &attrs, const std::string &tt, const std::string &tid)
Returns the lane defined by attribute "lane".
void buildVaporizer(const SUMOSAXAttributes &attrs)
Builds a vaporization.
virtual void beginParkingArea(MSNet &net, const std::string &id, const std::vector< std::string > &lines, MSLane *lane, double frompos, double topos, unsigned int capacity, double width, double length, double angle, const std::string &name, bool onRoad, const std::string &departPos, bool lefthand)
Begin a parking area.
void parseAndBuildRerouter(MSNet &net, const SUMOSAXAttributes &attrs)
Parses his values and builds a rerouter.
void parseAndBuildOverheadWireSection(MSNet &net, const SUMOSAXAttributes &attrs)
Parses its values and builds an overhead wire section.
void setHandler(NLHandler *handler)
Sets the parent handler to use for nested parsing.
virtual MSCalibrator * buildCalibrator(MSNet &net, const std::string &id, MSEdge *edge, MSLane *lane, double pos, const std::string &file, const std::string &outfile, const SUMOTime freq, const MSRouteProbe *probe, const double invalidJamThreshold, const std::string &vTypes)
builds a microscopic calibrator
virtual ~NLTriggerBuilder()
Destructor.
void buildTractionSubstation(MSNet &net, std::string id, double voltage, double currentLimit)
Builds a traction substation.
void addLotEntry(double x, double y, double z, double width, double length, double angle, double slope)
Add a lot entry to current parking area.
void parseAndBuildChargingStation(MSNet &net, const SUMOSAXAttributes &attrs)
Parses his values and builds a charging station.
void parseAndBuildOverheadWireClamp(MSNet &net, const SUMOSAXAttributes &attrs)
Parses its values and builds an overhead wire clamp.
virtual void endStoppingPlace()
End a stopping place.
virtual void buildOverheadWireSegment(MSNet &net, const std::string &id, MSLane *lane, double frompos, double topos, bool voltageSource)
Builds an overhead wire segment.
MSStoppingPlace * myCurrentStop
The currently parsed stop to add access points to.
MSStoppingPlace * getCurrentStop()
virtual METriggeredCalibrator * buildMECalibrator(MSNet &net, const std::string &id, const MSEdge *edge, double pos, const std::string &file, const std::string &outfile, const SUMOTime freq, MSRouteProbe *probe, const double invalidJamThreshold, const std::string &vTypes)
builds a mesoscopic calibrator
virtual void buildStoppingPlace(MSNet &net, std::string id, std::vector< std::string > lines, MSLane *lane, double frompos, double topos, const SumoXMLTag element, std::string string, int personCapacity, double parkingLength, RGBColor &color)
Builds a stopping place.
virtual void buildChargingStation(MSNet &net, const std::string &id, MSLane *lane, double frompos, double topos, const std::string &name, double chargingPower, double efficiency, bool chargeInTransit, SUMOTime chargeDelay)
Builds a charging station.
void parseAndBuildStoppingPlace(MSNet &net, const SUMOSAXAttributes &attrs, const SumoXMLTag element)
Parses the values and builds a stopping places for busses, trains or container vehicles.
void parseAndBeginParkingArea(MSNet &net, const SUMOSAXAttributes &attrs)
Parses his values and builds a parking area.
std::string getFileName(const SUMOSAXAttributes &attrs, const std::string &base, const bool allowEmpty=false)
Helper method to obtain the filename.
Encapsulated SAX-Attributes.