SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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-sim.org/
11 // Copyright (C) 2001-2014 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