Eclipse SUMO - Simulation of Urban MObility
NLTriggerBuilder.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2002-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
18 // Builds trigger objects for microsim
19 /****************************************************************************/
20 #ifndef NLTriggerBuilder_h
21 #define NLTriggerBuilder_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #include <config.h>
28 
29 #include <string>
30 #include <vector>
31 
32 
33 // ===========================================================================
34 // class declarations
35 // ===========================================================================
36 class MSTrigger;
37 class MSNet;
38 class MSLaneSpeedTrigger;
39 class NLHandler;
41 class MSLane;
42 class MSEdge;
43 class MSStoppingPlace;
44 class MSCalibrator;
45 class MSRouteProbe;
46 
48 
49 
50 // ===========================================================================
51 // class definitions
52 // ===========================================================================
62 public:
65 
66 
68  virtual ~NLTriggerBuilder();
69 
70 
75  void setHandler(NLHandler* handler);
76 
77 
87  void buildVaporizer(const SUMOSAXAttributes& attrs);
88 
89 
94 
95 
110  void parseAndBuildLaneSpeedTrigger(MSNet& net, const SUMOSAXAttributes& attrs,
111  const std::string& base);
112 
113 
121  void parseAndBuildRerouter(MSNet& net, const SUMOSAXAttributes& attrs,
122  const std::string& base);
123 
124 
132  void parseAndBuildStoppingPlace(MSNet& net, const SUMOSAXAttributes& attrs, const SumoXMLTag element);
133 
134 
151  virtual void beginParkingArea(MSNet& net,
152  const std::string& id, const std::vector<std::string>& lines,
153  MSLane* lane, double frompos, double topos,
154  unsigned int capacity,
155  double width, double length, double angle, const std::string& name,
156  bool onRoad);
157 
158 
171  void addLotEntry(double x, double y, double z,
172  double width, double length, double angle);
173 
174 
175 
182  void addAccess(MSNet& net, const SUMOSAXAttributes& attrs);
183 
184 
191  void parseAndBeginParkingArea(MSNet& net, const SUMOSAXAttributes& attrs);
192 
193 
198  void parseAndAddLotEntry(const SUMOSAXAttributes& attrs);
199 
200 
205  virtual void endParkingArea();
206 
211  virtual void endStoppingPlace();
212 
213 
220  void parseAndBuildChargingStation(MSNet& net, const SUMOSAXAttributes& attrs);
221 
229  void parseAndBuildCalibrator(MSNet& net, const SUMOSAXAttributes& attrs,
230  const std::string& base);
232 
233 
235 
236 
237 protected:
246 
247 
260  const std::string& id, const std::vector<MSLane*>& destLanes,
261  const std::string& file);
262 
263 
277  virtual void buildStoppingPlace(MSNet& net, std::string id, std::vector<std::string> lines, MSLane* lane,
278  double frompos, double topos, const SumoXMLTag element, std::string string, int personCapacity);
279 
295  virtual void buildChargingStation(MSNet& net, const std::string& id, MSLane* lane, double frompos, double topos, const std::string& name,
296  double chargingPower, double efficiency, bool chargeInTransit, double chargeDelay);
297 
309  virtual MSCalibrator* buildCalibrator(MSNet& net,
310  const std::string& id, MSEdge* edge, MSLane* lane, double pos,
311  const std::string& file, const std::string& outfile,
312  const SUMOTime freq,
313  const MSRouteProbe* probe,
314  const std::string& vTypes);
315 
328  const std::string& id, const MSEdge* edge, double pos,
329  const std::string& file, const std::string& outfile,
330  const SUMOTime freq,
331  MSRouteProbe* probe,
332  const std::string& vTypes);
333 
334 
346  const std::string& id, MSEdgeVector& edges,
347  double prob, const std::string& file, bool off,
348  SUMOTime timeThreshold,
349  const std::string& vTypes);
351 
352 
353 protected:
356 
368  std::string getFileName(const SUMOSAXAttributes& attrs,
369  const std::string& base,
370  const bool allowEmpty = false);
371 
372 
384  MSLane* getLane(const SUMOSAXAttributes& attrs,
385  const std::string& tt, const std::string& tid);
386 
387 
401  double getPosition(const SUMOSAXAttributes& attrs,
402  MSLane* lane, const std::string& tt, const std::string& tid, MSEdge* edge = 0);
404 
405 
406 protected:
413 };
414 
415 
416 #endif
417 
418 /****************************************************************************/
419 
MSStoppingPlace
A lane area vehicles can halt at.
Definition: MSStoppingPlace.h:59
MSParkingArea
A lane area vehicles can halt at.
Definition: MSParkingArea.h:59
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
NLTriggerBuilder::parseAndBeginParkingArea
void parseAndBeginParkingArea(MSNet &net, const SUMOSAXAttributes &attrs)
Parses his values and builds a parking area.
Definition: NLTriggerBuilder.cpp:228
NLTriggerBuilder::beginParkingArea
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)
Begin a parking area.
Definition: NLTriggerBuilder.cpp:446
NLTriggerBuilder::buildLaneSpeedTrigger
virtual MSLaneSpeedTrigger * buildLaneSpeedTrigger(MSNet &net, const std::string &id, const std::vector< MSLane * > &destLanes, const std::string &file)
Builds a lane speed trigger.
Definition: NLTriggerBuilder.cpp:389
MSRouteProbe
Writes routes of vehicles passing a certain edge.
Definition: MSRouteProbe.h:60
NLTriggerBuilder::addAccess
void addAccess(MSNet &net, const SUMOSAXAttributes &attrs)
Parses the values and adds an access point to the currently parsed stopping place.
Definition: NLTriggerBuilder.cpp:202
MSNet
The simulated network and simulation perfomer.
Definition: MSNet.h:91
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
NLTriggerBuilder::setHandler
void setHandler(NLHandler *handler)
Sets the parent handler to use for nested parsing.
Definition: NLTriggerBuilder.cpp:66
NLTriggerBuilder::myCurrentStop
MSStoppingPlace * myCurrentStop
The currently parsed stop to add access points to.
Definition: NLTriggerBuilder.h:412
NLTriggerBuilder::buildStoppingPlace
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)
Builds a stopping place.
Definition: NLTriggerBuilder.cpp:434
METriggeredCalibrator
Calibrates the flow on a segment to a specified one.
Definition: METriggeredCalibrator.h:38
NLTriggerBuilder::myParkingArea
MSParkingArea * myParkingArea
definition of the currently parsed parking area
Definition: NLTriggerBuilder.h:410
MSLaneSpeedTrigger
Changes the speed allowed on a set of lanes.
Definition: MSLaneSpeedTrigger.h:53
NLTriggerBuilder
Builds trigger objects for microsim.
Definition: NLTriggerBuilder.h:61
MSTriggeredRerouter
Reroutes vehicles passing an edge.
Definition: MSTriggeredRerouter.h:63
NLTriggerBuilder::parseAndAddLotEntry
void parseAndAddLotEntry(const SUMOSAXAttributes &attrs)
Parses his values and adds a lot entry to current parking area.
Definition: NLTriggerBuilder.cpp:258
SumoXMLTag
SumoXMLTag
Numbers representing SUMO-XML - element names.
Definition: SUMOXMLDefinitions.h:41
NLTriggerBuilder::getFileName
std::string getFileName(const SUMOSAXAttributes &attrs, const std::string &base, const bool allowEmpty=false)
Helper method to obtain the filename.
Definition: NLTriggerBuilder.cpp:510
NLTriggerBuilder::parseAndBuildStoppingPlace
void parseAndBuildStoppingPlace(MSNet &net, const SUMOSAXAttributes &attrs, const SumoXMLTag element)
Parses the values and builds a stopping places for busses, trains or container vehicles.
Definition: NLTriggerBuilder.cpp:174
NLTriggerBuilder::parseAndBuildLaneSpeedTrigger
void parseAndBuildLaneSpeedTrigger(MSNet &net, const SUMOSAXAttributes &attrs, const std::string &base)
Parses his values and builds a lane speed trigger.
Definition: NLTriggerBuilder.cpp:109
NLTriggerBuilder::getLane
MSLane * getLane(const SUMOSAXAttributes &attrs, const std::string &tt, const std::string &tid)
Returns the lane defined by attribute "lane".
Definition: NLTriggerBuilder.cpp:531
NLTriggerBuilder::buildMECalibrator
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 std::string &vTypes)
builds a mesoscopic calibrator
Definition: NLTriggerBuilder.cpp:397
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:78
NLTriggerBuilder::getCurrentStop
MSStoppingPlace * getCurrentStop()
Definition: NLTriggerBuilder.cpp:575
NLTriggerBuilder::endStoppingPlace
virtual void endStoppingPlace()
End a stopping place.
Definition: NLTriggerBuilder.cpp:489
MSTrigger
An abstract device that changes the state of the micro simulation.
Definition: MSTrigger.h:40
NLTriggerBuilder::buildCalibrator
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 std::string &vTypes)
builds a microscopic calibrator
Definition: NLTriggerBuilder.cpp:410
NLTriggerBuilder::addLotEntry
void addLotEntry(double x, double y, double z, double width, double length, double angle)
Add a lot entry to current parking area.
Definition: NLTriggerBuilder.cpp:464
NLTriggerBuilder::NLTriggerBuilder
NLTriggerBuilder()
Constructor.
Definition: NLTriggerBuilder.cpp:59
NLTriggerBuilder::getPosition
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
Definition: NLTriggerBuilder.cpp:545
MSEdgeVector
std::vector< MSEdge * > MSEdgeVector
Definition: MSEdge.h:74
NLTriggerBuilder::buildRerouter
virtual MSTriggeredRerouter * buildRerouter(MSNet &net, const std::string &id, MSEdgeVector &edges, double prob, const std::string &file, bool off, SUMOTime timeThreshold, const std::string &vTypes)
builds an rerouter
Definition: NLTriggerBuilder.cpp:424
NLTriggerBuilder::myHandler
NLHandler * myHandler
The parent handler to set for subhandlers.
Definition: NLTriggerBuilder.h:408
NLTriggerBuilder::parseAndBuildChargingStation
void parseAndBuildChargingStation(MSNet &net, const SUMOSAXAttributes &attrs)
Parses his values and builds a charging station.
Definition: NLTriggerBuilder.cpp:146
NLHandler
The XML-Handler for network loading.
Definition: NLHandler.h:80
NLTriggerBuilder::endParkingArea
virtual void endParkingArea()
End a parking area.
Definition: NLTriggerBuilder.cpp:479
config.h
NLTriggerBuilder::parseAndBuildRerouter
void parseAndBuildRerouter(MSNet &net, const SUMOSAXAttributes &attrs, const std::string &base)
Parses his values and builds a rerouter.
Definition: NLTriggerBuilder.cpp:344
NLTriggerBuilder::~NLTriggerBuilder
virtual ~NLTriggerBuilder()
Destructor.
Definition: NLTriggerBuilder.cpp:63
MSCalibrator
Calibrates the flow on a segment to a specified one.
Definition: MSCalibrator.h:50
NLTriggerBuilder::buildVaporizer
void buildVaporizer(const SUMOSAXAttributes &attrs)
Builds a vaporization.
Definition: NLTriggerBuilder.cpp:72
NLTriggerBuilder::buildChargingStation
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, double chargeDelay)
Builds a charging station.
Definition: NLTriggerBuilder.cpp:499
SUMOSAXAttributes
Encapsulated SAX-Attributes.
Definition: SUMOSAXAttributes.h:56
NLTriggerBuilder::parseAndBuildCalibrator
void parseAndBuildCalibrator(MSNet &net, const SUMOSAXAttributes &attrs, const std::string &base)
Parses his values and builds a mesoscopic or microscopic calibrator.
Definition: NLTriggerBuilder.cpp:283