Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSDevice_FCD.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2013-2026 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// A device which records floating car data
20/****************************************************************************/
21#pragma once
22#include <config.h>
23
24#include "MSVehicleDevice.h"
25#include <microsim/MSVehicle.h>
28
29// ===========================================================================
30// class declarations
31// ===========================================================================
32class SUMOVehicle;
34
35
36// ===========================================================================
37// class definitions
38// ===========================================================================
48public:
52 static void insertOptions(OptionsCont& oc);
53
64 static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSVehicleDevice*>& into);
65
66public:
69
70 bool notifyEnter(SUMOTrafficObject& /*veh*/, MSMoveReminder::Notification /*reason*/, const MSLane* /*enteredLane*/) {
71 return false;
72 }
73
74 void saveState(OutputDevice& /* out */) const {
75 }
76
78 const std::string deviceName() const {
79 return "fcd";
80 }
81
82 static inline SUMOTime getBegin() {
83 return myBegin;
84 }
85
86 static inline SUMOTime getPeriod() {
87 return myPeriod;
88 }
89
90 static inline bool useGeo() {
91 return myUseGeo;
92 }
93
94 static inline bool useUTM() {
95 return myUseUTM;
96 }
97
98 static inline double getMaxLeaderDistance() {
100 }
101
102 static inline const std::vector<std::string>& getParamsToWrite() {
103 return myParamsToWrite;
104 }
105
106 static inline double getRadius() {
107 return myRadius;
108 }
109
110 static inline const std::set<const MSEdge*>& getEdgeFilter() {
111 return myEdgeFilter;
112 }
113
114 static inline const SumoXMLAttrMask& getWrittenAttributes() {
115 return myWrittenAttributes;
116 }
117
118 static inline bool skipEmpty() {
119 return mySkipEmpty;
120 }
121
123 static void initOnce();
124
126 static void cleanup();
127
129 static bool shapeFilter(const SUMOTrafficObject* veh);
130
132 inline static bool hasShapeFilter() {
134 }
135
136private:
142 MSDevice_FCD(SUMOVehicle& holder, const std::string& id);
143
147 static bool myUseGeo;
148 static bool myUseUTM;
149 static double myMaxLeaderDistance;
150 static std::vector<std::string> myParamsToWrite;
151 static double myRadius;
152
154 static std::set<const MSEdge*> myEdgeFilter;
156
158 static std::vector<PositionVector> myShape4Filters;
161
165
167 static bool mySkipEmpty;
168
169private:
172
175
176 static void buildShapeFilter();
177
178
179};
long long int SUMOTime
Definition GUI.h:36
std::bitset< 96 > SumoXMLAttrMask
A device which collects info on the vehicle trip (mainly on departure and arrival)
static void cleanup()
resets the edge filter
void saveState(OutputDevice &) const
Saves the state of the device.
static const std::set< const MSEdge * > & getEdgeFilter()
MSDevice_FCD(const MSDevice_FCD &)
Invalidated copy constructor.
static SumoXMLAttrMask getDefaultMask()
const std::string deviceName() const
return the name for this type of device
static SUMOTime getPeriod()
static double getRadius()
static SUMOTime myBegin
begin time
static SUMOTime getBegin()
~MSDevice_FCD()
Destructor.
bool notifyEnter(SUMOTrafficObject &, MSMoveReminder::Notification, const MSLane *)
Checks whether the reminder is activated by a vehicle entering the lane.
static bool myShapeFilterInitialized
static bool useGeo()
static double getMaxLeaderDistance()
static std::vector< PositionVector > myShape4Filters
polygon spatial filter for FCD output
static SumoXMLAttrMask myWrittenAttributes
bit mask for checking attributes to be written
static std::set< const MSEdge * > myEdgeFilter
edge filter for FCD output
MSDevice_FCD & operator=(const MSDevice_FCD &)
Invalidated assignment operator.
static std::vector< std::string > myParamsToWrite
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_FCD-options.
static double myRadius
static bool myUseUTM
static bool skipEmpty()
static bool mySkipEmpty
whether time steps without vehicles will generate output
static bool myEdgeFilterInitialized
static bool myShapeFilterDesired
static void initOnce()
initialize edge filter and attribute mask (once)
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
static double myMaxLeaderDistance
static bool hasShapeFilter()
is there a filter based on shapes?
static bool useUTM()
static SUMOTime myPeriod
static void buildShapeFilter()
static bool shapeFilter(const SUMOTrafficObject *veh)
checks if in polygon
static bool myUseGeo
static const SumoXMLAttrMask & getWrittenAttributes()
static const std::vector< std::string > & getParamsToWrite()
Representation of a lane in the micro simulation.
Definition MSLane.h:84
Notification
Definition of a vehicle state.
Abstract in-vehicle device.
A storage for options typed value containers)
Definition OptionsCont.h:89
Static storage of an output device and its base (abstract) implementation.
Representation of a vehicle, person, or container.
Representation of a vehicle.
Definition SUMOVehicle.h:63