/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file MEInductLoop.h14/// @author Daniel Krajzewicz15/// @date Tue, May 200516///17// An induction loop for mesoscopic simulation18/****************************************************************************/19#pragma once20#include <config.h>2122#include <string>23#include <deque>24#include <map>25#include <functional>26#include <microsim/output/MSDetectorFileOutput.h>27#include <microsim/output/MSMeanData_Net.h>28#include <utils/iodevices/OutputDevice.h>29#include <utils/common/Named.h>303132// ===========================================================================33// class declarations34// ===========================================================================35class MESegment;3637// ===========================================================================38// class definitions39// ===========================================================================40/**41* @class MEInductLoop42* @brief An induction loop for mesoscopic simulation43*/44class MEInductLoop : public MSDetectorFileOutput {45public:46MEInductLoop(const std::string& id,47MESegment* s,48double positionInMeters,49const std::string name, const std::string& vTypes,50const std::string& nextEdges,51int detectPersons);525354~MEInductLoop();5556/**57* @name Inherited MSDetectorFileOutput methods.58*59* @see MSDetectorFileOutput60*/61//@{62/** @brief Opens the XML-output using "detector" as root element63*64* @param[in] dev The output device to write the root into65* @see MSDetectorFileOutput::writeXMLDetectorProlog66*/67void writeXMLDetectorProlog(OutputDevice& dev) const {68dev.writeXMLHeader("detector", "det_e1meso_file.xsd");69}707172/**73* Get the XML-formatted output of all the get*-methods except74* getTimeSinceLastDetection.75*76* @param lastNTimesteps take data out of the interval77* (now-lastNTimesteps, now].78*79* @return XML-formatted output of all the get*-methods except80* getTimeSinceLastDetection.81*82* @see MSDetector2File83*/84void writeXMLOutput(OutputDevice& dev,85SUMOTime startTime, SUMOTime stopTime);86//@}8788const MSMeanData_Net::MSLaneMeanDataValues& getMeanData() const {89return myMeanData;90}9192const MSEdge& getEdge() const;9394protected:95/// @brief name96const std::string myName;9798/// @brief mesoscopic edge segment the loop lies on99MESegment* const mySegment;100101/// @brief position from the start of the edge / lane102const double myPosition;103104/// @brief data collector for the loop105MSMeanData_Net::MSLaneMeanDataValues myMeanData;106107private:108109/// Hidden default constructor.110MEInductLoop();111112/// Hidden copy constructor.113MEInductLoop(const MEInductLoop&);114115/// Hidden assignment operator.116MEInductLoop& operator=(const MEInductLoop&);117};118119120