Eclipse SUMO - Simulation of Urban MObility
MSDevice_StationFinder.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2023 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/****************************************************************************/
18// A device which triggers rerouting to nearby charging stations
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include "MSVehicleDevice.h"
24
25
26// ===========================================================================
27// class declarations
28// ===========================================================================
30class MSStoppingPlace;
31
32
33// ===========================================================================
34// class definitions
35// ===========================================================================
47public:
50 static void insertOptions(OptionsCont& oc);
51
52
65 static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSVehicleDevice*>& into);
66
67
68public:
74
77
80
95 bool notifyMove(SUMOTrafficObject& veh, double oldPos, double newPos, double newSpeed);
96
106 bool notifyIdle(SUMOTrafficObject& veh);
107
109
111 const std::string deviceName() const {
112 return "stationfinder";
113 }
114
121 void generateOutput(OutputDevice* tripinfoOut) const;
122
124 myBattery = battery;
125 }
126
127protected:
132 const double frontOnLane,
133 const double timeOnLane,
134 const double meanSpeedFrontOnLane,
135 const double meanSpeedVehicleOnLane,
136 const double travelledDistanceFrontOnLane,
137 const double travelledDistanceVehicleOnLane,
138 const double meanLengthOnLane);
139
140private:
143
146
149
150private:
153
156
157};
Battery device for electric vehicles.
A device which triggers rerouting to nearby charging stations.
void generateOutput(OutputDevice *tripinfoOut) const
Called on writing tripinfo output.
MSDevice_StationFinder(SUMOVehicle &holder)
Constructor.
void notifyMoveInternal(const SUMOTrafficObject &veh, const double frontOnLane, const double timeOnLane, const double meanSpeedFrontOnLane, const double meanSpeedVehicleOnLane, const double travelledDistanceFrontOnLane, const double travelledDistanceVehicleOnLane, const double meanLengthOnLane)
Internal notification about the vehicle moves, see MSMoveReminder::notifyMoveInternal()
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
Computes current emission values and adds them to their sums.
MSDevice_StationFinder & operator=(const MSDevice_StationFinder &)
Invalidated assignment operator.
MSStoppingPlace * myChargingStation
To which station we are currently travelling.
const std::string deviceName() const
return the name for this type of device
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_StationFinder-options.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
bool notifyIdle(SUMOTrafficObject &veh)
Computes idling emission values and adds them to the emission sums.
MSDevice_Battery * myBattery
The corresponding battery device.
void setBattery(MSDevice_Battery *battery)
double myReserveFactor
The safety buffer when calculating expected consumption.
MSDevice_StationFinder(const MSDevice_StationFinder &)
Invalidated copy constructor.
A lane area vehicles can halt at.
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:61
Representation of a vehicle, person, or container.
Representation of a vehicle.
Definition: SUMOVehicle.h:62