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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // A device which stands as an implementation FCD and which outputs movereminder calls
17 /****************************************************************************/
18 
19 // ===========================================================================
20 // included modules
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 
OptionsCont::isSet
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
Definition: OptionsCont.cpp:135
MSNet.h
OptionsCont.h
OptionsCont::getOptions
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:57
MSEdge.h
MSTransportable
Definition: MSTransportable.h:58
MSTransportableDevice_FCD::cleanup
static void cleanup()
resets the edge filter
Definition: MSTransportableDevice_FCD.cpp:75
OptionsCont::addDescription
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
Definition: OptionsCont.cpp:469
MSDevice::insertDefaultAssignmentOptions
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:126
OutputDevice.h
OptionsCont::doRegister
void doRegister(const std::string &name, Option *v)
Adds an option under the given name.
Definition: OptionsCont.cpp:74
MSTransportableDevice_FCD::buildDevices
static void buildDevices(MSTransportable &t, std::vector< MSTransportableDevice * > &into)
Build devices for the given vehicle, if needed.
Definition: MSTransportableDevice_FCD.cpp:53
Option_String
Definition: Option.h:399
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
MSTransportableDevice
Abstract in-person device.
Definition: MSTransportableDevice.h:52
MSTransportableDevice_FCD::insertOptions
static void insertOptions(OptionsCont &oc)
Inserts MSTransportableDevice_FCD-options.
Definition: MSTransportableDevice_FCD.cpp:44
MSTransportableDevice_FCD
A device which collects info on the vehicle trip (mainly on departure and arrival)
Definition: MSTransportableDevice_FCD.h:47
StringUtils.h
MSDevice::equippedByDefaultAssignmentOptions
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:203
MSTransportableDevice_FCD::MSTransportableDevice_FCD
MSTransportableDevice_FCD(MSTransportable &holder, const std::string &id)
Constructor.
Definition: MSTransportableDevice_FCD.cpp:65
MSTransportable.h
MSTransportable::getID
const std::string & getID() const
returns the id of the transportable
Definition: MSTransportable.cpp:699
MSTransportableDevice_FCD::~MSTransportableDevice_FCD
~MSTransportableDevice_FCD()
Destructor.
Definition: MSTransportableDevice_FCD.cpp:70
config.h
MSLane.h
MSTransportableDevice_FCD.h