SUMO - Simulation of Urban MObility
GUIDetectorBuilder.cpp
Go to the documentation of this file.
1 /****************************************************************************/
8 // Builds detectors for guisim
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include <string>
33 #include <iostream>
34 #include <guisim/GUIInductLoop.h>
37 #include <guisim/GUIE3Collector.h>
39 #include <microsim/MSNet.h>
43 #include "GUIDetectorBuilder.h"
44 
45 #ifdef HAVE_INTERNAL
46 #include <mesogui/GUIMEInductLoop.h>
47 #include <mesosim/MELoop.h>
48 #endif
49 
50 #ifdef CHECK_MEMORY_LEAKS
51 #include <foreign/nvwa/debug_new.h>
52 #endif // CHECK_MEMORY_LEAKS
53 
54 
55 // ===========================================================================
56 // method definitions
57 // ===========================================================================
59  : NLDetectorBuilder(net) {}
60 
61 
63 
64 
67  MSLane* lane, SUMOReal pos, bool splitByType) {
68  return new GUIInductLoop(id, lane, pos, splitByType);
69 }
70 
71 
74  MSLane* lane, SUMOReal pos, const std::string& od) {
75  return new GUIInstantInductLoop(id, OutputDevice::getDevice(od), lane, pos);
76 }
77 
78 
79 #ifdef HAVE_INTERNAL
80 MEInductLoop*
81 GUIDetectorBuilder::createMEInductLoop(const std::string& id,
82  MESegment* s, SUMOReal pos) {
83  return new GUIMEInductLoop(id, s, pos);
84 }
85 #endif
86 
87 
90  DetectorUsage usage, MSLane* lane, SUMOReal pos, SUMOReal length,
91  SUMOTime haltingTimeThreshold,
92  SUMOReal haltingSpeedThreshold,
93  SUMOReal jamDistThreshold) {
94  return new GUI_E2_ZS_Collector(id, usage, lane, pos, length, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold);
95 }
96 
97 
100  DetectorUsage usage, MSLane* lane, SUMOReal pos,
101  SUMOTime haltingTimeThreshold,
102  SUMOReal haltingSpeedThreshold,
103  SUMOReal jamDistThreshold) {
104  return new GUI_E2_ZS_CollectorOverLanes(id, usage, lane, pos, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold);
105 }
106 
107 
110  const CrossSectionVector& entries,
111  const CrossSectionVector& exits,
112  SUMOReal haltingSpeedThreshold,
113  SUMOTime haltingTimeThreshold) {
114  return new GUIE3Collector(id, entries, exits, haltingSpeedThreshold, haltingTimeThreshold);
115 }
116 
117 
118 
119 /****************************************************************************/
120 
The gui-version of the MSE3Collector.
Builds detectors for microsim.
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.
The gui-version of a MS_E2_ZS_CollectorOverLanes.
GUIDetectorBuilder(MSNet &net)
Constructor.
std::vector< MSCrossSection > CrossSectionVector
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 (areal detector) using the given values.
The simulated network and simulation perfomer.
Definition: MSNet.h:94
virtual MSDetectorFileOutput * createInductLoop(const std::string &id, MSLane *lane, SUMOReal pos, bool splitByType)
Creates an instance of an e1 detector using the given values.
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.
The gui-version of the MSInductLoop.
Definition: GUIInductLoop.h:55
~GUIDetectorBuilder()
Destructor.
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.
The gui-version of the MSInstantInductLoop.
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
int SUMOTime
Definition: SUMOTime.h:43
The gui-version of the MS_E2_ZS_Collector.
#define SUMOReal
Definition: config.h:218
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
Base of value-generating classes (detectors)