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-2015 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 
55 #ifdef HAVE_INTERNAL
56 class METriggeredCalibrator;
57 #endif
58 
59 
60 // ===========================================================================
61 // class definitions
62 // ===========================================================================
72 public:
75 
76 
78  virtual ~NLTriggerBuilder();
79 
80 
85  void setHandler(NLHandler* handler);
86 
87 
97  void buildVaporizer(const SUMOSAXAttributes& attrs);
98 
99 
104 
105 
120  void parseAndBuildLaneSpeedTrigger(MSNet& net, const SUMOSAXAttributes& attrs,
121  const std::string& base);
122 
123 
131  void parseAndBuildRerouter(MSNet& net, const SUMOSAXAttributes& attrs,
132  const std::string& base);
133 
134 
141  void parseAndBuildBusStop(MSNet& net, const SUMOSAXAttributes& attrs);
142 
143 
150  void parseAndBuildContainerStop(MSNet& net, const SUMOSAXAttributes& attrs);
151 
152 
159  void parseAndBuildChargingStation(MSNet& net, const SUMOSAXAttributes& attrs);
160 
168  void parseAndBuildCalibrator(MSNet& net, const SUMOSAXAttributes& attrs,
169  const std::string& base);
171 
172 
173 protected:
182 
183 
196  const std::string& id, const std::vector<MSLane*>& destLanes,
197  const std::string& file);
198 
199 
212  virtual void buildBusStop(MSNet& net,
213  const std::string& id, const std::vector<std::string>& lines,
214  MSLane* lane, SUMOReal frompos, SUMOReal topos);
215 
228  virtual void buildChargingStation(MSNet& net,
229  const std::string& id, const std::vector<std::string>& lines,
230  MSLane* lane, SUMOReal frompos, SUMOReal topos, SUMOReal chrgpower, SUMOReal efficiency, SUMOReal chargeInTransit, SUMOReal ChargeDelay);
231 
244  virtual void buildContainerStop(MSNet& net,
245  const std::string& id, const std::vector<std::string>& lines,
246  MSLane* lane, SUMOReal frompos, SUMOReal topos);
247 
248 
260  virtual MSCalibrator* buildCalibrator(MSNet& net,
261  const std::string& id, MSEdge* edge, SUMOReal pos,
262  const std::string& file, const std::string& outfile,
263  const SUMOTime freq, const MSRouteProbe* probe);
264 #ifdef HAVE_INTERNAL
265 
276  virtual METriggeredCalibrator* buildMECalibrator(MSNet& net,
277  const std::string& id, const MSEdge* edge, SUMOReal pos,
278  const std::string& file, const std::string& outfile,
279  const SUMOTime freq, MSRouteProbe* probe);
280 #endif
281 
282 
294  const std::string& id, MSEdgeVector& edges,
295  SUMOReal prob, const std::string& file, bool off);
297 
298 
299 protected:
302 
314  std::string getFileName(const SUMOSAXAttributes& attrs,
315  const std::string& base,
316  const bool allowEmpty = false);
317 
318 
330  MSLane* getLane(const SUMOSAXAttributes& attrs,
331  const std::string& tt, const std::string& tid);
332 
333 
348  MSLane* lane, const std::string& tt, const std::string& tid);
350 
351 
352 protected:
355 
356 
357 };
358 
359 
360 #endif
361 
362 /****************************************************************************/
363 
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.
virtual void buildBusStop(MSNet &net, const std::string &id, const std::vector< std::string > &lines, MSLane *lane, SUMOReal frompos, SUMOReal topos)
Builds a bus stop.
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
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.
void parseAndBuildBusStop(MSNet &net, const SUMOSAXAttributes &attrs)
Parses his values and builds a bus stop.
NLTriggerBuilder()
Constructor.
virtual ~NLTriggerBuilder()
Destructor.
The simulated network and simulation perfomer.
Definition: MSNet.h:94
Changes the speed allowed on a set of lanes.
A road/street connecting two junctions.
Definition: MSEdge.h:81
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.
NLHandler * myHandler
The parent handler to set for subhandlers.
void parseAndBuildContainerStop(MSNet &net, const SUMOSAXAttributes &attrs)
Parses his values and builds a container stop.
void parseAndBuildLaneSpeedTrigger(MSNet &net, const SUMOSAXAttributes &attrs, const std::string &base)
Parses his values and builds a lane speed trigger.
virtual void buildContainerStop(MSNet &net, const std::string &id, const std::vector< std::string > &lines, MSLane *lane, SUMOReal frompos, SUMOReal topos)
Builds a container stop.
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.
Calibrates the flow on a segment to a specified one.
Definition: MSCalibrator.h:57
#define SUMOReal
Definition: config.h:214
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:78
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".