SUMO - Simulation of Urban MObility
NLTriggerBuilder.h
Go to the documentation of this file.
1 /****************************************************************************/
11 // Builds trigger objects for microsim
12 /****************************************************************************/
13 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
14 // Copyright (C) 2002-2016 DLR (http://www.dlr.de/) and contributors
15 /****************************************************************************/
16 //
17 // This file is part of SUMO.
18 // SUMO is free software: you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation, either version 3 of the License, or
21 // (at your option) any later version.
22 //
23 /****************************************************************************/
24 #ifndef NLTriggerBuilder_h
25 #define NLTriggerBuilder_h
26 
27 
28 // ===========================================================================
29 // included modules
30 // ===========================================================================
31 #ifdef _MSC_VER
32 #include <windows_config.h>
33 #else
34 #include <config.h>
35 #endif
36 
37 #include <string>
38 #include <vector>
39 
40 
41 // ===========================================================================
42 // class declarations
43 // ===========================================================================
44 class MSTrigger;
45 class MSNet;
46 class MSLaneSpeedTrigger;
47 class NLHandler;
49 class MSLane;
50 class MSEdge;
51 class MSStoppingPlace;
52 class MSCalibrator;
53 class MSRouteProbe;
54 
56 
57 
58 // ===========================================================================
59 // class definitions
60 // ===========================================================================
70 public:
73 
74 
76  virtual ~NLTriggerBuilder();
77 
78 
83  void setHandler(NLHandler* handler);
84 
85 
95  void buildVaporizer(const SUMOSAXAttributes& attrs);
96 
97 
102 
103 
118  void parseAndBuildLaneSpeedTrigger(MSNet& net, const SUMOSAXAttributes& attrs,
119  const std::string& base);
120 
121 
129  void parseAndBuildRerouter(MSNet& net, const SUMOSAXAttributes& attrs,
130  const std::string& base);
131 
132 
140  void parseAndBuildStoppingPlace(MSNet& net, const SUMOSAXAttributes& attrs, const SumoXMLTag element);
141 
142 
149  void addAccess(MSNet& net, const SUMOSAXAttributes& attrs);
150 
151 
158  void parseAndBuildChargingStation(MSNet& net, const SUMOSAXAttributes& attrs);
159 
167  void parseAndBuildCalibrator(MSNet& net, const SUMOSAXAttributes& attrs,
168  const std::string& base);
170 
171 
172 protected:
181 
182 
195  const std::string& id, const std::vector<MSLane*>& destLanes,
196  const std::string& file);
197 
198 
212  virtual void buildStoppingPlace(MSNet& net, const std::string& id, const std::vector<std::string>& lines,
213  MSLane* lane, SUMOReal frompos, SUMOReal topos, const SumoXMLTag element);
214 
227  virtual void buildChargingStation(MSNet& net,
228  const std::string& id, const std::vector<std::string>& lines,
229  MSLane* lane, SUMOReal frompos, SUMOReal topos, SUMOReal chrgpower,
230  SUMOReal efficiency, SUMOReal chargeInTransit, SUMOReal ChargeDelay);
231 
243  virtual MSCalibrator* buildCalibrator(MSNet& net,
244  const std::string& id, MSEdge* edge, SUMOReal pos,
245  const std::string& file, const std::string& outfile,
246  const SUMOTime freq, const MSRouteProbe* probe);
247 
260  const std::string& id, const MSEdge* edge, SUMOReal pos,
261  const std::string& file, const std::string& outfile,
262  const SUMOTime freq, MSRouteProbe* probe);
263 
264 
276  const std::string& id, MSEdgeVector& edges,
277  SUMOReal prob, const std::string& file, bool off);
279 
280 
281 protected:
284 
296  std::string getFileName(const SUMOSAXAttributes& attrs,
297  const std::string& base,
298  const bool allowEmpty = false);
299 
300 
312  MSLane* getLane(const SUMOSAXAttributes& attrs,
313  const std::string& tt, const std::string& tid);
314 
315 
330  MSLane* lane, const std::string& tt, const std::string& tid);
332 
333 
334 protected:
337 
340 };
341 
342 
343 #endif
344 
345 /****************************************************************************/
346 
void setHandler(NLHandler *handler)
Sets the parent handler to use for nested parsing.
void parseAndBuildCalibrator(MSNet &net, const SUMOSAXAttributes &attrs, const std::string &base)
Parses his values and builds a mesoscopic or microscopic calibrator.
SumoXMLTag
Numbers representing SUMO-XML - element names.
virtual MSCalibrator * buildCalibrator(MSNet &net, const std::string &id, MSEdge *edge, SUMOReal pos, const std::string &file, const std::string &outfile, const SUMOTime freq, const MSRouteProbe *probe)
builds a microscopic calibrator
long long int SUMOTime
Definition: SUMOTime.h:43
void addAccess(MSNet &net, const SUMOSAXAttributes &attrs)
Parses the values and adds an access point to the currently parsed stopping place.
A lane area vehicles can halt at.
virtual void buildChargingStation(MSNet &net, const std::string &id, const std::vector< std::string > &lines, MSLane *lane, SUMOReal frompos, SUMOReal topos, SUMOReal chrgpower, SUMOReal efficiency, SUMOReal chargeInTransit, SUMOReal ChargeDelay)
Builds a charging Station.
Writes routes of vehicles passing a certain edge.
Definition: MSRouteProbe.h:68
void parseAndBuildChargingStation(MSNet &net, const SUMOSAXAttributes &attrs)
Parses his values and builds a charging station.
void parseAndBuildRerouter(MSNet &net, const SUMOSAXAttributes &attrs, const std::string &base)
Parses his values and builds a rerouter.
NLTriggerBuilder()
Constructor.
virtual ~NLTriggerBuilder()
Destructor.
The simulated network and simulation perfomer.
Definition: MSNet.h:94
Changes the speed allowed on a set of lanes.
virtual void buildStoppingPlace(MSNet &net, const std::string &id, const std::vector< std::string > &lines, MSLane *lane, SUMOReal frompos, SUMOReal topos, const SumoXMLTag element)
Builds a stopping place.
A road/street connecting two junctions.
Definition: MSEdge.h:80
SUMOReal getPosition(const SUMOSAXAttributes &attrs, MSLane *lane, const std::string &tt, const std::string &tid)
returns the position on the lane checking it
An abstract device that changes the state of the micro simulation.
Definition: MSTrigger.h:48
Encapsulated SAX-Attributes.
Calibrates the flow on a segment to a specified one.
NLHandler * myHandler
The parent handler to set for subhandlers.
void parseAndBuildLaneSpeedTrigger(MSNet &net, const SUMOSAXAttributes &attrs, const std::string &base)
Parses his values and builds a lane speed trigger.
MSStoppingPlace * myCurrentStop
The currently parsed stop to add access points to.
void parseAndBuildStoppingPlace(MSNet &net, const SUMOSAXAttributes &attrs, const SumoXMLTag element)
Parses the values and builds a stopping places for busses, trains or container vehicles.
std::string getFileName(const SUMOSAXAttributes &attrs, const std::string &base, const bool allowEmpty=false)
Helper method to obtain the filename.
The XML-Handler for network loading.
Definition: NLHandler.h:84
Reroutes vehicles passing an edge.
virtual METriggeredCalibrator * buildMECalibrator(MSNet &net, const std::string &id, const MSEdge *edge, SUMOReal pos, const std::string &file, const std::string &outfile, const SUMOTime freq, MSRouteProbe *probe)
builds a mesoscopic calibrator
Calibrates the flow on a segment to a specified one.
Definition: MSCalibrator.h:57
#define SUMOReal
Definition: config.h:213
virtual MSTriggeredRerouter * buildRerouter(MSNet &net, const std::string &id, MSEdgeVector &edges, SUMOReal prob, const std::string &file, bool off)
builds an rerouter
virtual MSLaneSpeedTrigger * buildLaneSpeedTrigger(MSNet &net, const std::string &id, const std::vector< MSLane * > &destLanes, const std::string &file)
Builds a lane speed trigger.
std::vector< MSEdge * > MSEdgeVector
Definition: MSEdge.h:77
Builds trigger objects for microsim.
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
void buildVaporizer(const SUMOSAXAttributes &attrs)
Builds a vaporization.
MSLane * getLane(const SUMOSAXAttributes &attrs, const std::string &tt, const std::string &tid)
Returns the lane defined by attribute "lane".