Eclipse SUMO - Simulation of Urban MObility
MSTransportableDevice_FCD.cpp
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 /****************************************************************************/
20 // A device which stands as an implementation FCD and which outputs movereminder calls
21 /****************************************************************************/
22 #include <config.h>
23 
27 #include <microsim/MSNet.h>
28 #include <microsim/MSLane.h>
29 #include <microsim/MSEdge.h>
32 
33 // ===========================================================================
34 // static members
35 // ===========================================================================
36 
37 // ===========================================================================
38 // method definitions
39 // ===========================================================================
40 // ---------------------------------------------------------------------------
41 // static initialisation methods
42 // ---------------------------------------------------------------------------
43 void
45  insertDefaultAssignmentOptions("fcd", "FCD Device", oc, true);
46 
47  oc.doRegister("person-device.fcd.period", new Option_String("0"));
48  oc.addDescription("person-device.fcd.period", "FCD Device", "Recording period for FCD-data");
49 }
50 
51 
52 void
53 MSTransportableDevice_FCD::buildDevices(MSTransportable& t, std::vector<MSTransportableDevice*>& into) {
55  if (equippedByDefaultAssignmentOptions(oc, "fcd", t, oc.isSet("fcd-output"), true)) {
56  MSTransportableDevice_FCD* device = new MSTransportableDevice_FCD(t, "fcd_" + t.getID());
57  into.push_back(device);
58  }
59 }
60 
61 
62 // ---------------------------------------------------------------------------
63 // MSTransportableDevice_FCD-methods
64 // ---------------------------------------------------------------------------
66  MSTransportableDevice(holder, id) {
67 }
68 
69 
71 }
72 
73 
74 void
76 }
77 
78 
79 /****************************************************************************/
static void insertDefaultAssignmentOptions(const std::string &deviceName, const std::string &optionsTopic, OptionsCont &oc, const bool isPerson=false)
Adds common command options that allow to assign devices to vehicles.
Definition: MSDevice.cpp:134
static bool equippedByDefaultAssignmentOptions(const OptionsCont &oc, const std::string &deviceName, DEVICEHOLDER &v, bool outputOptionSet, const bool isPerson=false)
Determines whether a vehicle should get a certain device.
Definition: MSDevice.h:204
A device which collects info on the vehicle trip (mainly on departure and arrival)
static void cleanup()
resets the edge filter
static void insertOptions(OptionsCont &oc)
Inserts MSTransportableDevice_FCD-options.
MSTransportableDevice_FCD(MSTransportable &holder, const std::string &id)
Constructor.
static void buildDevices(MSTransportable &t, std::vector< MSTransportableDevice * > &into)
Build devices for the given vehicle, if needed.
Abstract in-person device.
const std::string & getID() const
Returns the id.
Definition: Named.h:73
A storage for options typed value containers)
Definition: OptionsCont.h:89
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
void doRegister(const std::string &name, Option *v)
Adds an option under the given name.
Definition: OptionsCont.cpp:75
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:58