SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NLDetectorBuilder.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // Builds detectors for microsim
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
13 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef NLDetectorBuilder_h
24 #define NLDetectorBuilder_h
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 <microsim/MSNet.h>
40 
41 
42 // ===========================================================================
43 // class declarations
44 // ===========================================================================
46 class MSLane;
47 class MSEdge;
48 
49 #ifdef HAVE_MESOSIM
50 class MEInductLoop;
51 class MESegment;
52 #endif
53 
54 
55 // ===========================================================================
56 // class definitions
57 // ===========================================================================
66 public:
71  NLDetectorBuilder(MSNet& net) ;
72 
73 
75  virtual ~NLDetectorBuilder() ;
76 
77 
80 
101  void buildInductLoop(const std::string& id,
102  const std::string& lane, SUMOReal pos, int splInterval,
103  OutputDevice& device, bool friendlyPos, bool splitByType) throw(InvalidArgument);
104 
105 
121  void buildInstantInductLoop(const std::string& id,
122  const std::string& lane, SUMOReal pos,
123  OutputDevice& device, bool friendlyPos) throw(InvalidArgument);
124 
125 
150  void buildE2Detector(const std::string& id, const std::string& lane, SUMOReal pos, SUMOReal length,
151  bool cont, int splInterval, OutputDevice& device, SUMOTime haltingTimeThreshold,
152  SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold,
153  bool friendlyPos) throw(InvalidArgument);
154 
155 
180  void buildE2Detector(const std::string& id, const std::string& lane, SUMOReal pos, SUMOReal length,
181  bool cont, MSTLLogicControl::TLSLogicVariants& tlls,
182  OutputDevice& device, SUMOTime haltingTimeThreshold,
183  SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold,
184  bool friendlyPos) throw(InvalidArgument);
185 
186 
212  void buildE2Detector(const std::string& id, const std::string& lane, SUMOReal pos, SUMOReal length,
213  bool cont, MSTLLogicControl::TLSLogicVariants& tlls, const std::string& tolane,
214  OutputDevice& device, SUMOTime haltingTimeThreshold,
215  SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold,
216  bool friendlyPos) throw(InvalidArgument);
217 
218 
232  void beginE3Detector(const std::string& id, OutputDevice& device, int splInterval,
233  SUMOReal haltingSpeedThreshold, SUMOTime haltingTimeThreshold) throw(InvalidArgument);
234 
235 
248  void addE3Entry(const std::string& lane, SUMOReal pos, bool friendlyPos) throw(InvalidArgument);
249 
250 
263  void addE3Exit(const std::string& lane, SUMOReal pos, bool friendlyPos) throw(InvalidArgument);
264 
265 
275  void endE3Detector() throw(InvalidArgument);
276 
277 
285  std::string getCurrentE3ID() const ;
286 
287 
301  void buildVTypeProbe(const std::string& id,
302  const std::string& vtype, SUMOTime frequency,
303  OutputDevice& device) throw(InvalidArgument);
304 
305 
320  void buildRouteProbe(const std::string& id, const std::string& edge,
321  SUMOTime frequency, SUMOTime begin,
322  OutputDevice& device) throw(InvalidArgument);
324 
325 
326 
331 
341  virtual MSDetectorFileOutput* createInductLoop(const std::string& id,
342  MSLane* lane, SUMOReal pos, bool splitByType) ;
343 
344 
354  virtual MSDetectorFileOutput* createInstantInductLoop(const std::string& id,
355  MSLane* lane, SUMOReal pos, OutputDevice& od) ;
356 
357 #ifdef HAVE_MESOSIM
358 
367  virtual MEInductLoop* createMEInductLoop(const std::string& id,
368  MESegment* s, SUMOReal pos) ;
369 #endif
370 
371 
384  virtual MSDetectorFileOutput* createSingleLaneE2Detector(const std::string& id,
385  DetectorUsage usage, MSLane* lane, SUMOReal pos, SUMOReal length,
386  SUMOTime haltingTimeThreshold,
387  SUMOReal haltingSpeedThreshold,
388  SUMOReal jamDistThreshold) ;
389 
390 
405  const std::string& id, DetectorUsage usage, MSLane* lane, SUMOReal pos,
406  SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold,
407  SUMOReal jamDistThreshold) ;
408 
409 
420  virtual MSDetectorFileOutput* createE3Detector(const std::string& id,
421  const CrossSectionVector& entries, const CrossSectionVector& exits,
422  SUMOReal haltingSpeedThreshold, SUMOTime haltingTimeThreshold) ;
423 
424 
442  void createEdgeLaneMeanData(const std::string& id, SUMOTime frequency,
443  SUMOTime begin, SUMOTime end, const std::string& type,
444  const bool useLanes, const bool withEmpty, const bool printDefaults,
445  const bool withInternal, const bool trackVehicles,
446  const SUMOReal maxTravelTime, const SUMOReal minSamples,
447  const SUMOReal haltSpeed, const std::string& vTypes,
448  OutputDevice& device) throw(InvalidArgument);
450 
451 
452 
465  MSDetectorFileOutput* buildSingleLaneE2Det(const std::string& id,
466  DetectorUsage usage, MSLane* lane, SUMOReal pos, SUMOReal length,
467  SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold,
468  SUMOReal jamDistThreshold) ;
469 
470 
483  MSDetectorFileOutput* buildMultiLaneE2Det(const std::string& id, DetectorUsage usage, MSLane* lane, SUMOReal pos, SUMOReal length,
484  SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold,
485  SUMOReal jamDistThreshold) ;
486 
487 
488 
489 
490 protected:
496  public:
504  E3DetectorDefinition(const std::string& id,
505  OutputDevice& device, SUMOReal haltingSpeedThreshold,
506  SUMOTime haltingTimeThreshold, int splInterval) ;
507 
510 
512  std::string myID;
526 
527  private:
530 
533 
534  };
535 
536 
537 protected:
554  SUMOReal getPositionChecking(SUMOReal pos, MSLane* lane, bool friendlyPos,
555  const std::string& detid) throw(InvalidArgument);
556 
557 
566  void convUncontE2PosLength(const std::string& id, MSLane* clane,
567  SUMOReal& pos, SUMOReal& length, bool frinedly_pos) throw(InvalidArgument);
568 
569 
578  void convContE2PosLength(const std::string& id, MSLane* clane,
579  SUMOReal& pos, SUMOReal& length, bool frinedly_pos) throw(InvalidArgument);
580 
581 
582 
585 
592  MSEdge* getEdgeChecking(const std::string& edgeID, SumoXMLTag type,
593  const std::string& detid) throw(InvalidArgument);
594 
595 
602  MSLane* getLaneChecking(const std::string& laneID, SumoXMLTag type,
603  const std::string& detid) throw(InvalidArgument);
604 
605 
613  void checkSampleInterval(int splInterval, SumoXMLTag type, const std::string& id) throw(InvalidArgument);
615 
616 
617 protected:
620 
621 
622 private:
625 
626 
627 private:
630 
633 
634 };
635 
636 
637 #endif
638 
639 /****************************************************************************/
640