Eclipse SUMO - Simulation of Urban MObility
MEInductLoop.h
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 /****************************************************************************/
18 // An induction loop for mesoscopic simulation
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
23 #include <string>
24 #include <deque>
25 #include <map>
26 #include <functional>
30 #include <utils/common/Named.h>
31 
32 
33 // ===========================================================================
34 // class declarations
35 // ===========================================================================
36 class MESegment;
37 
38 // ===========================================================================
39 // class definitions
40 // ===========================================================================
46 public:
47  MEInductLoop(const std::string& id,
48  MESegment* s,
49  double positionInMeters,
50  const std::string name, const std::string& vTypes,
51  const std::string& nextEdges,
52  int detectPersons);
53 
54 
55  ~MEInductLoop();
56 
69  dev.writeXMLHeader("detector", "det_e1meso_file.xsd");
70  }
71 
72 
85  void writeXMLOutput(OutputDevice& dev,
86  SUMOTime startTime, SUMOTime stopTime);
88 
90  return myMeanData;
91  }
92 
93  const MSEdge& getEdge() const;
94 
95 protected:
97  const std::string myName;
98 
101 
103  const double myPosition;
104 
107 
108 private:
109 
112 
115 
118 };
long long int SUMOTime
Definition: GUI.h:35
An induction loop for mesoscopic simulation.
Definition: MEInductLoop.h:45
MEInductLoop(const MEInductLoop &)
Hidden copy constructor.
const MSEdge & getEdge() const
MESegment *const mySegment
mesoscopic edge segment the loop lies on
Definition: MEInductLoop.h:100
const double myPosition
position from the start of the edge / lane
Definition: MEInductLoop.h:103
void writeXMLOutput(OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime)
const MSMeanData_Net::MSLaneMeanDataValues & getMeanData() const
Definition: MEInductLoop.h:89
MSMeanData_Net::MSLaneMeanDataValues myMeanData
data collector for the loop
Definition: MEInductLoop.h:106
MEInductLoop & operator=(const MEInductLoop &)
Hidden assignment operator.
void writeXMLDetectorProlog(OutputDevice &dev) const
Opens the XML-output using "detector" as root element.
Definition: MEInductLoop.h:68
MEInductLoop()
Hidden default constructor.
const std::string myName
name
Definition: MEInductLoop.h:97
A single mesoscopic segment (cell)
Definition: MESegment.h:49
Base of value-generating classes (detectors)
A road/street connecting two junctions.
Definition: MSEdge.h:77
Data structure for mean (aggregated) edge/lane values.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61
bool writeXMLHeader(const std::string &rootElement, const std::string &schemaFile, std::map< SumoXMLAttr, std::string > attrs=std::map< SumoXMLAttr, std::string >(), bool includeConfig=true)
Writes an XML header with optional configuration.