Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEChargingStation.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-2025 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 class for visualizing chargingStation geometry (adapted from GUILaneWrapper)
20/****************************************************************************/
21#pragma once
22#include <config.h>
23
24#include "GNEStoppingPlace.h"
25
26// ===========================================================================
27// class definitions
28// ===========================================================================
29
31
32public:
35
54 GNEChargingStation(const std::string& id, GNENet* net, const std::string& filename, GNELane* lane,
55 const double startPos, const double endPos, const std::string& name, const double chargingPower,
56 const double totalPower, const double efficiency, const bool chargeInTransit, const SUMOTime chargeDelay,
57 const std::string& chargeType, const SUMOTime waitingTime, const std::string& parkingAreaID,
58 const bool friendlyPosition, const Parameterised::Map& parameters);
59
62
66 void writeAdditional(OutputDevice& device) const override;
67
70
72 void updateGeometry() override;
73
75
78
83 void drawGL(const GUIVisualizationSettings& s) const override;
84
86
89
90 /* @brief method for getting the Attribute of an XML key
91 * @param[in] key The attribute key
92 * @return string with the value associated to key
93 */
94 std::string getAttribute(SumoXMLAttr key) const override;
95
96 /* @brief method for getting the Attribute of an XML key in double format
97 * @param[in] key The attribute key
98 * @return double with the value associated to key
99 */
100 double getAttributeDouble(SumoXMLAttr key) const override;
101
102 /* @brief method for setting the attribute and letting the object perform additional changes
103 * @param[in] key The attribute key
104 * @param[in] value The new value
105 * @param[in] undoList The undoList on which to register changes
106 */
107 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
108
109 /* @brief method for checking if the key and their correspond attribute are valids
110 * @param[in] key The attribute key
111 * @param[in] value The value associated to key key
112 * @return true if the value is valid, false in other case
113 */
114 bool isValid(SumoXMLAttr key, const std::string& value) override;
115
117
118protected:
120 double myChargingPower = 0;
121
123 double myTotalPower = 0;
124
126 double myEfficiency = 0;
127
129 bool myChargeInTransit = false;
130
133
135 std::string myChargeType = "normal";
136
139
141 std::string myParkingAreaID;
142
143private:
145 void setAttribute(SumoXMLAttr key, const std::string& value) override;
146
149
152};
long long int SUMOTime
Definition GUI.h:36
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
GNEChargingStation(const GNEChargingStation &)=delete
Invalidated copy constructor.
std::string myChargeType
charging type
double getAttributeDouble(SumoXMLAttr key) const override
void writeAdditional(OutputDevice &device) const override
write additional element into a xml file
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
bool isValid(SumoXMLAttr key, const std::string &value) override
~GNEChargingStation()
Destructor.
std::string myParkingAreaID
parking area ID
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
void updateGeometry() override
update pre-computed geometry information
SUMOTime myChargeDelay
delay in the starting of charge
GNEChargingStation & operator=(const GNEChargingStation &)=delete
Invalidated assignment operator.
bool myChargeInTransit
enable or disable charge in transit
std::string getAttribute(SumoXMLAttr key) const override
double myChargingPower
Charging power pro timestep and vehicle.
double myTotalPower
Charging power pro timestep across all charging vehicles.
double myEfficiency
efficiency of the charge
SUMOTime myWaitingTime
waiting time before start charging
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
Stores the information about how to visualize structures.
Static storage of an output device and its base (abstract) implementation.
std::map< std::string, std::string > Map
parameters map