Eclipse SUMO - Simulation of Urban MObility
MSDevice_FCD.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2013-2020 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 <utils/common/SUMOTime.h>
26 
27 
28 // ===========================================================================
29 // class declarations
30 // ===========================================================================
31 class SUMOVehicle;
32 class SUMOTrafficObject;
33 
34 
35 // ===========================================================================
36 // class definitions
37 // ===========================================================================
46 class MSDevice_FCD : public MSVehicleDevice {
47 public:
51  static void insertOptions(OptionsCont& oc);
52 
53 
64  static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSVehicleDevice*>& into);
65 
66 public:
68  ~MSDevice_FCD();
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 const std::set<const MSEdge*>& getEdgeFilter() {
83  return myEdgeFilter;
84  }
85 
87  static void cleanup();
88 
89 private:
95  MSDevice_FCD(SUMOVehicle& holder, const std::string& id);
96 
97 
99  static std::set<const MSEdge*> myEdgeFilter;
101 
103  static void initEdgeFilter();
104 
105 private:
108 
111 
112 
113 };
A device which collects info on the vehicle trip (mainly on departure and arrival)
Definition: MSDevice_FCD.h:46
static void cleanup()
resets the edge filter
void saveState(OutputDevice &) const
Saves the state of the device.
Definition: MSDevice_FCD.h:74
MSDevice_FCD(const MSDevice_FCD &)
Invalidated copy constructor.
const std::string deviceName() const
return the name for this type of device
Definition: MSDevice_FCD.h:78
MSDevice_FCD(SUMOVehicle &holder, const std::string &id)
Constructor.
~MSDevice_FCD()
Destructor.
bool notifyEnter(SUMOTrafficObject &, MSMoveReminder::Notification, const MSLane *)
Checks whether the reminder is activated by a vehicle entering the lane.
Definition: MSDevice_FCD.h:70
static const std::set< const MSEdge * > & getEdgeFilter()
Definition: MSDevice_FCD.h:82
static std::set< const MSEdge * > myEdgeFilter
spatial filter for FCD output
Definition: MSDevice_FCD.h:99
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_FCD-options.
MSDevice_FCD & operator=(const MSDevice_FCD &)
Invalidated assignment operator.
static void initEdgeFilter()
initialize edge filter (once)
static bool myEdgeFilterInitialized
Definition: MSDevice_FCD.h:100
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
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.
Definition: OutputDevice.h:60
Representation of a vehicle, person, or container.
Representation of a vehicle.
Definition: SUMOVehicle.h:58