SUMO - Simulation of Urban MObility
NLDetectorBuilder.cpp
Go to the documentation of this file.
1 /****************************************************************************/
12 // Builds detectors for microsim
13 /****************************************************************************/
14 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
15 // Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors
16 /****************************************************************************/
17 //
18 // This file is part of SUMO.
19 // SUMO is free software: you can redistribute it and/or modify
20 // it under the terms of the GNU General Public License as published by
21 // the Free Software Foundation, either version 3 of the License, or
22 // (at your option) any later version.
23 //
24 /****************************************************************************/
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include <string>
37 #include <iostream>
38 #include <microsim/MSNet.h>
39 #include <microsim/MSLane.h>
40 #include <microsim/MSEdge.h>
51 #include <microsim/MSGlobals.h>
59 #include "NLDetectorBuilder.h"
61 
62 #ifdef HAVE_INTERNAL
63 #include <mesosim/MEInductLoop.h>
64 #include <mesosim/MELoop.h>
65 #include <mesosim/MESegment.h>
66 #endif
67 
68 #ifdef CHECK_MEMORY_LEAKS
69 #include <foreign/nvwa/debug_new.h>
70 #endif // CHECK_MEMORY_LEAKS
71 
72 
73 // ===========================================================================
74 // method definitions
75 // ===========================================================================
76 /* -------------------------------------------------------------------------
77  * NLDetectorBuilder::E3DetectorDefinition-methods
78  * ----------------------------------------------------------------------- */
80  const std::string& device, SUMOReal haltingSpeedThreshold,
81  SUMOTime haltingTimeThreshold, SUMOTime splInterval)
82  : myID(id), myDevice(device),
83  myHaltingSpeedThreshold(haltingSpeedThreshold),
84  myHaltingTimeThreshold(haltingTimeThreshold),
85  mySampleInterval(splInterval) {}
86 
87 
89 
90 
91 /* -------------------------------------------------------------------------
92  * NLDetectorBuilder-methods
93  * ----------------------------------------------------------------------- */
95  : myNet(net), myE3Definition(0) {}
96 
97 
99 
100 
101 void
103  const std::string& lane, SUMOReal pos, SUMOTime splInterval,
104  const std::string& device, bool friendlyPos, bool splitByType) {
105  checkSampleInterval(splInterval, SUMO_TAG_E1DETECTOR, id);
106  // get and check the lane
107  MSLane* clane = getLaneChecking(lane, SUMO_TAG_E1DETECTOR, id);
108  // get and check the position
109  pos = getPositionChecking(pos, clane, friendlyPos, id);
110  // build the loop
111  MSDetectorFileOutput* loop = createInductLoop(id, clane, pos, splitByType);
112  // add the file output
113  myNet.getDetectorControl().add(SUMO_TAG_INDUCTION_LOOP, loop, device, splInterval);
114 }
115 
116 
117 void
119  const std::string& lane, SUMOReal pos,
120  const std::string& device, bool friendlyPos) {
121  // get and check the lane
123  // get and check the position
124  pos = getPositionChecking(pos, clane, friendlyPos, id);
125  // build the loop
126  MSDetectorFileOutput* loop = createInstantInductLoop(id, clane, pos, device);
127  // add the file output
129 }
130 
131 
132 void
134  const std::string& lane, SUMOReal pos, SUMOReal length,
135  bool cont, SUMOTime splInterval,
136  const std::string& device,
137  SUMOTime haltingTimeThreshold,
138  SUMOReal haltingSpeedThreshold,
139  SUMOReal jamDistThreshold, bool friendlyPos) {
140  checkSampleInterval(splInterval, SUMO_TAG_E2DETECTOR, id);
141  MSLane* clane = getLaneChecking(lane, SUMO_TAG_E2DETECTOR, id);
142  // check whether the detector may lie over more than one lane
143  MSDetectorFileOutput* det = 0;
144  if (!cont) {
145  convUncontE2PosLength(id, clane, pos, length, friendlyPos);
146  det = buildSingleLaneE2Det(id, DU_USER_DEFINED, clane, pos, length, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold);
147  myNet.getDetectorControl().add(SUMO_TAG_LANE_AREA_DETECTOR, det, device, splInterval);
148  } else {
149  convContE2PosLength(id, clane, pos, length, friendlyPos);
150  det = buildMultiLaneE2Det(id, DU_USER_DEFINED, clane, pos, length, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold);
151  myNet.getDetectorControl().add(SUMO_TAG_LANE_AREA_DETECTOR, det, device, splInterval);
152  }
153 }
154 
155 
156 void
158  const std::string& lane, SUMOReal pos, SUMOReal length,
159  bool cont,
161  const std::string& device,
162  SUMOTime haltingTimeThreshold,
163  SUMOReal haltingSpeedThreshold,
164  SUMOReal jamDistThreshold, bool friendlyPos) {
165  if (tlls.getActive() == 0) {
166  throw InvalidArgument("The detector '" + id + "' refers to the unknown lsa.");
167  }
168  MSLane* clane = getLaneChecking(lane, SUMO_TAG_E2DETECTOR, id);
169  // check whether the detector may lie over more than one lane
170  MSDetectorFileOutput* det = 0;
171  if (!cont) {
172  convUncontE2PosLength(id, clane, pos, length, friendlyPos);
173  det = buildSingleLaneE2Det(id, DU_USER_DEFINED, clane, pos, length, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold);
175  } else {
176  convContE2PosLength(id, clane, pos, length, friendlyPos);
177  det = buildMultiLaneE2Det(id, DU_USER_DEFINED, clane, pos, length, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold);
179  }
180  // add the file output
182 }
183 
184 
185 void
187  const std::string& lane, SUMOReal pos, SUMOReal length,
188  bool cont,
190  const std::string& tolane,
191  const std::string& device,
192  SUMOTime haltingTimeThreshold,
193  SUMOReal haltingSpeedThreshold,
194  SUMOReal jamDistThreshold, bool friendlyPos) {
195  if (tlls.getActive() == 0) {
196  throw InvalidArgument("The detector '" + id + "' refers to the unknown lsa.");
197  }
198  MSLane* clane = getLaneChecking(lane, SUMO_TAG_E2DETECTOR, id);
199  MSLane* ctoLane = getLaneChecking(tolane, SUMO_TAG_E2DETECTOR, id);
200  MSLink* link = MSLinkContHelper::getConnectingLink(*clane, *ctoLane);
201  if (link == 0) {
202  throw InvalidArgument(
203  "The detector output can not be build as no connection between lanes '"
204  + lane + "' and '" + tolane + "' exists.");
205  }
206  if (pos < 0) {
207  pos = -pos;
208  }
209  // check whether the detector may lie over more than one lane
210  MSDetectorFileOutput* det = 0;
211  if (!cont) {
212  convUncontE2PosLength(id, clane, pos, length, friendlyPos);
213  det = buildSingleLaneE2Det(id, DU_USER_DEFINED, clane, pos, length, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold);
215  } else {
216  convContE2PosLength(id, clane, pos, length, friendlyPos);
217  det = buildMultiLaneE2Det(id, DU_USER_DEFINED, clane, pos, length, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold);
219  }
220  // add the file output
222 }
223 
224 
225 void
226 NLDetectorBuilder::convUncontE2PosLength(const std::string& id, MSLane* clane,
227  SUMOReal& pos, SUMOReal& length,
228  bool friendlyPos) {
229  // get and check the position
230  pos = getPositionChecking(pos, clane, friendlyPos, id);
231  // check length
232  if (length < 0) {
233  length = clane->getLength() + length;
234  }
235  if (length + pos > clane->getLength()) {
236  if (friendlyPos) {
237  length = clane->getLength() - pos - (SUMOReal) 0.1;
238  } else {
239  throw InvalidArgument("The length of detector '" + id + "' lies beyond the lane's '" + clane->getID() + "' length.");
240  }
241  }
242  if (length < 0) {
243  if (friendlyPos) {
244  length = (SUMOReal) 0.1;
245  } else {
246  throw InvalidArgument("The length of detector '" + id + "' is almost 0.");
247  }
248  }
249 }
250 
251 
252 void
253 NLDetectorBuilder::convContE2PosLength(const std::string& id, MSLane* clane,
254  SUMOReal& pos, SUMOReal& /*length*/,
255  bool friendlyPos) {
256  // get and check the position
257  pos = getPositionChecking(pos, clane, friendlyPos, id);
258  // length will be kept as is
259 }
260 
261 
262 void
264  const std::string& device, SUMOTime splInterval,
265  SUMOReal haltingSpeedThreshold,
266  SUMOTime haltingTimeThreshold) {
267  checkSampleInterval(splInterval, SUMO_TAG_E3DETECTOR, id);
268  myE3Definition = new E3DetectorDefinition(id, device, haltingSpeedThreshold, haltingTimeThreshold, splInterval);
269 }
270 
271 
272 void
273 NLDetectorBuilder::addE3Entry(const std::string& lane,
274  SUMOReal pos, bool friendlyPos) {
275  if (myE3Definition == 0) {
276  return;
277  }
279  // get and check the position
280  pos = getPositionChecking(pos, clane, friendlyPos, myE3Definition->myID);
281  // build and save the entry
282  myE3Definition->myEntries.push_back(MSCrossSection(clane, pos));
283 }
284 
285 
286 void
287 NLDetectorBuilder::addE3Exit(const std::string& lane,
288  SUMOReal pos, bool friendlyPos) {
289  if (myE3Definition == 0) {
290  return;
291  }
293  // get and check the position
294  pos = getPositionChecking(pos, clane, friendlyPos, myE3Definition->myID);
295  // build and save the exit
296  myE3Definition->myExits.push_back(MSCrossSection(clane, pos));
297 }
298 
299 
300 std::string
302  if (myE3Definition == 0) {
303  return "<unknown>";
304  }
305  return myE3Definition->myID;
306 }
307 
308 
309 void
311  if (myE3Definition == 0) {
312  return;
313  }
317  // add to net
319  // clean up
320  delete myE3Definition;
321  myE3Definition = 0;
322 }
323 
324 
325 void
327  const std::string& vtype, SUMOTime frequency,
328  const std::string& device) {
330  new MSVTypeProbe(id, vtype, OutputDevice::getDevice(device), frequency);
331 }
332 
333 
334 void
335 NLDetectorBuilder::buildRouteProbe(const std::string& id, const std::string& edge,
336  SUMOTime frequency, SUMOTime begin,
337  const std::string& device) {
340  MSRouteProbe* probe = new MSRouteProbe(id, e, id + "_" + toString(begin), id + "_" + toString(begin - frequency));
341  // add the file output
342  myNet.getDetectorControl().add(SUMO_TAG_ROUTEPROBE, probe, device, frequency, begin);
343 }
344 
345 
346 // -------------------
349  DetectorUsage usage,
350  MSLane* lane, SUMOReal pos, SUMOReal length,
351  SUMOTime haltingTimeThreshold,
352  SUMOReal haltingSpeedThreshold,
353  SUMOReal jamDistThreshold) {
354  return createSingleLaneE2Detector(id, usage, lane, pos,
355  length, haltingTimeThreshold, haltingSpeedThreshold,
356  jamDistThreshold);
357 }
358 
359 
362  MSLane* lane, SUMOReal pos, SUMOReal length,
363  SUMOTime haltingTimeThreshold,
364  SUMOReal haltingSpeedThreshold,
365  SUMOReal jamDistThreshold) {
367  lane, pos, haltingTimeThreshold, haltingSpeedThreshold,
368  jamDistThreshold);
369  static_cast<MS_E2_ZS_CollectorOverLanes*>(ret)->init(lane, length);
370  return ret;
371 }
372 
373 
376  MSLane* lane, SUMOReal pos, bool splitByType, bool) {
377 #ifdef HAVE_INTERNAL
379  return new MEInductLoop(id, MSGlobals::gMesoNet->getSegmentForEdge(lane->getEdge(), pos), pos);
380  }
381 #endif
382  return new MSInductLoop(id, lane, pos, splitByType);
383 }
384 
385 
388  MSLane* lane, SUMOReal pos, const std::string& od) {
389  return new MSInstantInductLoop(id, OutputDevice::getDevice(od), lane, pos);
390 }
391 
392 
395  DetectorUsage usage, MSLane* lane, SUMOReal pos, SUMOReal length,
396  SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold) {
397  return new MSE2Collector(id, usage, lane, pos, length, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold);
398 }
399 
400 
403  DetectorUsage usage, MSLane* lane, SUMOReal pos,
404  SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold) {
405  return new MS_E2_ZS_CollectorOverLanes(id, usage, lane, pos, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold);
406 }
407 
408 
411  const CrossSectionVector& entries,
412  const CrossSectionVector& exits,
413  SUMOReal haltingSpeedThreshold,
414  SUMOTime haltingTimeThreshold) {
415  return new MSE3Collector(id, entries, exits, haltingSpeedThreshold, haltingTimeThreshold);
416 }
417 
418 
419 SUMOReal
421  const std::string& detid) {
422  // check whether it is given from the end
423  if (pos < 0) {
424  pos = lane->getLength() + pos;
425  }
426  // check whether it is on the lane
427  if (pos > lane->getLength()) {
428  if (friendlyPos) {
429  pos = lane->getLength() - (SUMOReal) 0.1;
430  } else {
431  throw InvalidArgument("The position of detector '" + detid + "' lies beyond the lane's '" + lane->getID() + "' length.");
432  }
433  }
434  if (pos < 0) {
435  if (friendlyPos) {
436  pos = (SUMOReal) 0.1;
437  } else {
438  throw InvalidArgument("The position of detector '" + detid + "' lies beyond the lane's '" + lane->getID() + "' length.");
439  }
440  }
441  return pos;
442 }
443 
444 
445 void
446 NLDetectorBuilder::createEdgeLaneMeanData(const std::string& id, SUMOTime frequency,
447  SUMOTime begin, SUMOTime end, const std::string& type,
448  const bool useLanes, const bool withEmpty, const bool printDefaults,
449  const bool withInternal, const bool trackVehicles,
450  const SUMOReal maxTravelTime, const SUMOReal minSamples,
451  const SUMOReal haltSpeed, const std::string& vTypes,
452  const std::string& device) {
453  if (begin < 0) {
454  throw InvalidArgument("Negative begin time for meandata dump '" + id + "'.");
455  }
456  if (end < 0) {
457  end = SUMOTime_MAX;
458  }
459  if (end <= begin) {
460  throw InvalidArgument("End before or at begin for meandata dump '" + id + "'.");
461  }
462  std::set<std::string> vt;
463  StringTokenizer st(vTypes);
464  while (st.hasNext()) {
465  vt.insert(st.next());
466  }
467  MSMeanData* det = 0;
468  if (type == "" || type == "performance" || type == "traffic") {
469  det = new MSMeanData_Net(id, begin, end, useLanes, withEmpty,
470  printDefaults, withInternal, trackVehicles, maxTravelTime, minSamples, haltSpeed, vt);
471  } else if (type == "emissions" || type == "hbefa") {
472  if (type == "hbefa") {
473  WRITE_WARNING("The netstate type 'hbefa' is deprecated. Please use the type 'emissions' instead.");
474  }
475  det = new MSMeanData_Emissions(id, begin, end, useLanes, withEmpty,
476  printDefaults, withInternal, trackVehicles, maxTravelTime, minSamples, vt);
477  } else if (type == "harmonoise") {
478  det = new MSMeanData_Harmonoise(id, begin, end, useLanes, withEmpty,
479  printDefaults, withInternal, trackVehicles, maxTravelTime, minSamples, vt);
480  } else if (type == "amitran") {
481  det = new MSMeanData_Amitran(id, begin, end, useLanes, withEmpty,
482  printDefaults, withInternal, trackVehicles, maxTravelTime, minSamples, haltSpeed, vt);
483  } else {
484  throw InvalidArgument("Invalid type '" + type + "' for meandata dump '" + id + "'.");
485  }
486  if (det != 0) {
487  if (frequency < 0) {
488  frequency = end - begin;
489  }
490  MSNet::getInstance()->getDetectorControl().add(det, device, frequency, begin);
491  }
492 }
493 
494 
495 
496 
497 // ------ Value checking/adapting methods ------
498 MSEdge*
499 NLDetectorBuilder::getEdgeChecking(const std::string& edgeID, SumoXMLTag type,
500  const std::string& detid) {
501  // get and check the lane
502  MSEdge* edge = MSEdge::dictionary(edgeID);
503  if (edge == 0) {
504  throw InvalidArgument("The lane with the id '" + edgeID + "' is not known (while building " + toString(type) + " '" + detid + "').");
505  }
506  return edge;
507 }
508 
509 
510 MSLane*
511 NLDetectorBuilder::getLaneChecking(const std::string& laneID, SumoXMLTag type,
512  const std::string& detid) {
513  // get and check the lane
514  MSLane* lane = MSLane::dictionary(laneID);
515  if (lane == 0) {
516  throw InvalidArgument("The lane with the id '" + laneID + "' is not known (while building " + toString(type) + " '" + detid + "').");
517  }
518  return lane;
519 }
520 
521 
522 void
523 NLDetectorBuilder::checkSampleInterval(SUMOTime splInterval, SumoXMLTag type, const std::string& id) {
524  if (splInterval < 0) {
525  throw InvalidArgument("Negative sampling frequency (in " + toString(type) + " '" + id + "').");
526  }
527  if (splInterval == 0) {
528  throw InvalidArgument("Sampling frequency must not be zero (in " + toString(type) + " '" + id + "').");
529  }
530 }
531 
532 
533 /****************************************************************************/
534 
Data collector for edges/lanes.
Definition: MSMeanData.h:67
SumoXMLTag
Numbers representing SUMO-XML - element names.
MSEdge & getEdge() const
Returns the lane&#39;s edge.
Definition: MSLane.h:461
long long int SUMOTime
Definition: SUMOTime.h:43
Storage for all programs of a single tls.
std::string next()
MSLane * getLaneChecking(const std::string &laneID, SumoXMLTag type, const std::string &detid)
Returns the named lane.
A simple description of a position on a lane (crossing of a lane)
An areal (along a single lane) detector.
Definition: MSE2Collector.h:79
void addE3Entry(const std::string &lane, SUMOReal pos, bool friendlyPos)
Builds an entry point of an e3 detector.
Network state mean data collector for edges/lanes.
E3DetectorDefinition(const std::string &id, const std::string &device, SUMOReal haltingSpeedThreshold, SUMOTime haltingTimeThreshold, SUMOTime splInterval)
Constructor.
A detector which joins E2Collectors over consecutive lanes (backward)
Writes routes of vehicles passing a certain edge.
Definition: MSRouteProbe.h:68
SUMOReal getLength() const
Returns the lane&#39;s length.
Definition: MSLane.h:376
void buildInductLoop(const std::string &id, const std::string &lane, SUMOReal pos, SUMOTime splInterval, const std::string &device, bool friendlyPos, bool splitByType)
Builds an e1 detector and adds it to the net.
void addE3Exit(const std::string &lane, SUMOReal pos, bool friendlyPos)
Builds an exit point of an e3 detector.
std::vector< MSCrossSection > CrossSectionVector
An instantaneous induction loop.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:162
MSDetectorFileOutput * buildMultiLaneE2Det(const std::string &id, DetectorUsage usage, MSLane *lane, SUMOReal pos, SUMOReal length, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold)
Builds an e2 detector that continues on preceeding lanes.
static bool dictionary(const std::string &id, MSEdge *edge)
Inserts edge into the static dictionary Returns true if the key id isn&#39;t already in the dictionary...
Definition: MSEdge.cpp:579
void createEdgeLaneMeanData(const std::string &id, SUMOTime frequency, SUMOTime begin, SUMOTime end, const std::string &type, const bool useLanes, const bool withEmpty, const bool printDefaults, const bool withInternal, const bool trackVehicles, const SUMOReal maxTravelTime, const SUMOReal minSamples, const SUMOReal haltSpeed, const std::string &vTypes, const std::string &device)
Creates edge based mean data collector using the given specification.
MSDetectorFileOutput * buildSingleLaneE2Det(const std::string &id, DetectorUsage usage, MSLane *lane, SUMOReal pos, SUMOReal length, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold)
Builds an e2 detector that lies on only one lane.
Noise data collector for edges/lanes.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
Definition: MSNet.h:255
void buildVTypeProbe(const std::string &id, const std::string &vtype, SUMOTime frequency, const std::string &device)
Builds a vTypeProbe and adds it to the net.
void endE3Detector()
Builds of an e3 detector using collected values.
void convUncontE2PosLength(const std::string &id, MSLane *clane, SUMOReal &pos, SUMOReal &length, bool frinedly_pos)
Converts the length and the position information for an e2 detector.
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:200
The simulated network and simulation perfomer.
Definition: MSNet.h:94
virtual MSDetectorFileOutput * createSingleLaneE2Detector(const std::string &id, DetectorUsage usage, MSLane *lane, SUMOReal pos, SUMOReal length, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold)
Creates an instance of an e2 detector using the given values.
const std::string & getID() const
Returns the id.
Definition: Named.h:65
A road/street connecting two junctions.
Definition: MSEdge.h:81
Holds the incoming definitions of an e3 detector unless the detector is build.
MSTrafficLightLogic * getActive() const
Writes positions of vehicles that have a certain (named) type.
Definition: MSVTypeProbe.h:60
An instantenous induction loop.
std::string getCurrentE3ID() const
Returns the id of the currently built e3 detector.
Writes e2 state on each tls switch.
SUMOReal myHaltingSpeedThreshold
The speed a vehicle&#39;s speed must be below to be assigned as jammed.
void add(SumoXMLTag type, MSDetectorFileOutput *d, const std::string &device, SUMOTime splInterval, SUMOTime begin=-1)
Adds a detector/output combination into the containers.
Emission data collector for edges/lanes.
void buildRouteProbe(const std::string &id, const std::string &edge, SUMOTime frequency, SUMOTime begin, const std::string &device)
Builds a routeProbe and adds it to the net.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:53
MSDetectorControl & getDetectorControl()
Returns the detector control.
Definition: MSNet.h:359
CrossSectionVector myExits
List of detector&#39;s exits.
MSEdge * getEdgeChecking(const std::string &edgeID, SumoXMLTag type, const std::string &detid)
Returns the named edge.
SUMOTime mySampleInterval
The aggregation interval.
virtual MSDetectorFileOutput * createE3Detector(const std::string &id, const CrossSectionVector &entries, const CrossSectionVector &exits, SUMOReal haltingSpeedThreshold, SUMOTime haltingTimeThreshold)
Creates an instance of an e3 detector using the given values.
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
Definition: MSLane.cpp:884
#define SUMOTime_MAX
Definition: SUMOTime.h:44
void convContE2PosLength(const std::string &id, MSLane *clane, SUMOReal &pos, SUMOReal &length, bool frinedly_pos)
Converts the length and the position information for an e2ol-detector.
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
NLDetectorBuilder(MSNet &net)
Constructor.
virtual MSDetectorFileOutput * createInstantInductLoop(const std::string &id, MSLane *lane, SUMOReal pos, const std::string &od)
Creates an instance of an e1 detector using the given values.
virtual MSDetectorFileOutput * createMultiLaneE2Detector(const std::string &id, DetectorUsage usage, MSLane *lane, SUMOReal pos, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold)
Creates an instance of an e2ol-detector using the given values.
void checkSampleInterval(SUMOTime splInterval, SumoXMLTag type, const std::string &id)
Checks whether the given frequency (sample interval) is valid.
A detector of vehicles passing an area between entry/exit points.
Definition: MSE3Collector.h:65
void buildE2Detector(const std::string &id, const std::string &lane, SUMOReal pos, SUMOReal length, bool cont, SUMOTime splInterval, const std::string &device, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold, bool friendlyPos)
Builds an e2 detector with a fixed interval and adds it to the net.
Network state mean data collector for edges/lanes.
#define SUMOReal
Definition: config.h:214
static const bool gUseMesoSim
Definition: MSGlobals.h:102
void buildInstantInductLoop(const std::string &id, const std::string &lane, SUMOReal pos, const std::string &device, bool friendlyPos)
Builds an instantenous induction and adds it to the net.
virtual ~NLDetectorBuilder()
Destructor.
E3DetectorDefinition * myE3Definition
definition of the currently parsed e3 detector
MSNet & myNet
The net to fill.
Writes e2 state of a link for the time the link has yellow/red.
CrossSectionVector myEntries
List of detector&#39;s entries.
void beginE3Detector(const std::string &id, const std::string &device, SUMOTime splInterval, SUMOReal haltingSpeedThreshold, SUMOTime haltingTimeThreshold)
Stores temporary the initial information about an e3 detector to build.
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
SUMOReal getPositionChecking(SUMOReal pos, MSLane *lane, bool friendlyPos, const std::string &detid)
Computes the position to use.
const std::string myDevice
The device the detector shall use.
std::string myID
The id of the detector.
Base of value-generating classes (detectors)
virtual MSDetectorFileOutput * createInductLoop(const std::string &id, MSLane *lane, SUMOReal pos, bool splitByType, bool show=true)
Creates an instance of an e1 detector using the given values.
An unextended detector measuring at a fixed position on a fixed lane.
Definition: MSInductLoop.h:71
SUMOTime myHaltingTimeThreshold
The time a vehicle&#39;s speed must be below haltingSpeedThreshold to be assigned as jammed.