SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSDevice_Example.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // A device which stands as an implementation example and which outputs movereminder calls
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
10 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef MSDevice_Example_h
21 #define MSDevice_Example_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include "MSDevice.h"
34 #include <utils/common/SUMOTime.h>
35 
36 
37 // ===========================================================================
38 // class declarations
39 // ===========================================================================
40 class SUMOVehicle;
41 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
54 class MSDevice_Example : public MSDevice {
55 public:
59  static void insertOptions(OptionsCont& oc);
60 
61 
72  static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*>& into);
73 
74 
75 
76 public:
79 
80 
81 
84 
94  bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos,
95  SUMOReal newPos, SUMOReal newSpeed);
96 
97 
107 
108 
117  bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos,
120 
121 
122 
129  void generateOutput() const;
130 
131 
132 
133 private:
139  MSDevice_Example(SUMOVehicle& holder, const std::string& id, SUMOReal customValue1,
140  SUMOReal customValue2, SUMOReal customValue3);
141 
142 
143 
144 private:
145  // private state members of the Example device
146 
149 
152 
155 
156 
157 
158 private:
161 
164 
165 
166 };
167 
168 
169 #endif
170 
171 /****************************************************************************/
172 
~MSDevice_Example()
Destructor.
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason)
Saves departure info on insertion.
SUMOReal myCustomValue3
a value which is initialised based on a vType parameter
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSDevice * > &into)
Build devices for the given vehicle, if needed.
Notification
Definition of a vehicle state.
bool notifyMove(SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
Checks for waiting steps when the vehicle moves.
A device which collects info on the vehicle trip (mainly on departure and arrival) ...
bool notifyLeave(SUMOVehicle &veh, SUMOReal lastPos, MSMoveReminder::Notification reason)
Saves arrival info.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_Example-options.
SUMOReal myCustomValue2
a value which is initialised based on a vehicle parameter
MSDevice_Example & operator=(const MSDevice_Example &)
Invalidated assignment operator.
Representation of a vehicle.
Definition: SUMOVehicle.h:63
Abstract in-vehicle device.
Definition: MSDevice.h:68
void generateOutput() const
Called on writing tripinfo output.
MSDevice_Example(SUMOVehicle &holder, const std::string &id, SUMOReal customValue1, SUMOReal customValue2, SUMOReal customValue3)
Constructor.
A storage for options typed value containers)
Definition: OptionsCont.h:108
#define SUMOReal
Definition: config.h:215
SUMOReal myCustomValue1
a value which is initialised based on a commandline/configuration option