Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GUIDetectorBuilder.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
19// Builds detectors for guisim
20/****************************************************************************/
21#include <config.h>
22
23#include <string>
24#include <iostream>
29#include <microsim/MSGlobals.h>
30#include <microsim/MSNet.h>
34#include "GUIDetectorBuilder.h"
35
37#include <mesosim/MELoop.h>
38
39
40// ===========================================================================
41// method definitions
42// ===========================================================================
45
46
48
49
52 MSLane* lane, double pos, double length,
53 const std::string name, const std::string& vTypes,
54 const std::string& nextEdges,
55 int detectPersons, bool show) {
57 return new GUIMEInductLoop(id, MSGlobals::gMesoNet->getSegmentForEdge(lane->getEdge(), pos), pos, name, vTypes, nextEdges, detectPersons, show);
58 } else {
59 return new GUIInductLoop(id, lane, pos, length, name, vTypes, nextEdges, detectPersons, show);
60 }
61}
62
63
66 MSLane* lane, double pos, const std::string& od, const std::string name, const std::string& vTypes, const std::string& nextEdges) {
67 return new GUIInstantInductLoop(id, OutputDevice::getDevice(od), lane, pos, name, vTypes, nextEdges);
68}
69
70
73 DetectorUsage usage, MSLane* lane, double pos, double endPos, double length,
74 SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold,
75 const std::string name, const std::string& vTypes,
76 const std::string& nextEdges,
77 int detectPersons, bool showDetector) {
78 return new GUIE2Collector(id, usage, lane, pos, endPos, length, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, name, vTypes, nextEdges, detectPersons, showDetector);
79}
80
83 DetectorUsage usage, std::vector<MSLane*> lanes, double pos, double endPos,
84 SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold,
85 const std::string name, const std::string& vTypes,
86 const std::string& nextEdges,
87 int detectPersons, bool showDetector) {
88 return new GUIE2Collector(id, usage, lanes, pos, endPos, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, name, vTypes, nextEdges, detectPersons, showDetector);
89}
90
93 const CrossSectionVector& entries,
94 const CrossSectionVector& exits,
95 double haltingSpeedThreshold,
96 SUMOTime haltingTimeThreshold,
97 const std::string name, const std::string& vTypes,
98 const std::string& nextEdges,
99 int detectPersons, bool openEntry, bool expectArrival) {
100 return new GUIE3Collector(id, entries, exits, haltingSpeedThreshold, haltingTimeThreshold, name, vTypes, nextEdges, detectPersons, openEntry, expectArrival);
101}
102
103
104/****************************************************************************/
long long int SUMOTime
Definition GUI.h:36
std::vector< MSCrossSection > CrossSectionVector
virtual MSDetectorFileOutput * createInstantInductLoop(const std::string &id, MSLane *lane, double pos, const std::string &od, const std::string name, const std::string &vTypes, const std::string &nextEdges) override
Creates an instance of an e1 detector using the given values.
GUIDetectorBuilder(MSNet &net)
Constructor.
virtual MSDetectorFileOutput * createE3Detector(const std::string &id, const CrossSectionVector &entries, const CrossSectionVector &exits, double haltingSpeedThreshold, SUMOTime haltingTimeThreshold, const std::string name, const std::string &vTypes, const std::string &nextEdges, int detectPersons, bool openEntry, bool expectArrival) override
Creates an instance of an e3 detector using the given values.
virtual MSDetectorFileOutput * createInductLoop(const std::string &id, MSLane *lane, double pos, double length, const std::string name, const std::string &vTypes, const std::string &nextEdges, int detectPersons, bool show) override
Creates an instance of an e1 detector using the given values.
~GUIDetectorBuilder()
Destructor.
virtual MSE2Collector * createE2Detector(const std::string &id, DetectorUsage usage, MSLane *lane, double pos, double endPos, double length, SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold, const std::string name, const std::string &vTypes, const std::string &nextEdges, int detectPersons, bool showDetector) override
Creates a GUIE2Collector instance, overrides MSE2Collector::createE2Detector()
The gui-version of the MSE2Collector.
The gui-version of the MSE3Collector.
The gui-version of the MSInductLoop.
The gui-version of the MSInstantInductLoop.
Base of value-generating classes (detectors)
An areal detector corresponding to a sequence of consecutive lanes.
static bool gUseMesoSim
Definition MSGlobals.h:106
static MELoop * gMesoNet
mesoscopic simulation infrastructure
Definition MSGlobals.h:112
Representation of a lane in the micro simulation.
Definition MSLane.h:84
MSEdge & getEdge() const
Returns the lane's edge.
Definition MSLane.h:764
The simulated network and simulation perfomer.
Definition MSNet.h:89
Builds detectors for microsim.
static OutputDevice & getDevice(const std::string &name, bool usePrefix=true)
Returns the described OutputDevice.