Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSDevice_ElecHybrid.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2002-2024 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// The ElecHybrid device simulates internal electric parameters of an
20// battery-assisted electric vehicle (typically a trolleybus), i.e. a vehicle
21// that is being powered by overhead wires and has also a battery pack
22// installed, that is being charged from the overhead wires.
23/****************************************************************************/
24#include <config.h>
25
26#include <string.h> //due to strncmp
27#include <ctime> //due to clock()
35#include <microsim/MSNet.h>
36#include <microsim/MSLane.h>
37#include <microsim/MSEdge.h>
38#include <microsim/MSVehicle.h>
39#include <microsim/MSGlobals.h>
41#include <mesosim/MEVehicle.h>
42#include "MSDevice_Tripinfo.h"
43#include "MSDevice_Emissions.h"
44#include "MSDevice_ElecHybrid.h"
45
46
47// ===========================================================================
48// method definitions
49// ===========================================================================
50// ---------------------------------------------------------------------------
51// static initialisation methods
52// ---------------------------------------------------------------------------
53void
55 oc.addOptionSubTopic("ElecHybrid Device");
56 insertDefaultAssignmentOptions("elechybrid", "ElecHybrid Device", oc);
57}
58
59
60void
61MSDevice_ElecHybrid::buildVehicleDevices(SUMOVehicle& v, std::vector<MSVehicleDevice*>& into) {
62 // Check if vehicle should get an 'elecHybrid' device.
64 if (equippedByDefaultAssignmentOptions(oc, "elechybrid", v, false)) {
65 // Yes, build the device.
66 // Fetch the battery capacity (if present) from the vehicle descriptor.
67 const SUMOVTypeParameter& typeParams = v.getVehicleType().getParameter();
68 const SUMOVehicleParameter& vehicleParams = v.getParameter();
69 double actualBatteryCapacity = 0;
70 /* The actual battery capacity can be a parameter of the vehicle or its vehicle type.
71 The vehicle parameter takes precedence over the type parameter. */
72 std::string attrName = toString(SUMO_ATTR_ACTUALBATTERYCAPACITY);
73 if (vehicleParams.hasParameter(attrName)) {
74 const std::string abc = vehicleParams.getParameter(attrName, "-1");
75 try {
76 actualBatteryCapacity = StringUtils::toDouble(abc);
77 } catch (...) {
78 WRITE_WARNING("Invalid value '" + abc + "'for vehicle parameter '" + attrName + "'. Using the default of " + std::to_string(actualBatteryCapacity));
79 }
80 } else {
81 if (typeParams.hasParameter(attrName)) {
82 const std::string abc = typeParams.getParameter(attrName, "-1");
83 try {
84 actualBatteryCapacity = StringUtils::toDouble(abc);
85 WRITE_WARNING("Vehicle '" + v.getID() + "' does not provide vehicle parameter '" + attrName + "'. Using the vehicle type value of " + std::to_string(actualBatteryCapacity));
86 } catch (...) {
87 WRITE_WARNING("Invalid value '" + abc + "'for vehicle type parameter '" + attrName + "'. Using the default of " + std::to_string(actualBatteryCapacity));
88 }
89 } else {
90 WRITE_WARNING("Vehicle '" + v.getID() + "' does not provide vehicle or vehicle type parameter '" + attrName + "'. Using the default of " + std::to_string(actualBatteryCapacity));
91 }
92 }
93
94 // obtain maximumBatteryCapacity
95 double maximumBatteryCapacity = 0;
97 if (typeParams.hasParameter(attrName)) {
98 const std::string mbc = typeParams.getParameter(attrName, "-1");
99 try {
100 maximumBatteryCapacity = StringUtils::toDouble(mbc);
101 } catch (...) {
102 WRITE_WARNINGF(TL("Invalid value '%'for vType parameter '%'"), mbc, attrName);
103 }
104 } else {
105 WRITE_WARNING("Vehicle '" + v.getID() + "' is missing the vType parameter '" + attrName + "'. Using the default of " + std::to_string(maximumBatteryCapacity));
106 }
107
108 // obtain overheadWireChargingPower
109 double overheadWireChargingPower = 0;
111 if (typeParams.hasParameter(attrName)) {
112 const std::string ocp = typeParams.getParameter(attrName, "-1");
113 try {
114 overheadWireChargingPower = StringUtils::toDouble(ocp);
115 } catch (...) {
116 WRITE_WARNINGF(TL("Invalid value '%'for vType parameter '%'"), ocp, attrName);
117 }
118 } else {
119 WRITE_WARNING("Vehicle '" + v.getID() + "' is missing the vType parameter '" + attrName + "'. Using the default of " + std::to_string(overheadWireChargingPower));
120 }
121
122 // elecHybrid constructor
123 MSDevice_ElecHybrid* device = new MSDevice_ElecHybrid(v, "elecHybrid_" + v.getID(),
124 actualBatteryCapacity, maximumBatteryCapacity, overheadWireChargingPower);
125
126 // Add device to vehicle
127 into.push_back(device);
128 }
129}
130
131
132// ---------------------------------------------------------------------------
133// MSDevice_ElecHybrid-methods
134// ---------------------------------------------------------------------------
136 const double actualBatteryCapacity, const double maximumBatteryCapacity, const double overheadWireChargingPower) :
137 MSVehicleDevice(holder, id),
138 myActualBatteryCapacity(0), // [actualBatteryCapacity <= maximumBatteryCapacity]
139 myMaximumBatteryCapacity(0), // [maximumBatteryCapacity >= 0]t
140 myOverheadWireChargingPower(0),
141 myConsum(0),
142 myBatteryDischargedLogic(false),
143 myCharging(false), // Initially vehicle don't charge
144 myEnergyCharged(0), // Initially the energy charged is zero
145 myCircuitCurrent(NAN), // Initially the current is unknown
146 myCircuitVoltage(NAN), // Initially the voltage is unknown as well
147 myMaxBatteryCharge(NAN), // Initial maximum of the battery energy during the simulation is unknown
148 myMinBatteryCharge(NAN), // Initial minimum of the battery energy during the simulation is unknown
149 myTotalEnergyConsumed(0), // No energy spent yet
150 myTotalEnergyRegenerated(0), // No energy regenerated
151 myTotalEnergyWasted(0), // No energy wasted on resistors
152 // RICE_TODO: make these two parameters user configurable
153 mySOCMin(0.005), // Minimum SOC of the battery
154 mySOCMax(0.980), // Maximum SOC of the battery
155 myActOverheadWireSegment(nullptr), // Initially the vehicle isn't under any overhead wire segment
156 myPreviousOverheadWireSegment(nullptr), // Initially the vehicle wasn't under any overhead wire segment
157 veh_elem(nullptr),
158 veh_pos_tail_elem(nullptr),
159 pos_veh_node(nullptr) {
160
161 if (maximumBatteryCapacity < 0) {
162 WRITE_WARNINGF(TL("ElecHybrid builder: Vehicle '%' doesn't have a valid value for parameter % (%)."), getID(), toString(SUMO_ATTR_MAXIMUMBATTERYCAPACITY), toString(maximumBatteryCapacity));
163 } else {
164 myMaximumBatteryCapacity = maximumBatteryCapacity;
165 }
166
167 if (actualBatteryCapacity > maximumBatteryCapacity) {
168 WRITE_WARNING("ElecHybrid builder: Vehicle '" + getID() + "' has a " + toString(SUMO_ATTR_ACTUALBATTERYCAPACITY) + " (" + toString(actualBatteryCapacity) + ") greater than it's " + toString(SUMO_ATTR_MAXIMUMBATTERYCAPACITY) + " (" + toString(maximumBatteryCapacity) + "). A max battery capacity value will be asigned");
170 } else {
171 myActualBatteryCapacity = actualBatteryCapacity;
172 }
173
174 if (overheadWireChargingPower < 0) {
175 WRITE_WARNINGF(TL("ElecHybrid builder: Vehicle '%' doesn't have a valid value for parameter % (%)."), getID(), toString(SUMO_ATTR_OVERHEADWIRECHARGINGPOWER), toString(overheadWireChargingPower));
176 } else {
177 myOverheadWireChargingPower = overheadWireChargingPower;
178 }
179}
180
181
184
185
186bool
187MSDevice_ElecHybrid::notifyMove(SUMOTrafficObject& tObject, double /* oldPos */, double /* newPos */, double /* newSpeed */) {
188 if (!tObject.isVehicle()) {
189 return false;
190 }
191 SUMOVehicle& veh = static_cast<SUMOVehicle&>(tObject);
192 // Do not compute the current consumption here anymore:
193 // myConsum is (non-systematically, we agree) set in MSVehicle so that the vehicle `vNext` value can
194 // be influenced by the maximum traction power of the vehicle (i.e. installing a 80 kWh powertrain will
195 // limit the acceleration regardless of the acceleration specified in vehicleType params, in case that
196 // the vehicleType acceleration is too high).
197 //
198 // myParam[SUMO_ATTR_ANGLE] = myLastAngle == std::numeric_limits<double>::infinity() ? 0. : GeomHelper::angleDiff(myLastAngle, veh.getAngle());
199 // myConsum = PollutantsInterface::getEnergyHelper().compute(0, PollutantsInterface::ELEC, veh.getSpeed(), veh.getAcceleration(), veh.getSlope(), &myParam);
200 assert(!std::isnan(myConsum));
201
202 // is battery pack discharged (from previous timestep)
205 } else {
207 }
208
209 /* If battery is discharged we will force the vehicle to slowly come to
210 a halt (freewheel motion). It could still happen that some energy will
211 be recovered in later steps due to regenerative braking. */
212 if (isBatteryDischarged()) {
213 std::vector<std::pair<SUMOTime, double> > speedTimeLine;
217 double accel = acceleration(veh, 0, veh.getSpeed()); // or use veh.getAcceleration() method???
218 const double nextSpeed = MAX2(0., veh.getSpeed() + ACCEL2SPEED(accel));
219 speedTimeLine.push_back(
220 std::make_pair(
221 MSNet::getInstance()->getCurrentTimeStep(),
222 veh.getSpeed()));
223 speedTimeLine.push_back(
224 std::make_pair(
225 MSNet::getInstance()->getCurrentTimeStep() + DELTA_T,
226 nextSpeed));
227
228 static_cast<MSVehicle*>(&veh)->getInfluencer().setSpeedTimeLine(speedTimeLine);
229 }
230
231 /* Check if there is an overhead wire either over the lane where the vehicle is or over a
232 neighboring lanes. This check has to be performed at every simulation step as the
233 overhead wires for trolleybuses will typically end at a bus stop that is located somewhere
234 in the middle of the lane. */
235 std::string overheadWireSegmentID = MSNet::getInstance()->getStoppingPlaceID(veh.getLane(), veh.getPositionOnLane(), SUMO_TAG_OVERHEAD_WIRE_SEGMENT);
236
237 //check overhead line on the left neighboring lane
238 if (overheadWireSegmentID == "" && veh.getEdge()->leftLane(veh.getLane()) != nullptr) {
240 }
241 //check overhead line on the right neighboring lane
242 if (overheadWireSegmentID == "" && veh.getEdge()->rightLane(veh.getLane()) != nullptr) {
244 }
245
246 /* Store the amount of power that could not be recuperated. */
247 double energyWasted = 0.0;
248 /* If vehicle has access to an overhead wire (including the installation on neighboring lanes) */
249 if (overheadWireSegmentID != "") {
250 /* Update the actual overhead wire segment of this device */
253 /* Store the traction substation of the actual overhead wire segment */
255
256 /* Disable charging from previous (not the actual) overhead wire segment.
257 REASON:
258 If there is no gap between two different overhead wire segments that are
259 places on the same lane, the vehicle switches from the one segment to another
260 in one timestep. */
262 if (myPreviousOverheadWireSegment != nullptr) {
263 /* Remove the vehicle from the list of vehicles powered by the previous segment. */
266 if (ts != nullptr) {
268 ts->eraseVehicle(this);
269 }
270 }
271 /* Add the vehicle reference to the current segment. */
273 if (actualSubstation != nullptr) {
274 actualSubstation->increaseElecHybridCount();
275 actualSubstation->addVehicle(this);
276 }
277 }
278
279 /* Do we simulate the behaviour of the overhead wire electric circuit? */
281#ifdef HAVE_EIGEN
283 /* Circuit update due to vehicle movement:
284 Delete vehicle resistor element, vehicle resistor nodes and vehicle resistor
285 tails in the circuit used in the previous timestep. */
287
288 /* Add the vehicle to the circuit in case that there is a substation that provides
289 power to it. */
290 if (actualSubstation != nullptr) {
291 /* Add a resistor (current source in the future?) representing trolleybus
292 vehicle to the circuit.
293 pos/neg_veh_node elements
294 [0] .... vehicle_resistor
295 [1] .... leading resistor
296 [2] .... tail resistor pos/neg_tail_vehID
297 */
298
299 // pos_veh_node and veh_elem should be NULL
300 if (pos_veh_node != nullptr || veh_elem != nullptr) {
301 WRITE_WARNING("pos_veh_node or neg_veh_node or veh_elem is not NULL (and they should be at the beginning of adding elecHybrid to the circuit)");
302 }
303
304 // create pos and veh_elem
306 pos_veh_node = owc->addNode("pos_" + veh.getID());
307 assert(pos_veh_node != nullptr);
308 // adding current source element representing elecHybrid vehicle. The value of current is computed from wantedPower later by circuit solver. Thus NAN is used as an initial value.
309 veh_elem = owc->addElement("currentSrc" + veh.getID(), NAN,
310 pos_veh_node, owc->getNode("negNode_ground"),
312
313 // Connect vehicle to an existing overhead wire segment = add elecHybridVehicle to the myActOverheadWireSegment circuit
314 // Find pos resistor element of the actual overhead line section and their end nodes
315 Element* element_pos = owc->getElement("pos_" + myActOverheadWireSegment->getID());
316 Node* node_pos = element_pos->getNegNode();
317 double resistance = element_pos->getResistance();
318
319 /* Find the correct position of the vehicle at the overhead line.
320 We start the while loop at the end of the actual overhead line section and go against the direction of vehicle movement.
321 The decision rule is based on the resistance value:
322 * from the vehicle position to the end of lane,
323 * sum of resistance of elements (going from the end of overhead line section in the contrary direction).
324
325 The original solution runs into problems when a vehicle is going on a neighboring lane and the two lanes have different lengths:
326 while (resistance < (veh.getLane()->getLength() - veh.getPositionOnLane())*WIRE_RESISTIVITY) {
327 Improvement: take the relative distance of the vehicle to the end of its lane and map it to the segment's lane length. (This works also in case that the segment's lane and the vehicle's lane are identical.)
328 */
329 double relativePosOnSegment =
331 (veh.getPositionOnLane() / veh.getLane()->getLength()));
332
333 while (resistance < relativePosOnSegment * WIRE_RESISTIVITY) {
334 node_pos = element_pos->getPosNode();
335 element_pos = node_pos->getElements()->at(2);
336 resistance += element_pos->getResistance();
337 if (strncmp(element_pos->getName().c_str(), "pos_tail_", 9) != 0) {
338 WRITE_WARNING("splitting element is not 'pos_tail_XXX'")
339 }
340 }
341
342 node_pos = element_pos->getPosNode();
343 //resistance of vehicle tail nodes
344 resistance -= relativePosOnSegment * WIRE_RESISTIVITY;
345
346 /* dividing element_pos
347 before: |node_pos|---------------------------------------------|element_pos|----
348 after: |node_pos|----|veh_pos_tail_elem|----|pos_veh_node|----|element_pos|----
349 */
350 element_pos->setPosNode(pos_veh_node);
351 node_pos->eraseElement(element_pos);
352 pos_veh_node->addElement(element_pos);
353
354 veh_pos_tail_elem = owc->addElement("pos_tail_" + veh.getID(),
356
357 if (element_pos->getResistance() - resistance < 0) {
358 WRITE_WARNINGF(TL("The resistivity of overhead wire segment connected to vehicle % is < 0. Set to 1e-6."), veh.getID());
359 }
360
361 element_pos->setResistance(element_pos->getResistance() - resistance);
362
363
364 // Set the power requirement to the consumption + charging power.
365 // RICE_TODO: The charging power could be different when moving and when not. Add a parameter.
366 // Note that according to PMDP data, the charging power seems to be the same in both situations,
367 // ignoring the potential benefits of using a higher charging power when the vehicle is moving.
370 } else {
372 }
373
374 // No recuperation to overheadwire (only to the batterypack)
376 // the value of energyWasted is properly computed and updated after solving circuit by the solver
377 // energyWasted = 0;
379 }
380
381 // RICE_TODO: The voltage in the solver should never exceed or drop below some limits. Maximum allowed voltage is typically 800 V.
382 // The numerical solver that computes the circuit state needs initial values of electric currents and
383 // voltages from which it will start the iterative solving process. We prefer to reuse the "old" values
384 // as it is likely that the new values will not be far away from the old ones. The safety limits of
385 // 10 and 1500 Volts that are used below are chosen fairly arbitrarily to keep the initial values within
386 // reasonable limits.
387 double voltage = myCircuitVoltage;
388 if (voltage < 10.0 || voltage > 1500.0 || std::isnan(voltage)) {
389 // RICE_TODO : It seems to output warning whenever a vehicle is appearing under the overhead wire for the first time?
390 // WRITE_WARNINGF(TL("The initial voltage is was % V, replacing it with substation voltage % V."), toString(voltage), toString(actualSubstation->getSubstationVoltage()));
391 voltage = actualSubstation->getSubstationVoltage();
392 }
393 // Initial value of the electric current flowing into the vehicle that will be used by the solver
394 double current = -(veh_elem->getPowerWanted() / voltage);
395 veh_elem->setCurrent(current);
396
397 // Set the device as charging the battery by default
398 myCharging = true;
399
400 // And register the call to solver at the end of the simulation step
401 actualSubstation->addSolvingCircuitToEndOfTimestepEvents();
402 } else {
403 /*
404 No substation on this wire ...
405 */
406 // RICE_TODO myCharging = false; current 0 or nan, voltage 0 or nan, maybe write warning that the overhead wire is not connected to any substation,
407
408 // Energy flowing to/from the battery pack [Wh] has to completely cover vehicle consumption.
410 // Update Battery charge
412 // No substation is connected to this segment and the charging output is therefore zero.
414 }
415#else
416 WRITE_ERROR(TL("Overhead wire solver is on, but the Eigen library has not been compiled in!"))
417#endif
418 } else {
419 /*
420 Faster approximation without circuit solving at every simulation step.
421 */
422
423 // First check that there is a traction substation connected to the overhead wire
424 double voltage = 0.0;
425 if (actualSubstation != nullptr) {
426 voltage = actualSubstation->getSubstationVoltage();
427 }
428
429 // At this point the voltage can be (a) NAN if the substation voltage was not specified,
430 // (b) 0 if no substation powers the current segment or if someone put its power to zero,
431 // (c) >0 if the substation can provide energy to the circuit.
432 if (voltage > 0.0) {
433 // There is a power source connected to this segment.
434 // Set the simplified power requirement to the consumption + charging power.
435 // RICE_TODO: The charging power could be different when moving and when not. Add a parameter. See a similar code snippet above.
436 // Note that according to PMDP data, the charging power seems to be the same in both situations,
437 // ignoring the potential benefits of using a higher charging power when the vehicle is moving.
438 double powerWanted = WATTHR2WATT(myConsum);
440 // Additional `myOverheadWireChargingPower` due to charging of battery pack
441 powerWanted += myOverheadWireChargingPower;
442 }
443
444 // No recuperation to overhead wire (only to the battery pack)
445 // RICE_TODO: How to recuperate into the circuit without solver? (energy balance?)
446 // - solution: assume, that any power is possible to recuperate
447 if (!MSGlobals::gOverheadWireRecuperation && powerWanted < 0.0) {
448 // the value of energyWasted is properly computed and updated below
449 powerWanted = 0.0;
450 }
451
452 // Set the actual current and voltage of the global circuit
453 // RICE_TODO: Process the traction station current limiting here as well.
454 myCircuitCurrent = powerWanted / voltage;
455 myCircuitVoltage = voltage;
456
457 // Calculate energy charged
458 double energyIn = WATT2WATTHR(powerWanted);
459
460 // Calculate energy flowing to/from the battery in this step [Wh]
461 // RICE_TODO: It should be possible to define different efficiency values for direction overhead wire -> battery; motor -> battery.
462 // We use a simplification here. The biggest contributor to the total losses is the battery pack itself
463 // (the input LC filter is probably more efficient -- eta_LC ~ 0.99 -- compared to the induction motor
464 // with eta_motor ~ 0.95).
466
467 // Update the energy that has been stored in the battery pack and return the real energy charged in this step
468 // considering SOC limits of the battery pack.
469 double realEnergyCharged = storeEnergyToBattery(myEnergyCharged);
470 // Set energy wasted
471 energyWasted = myEnergyCharged - realEnergyCharged;
472
473 // Add the energy provided by the overhead wire segment to the output of the segment
475 } else {
476 /*
477 Overhead wire without a connected substation
478 */
479 // RICE_TODO myCharging = false; current 0 or nan, voltage 0 or nan, maybe write warning that the overhead wire is not connected to any substation,
480
481 // Energy for the powertrain is provided by the battery pack
483 // Update battery charge
485 // No energy was provided by the overhead wire segment
487 }
488 }
489 assert(myActOverheadWireSegment != nullptr);
491 } else {
492 /*
493 No overhead wires, no charging.
494 */
495
496 // Disable charing flag
497 myCharging = false;
498
499 // Invalidate the circuit voltage and current
500 myCircuitCurrent = NAN;
501 myCircuitVoltage = NAN;
502
503 // Additional bookkeeping in case that the circuit solver is used
505#ifdef HAVE_EIGEN
506 /*
507 Delete vehicle resistor element, vehicle resistor nodes and vehicle resistor tails
508 in the previous circuit (i.e. the circuit used in the previous timestep)
509 */
511#else
512 WRITE_ERROR(TL("Overhead wire solver is on, but the Eigen library has not been compiled in!"))
513#endif
514 }
515
516 // Vehicle is not under an overhead wire
517 myActOverheadWireSegment = nullptr;
518
519 // Remove the vehicle from overhead wire if it was under it in the previous step.
520 // This has to be called after deleteVehicleFromCircuit() as the file uses myPreviousOverheadWire.
521 if (myPreviousOverheadWireSegment != nullptr) {
524 if (ts != nullptr) {
526 ts->eraseVehicle(this);
527 }
529 }
530
531 // Energy for the powertrain is provided by the battery pack
533 // Update battery charge
535 }
536
537 // Update the statistical values
538 // RICE_TODO: update these statistical values also after solving circuit by electric circuit
541 }
544 }
545
546 if (myConsum > 0.0) {
548 } else {
550 }
551 myTotalEnergyWasted += energyWasted;
552
553 return true; // keep the device
554}
555
556// Note: This is called solely in the mesoscopic mode to mimic the `notifyMove()` reminder
557void
559 const SUMOTrafficObject& tObject,
560 const double frontOnLane,
561 const double timeOnLane,
562 const double meanSpeedFrontOnLane,
563 const double meanSpeedVehicleOnLane,
564 const double travelledDistanceFrontOnLane,
565 const double travelledDistanceVehicleOnLane,
566 const double meanLengthOnLane) {
567 UNUSED_PARAMETER(tObject);
568 UNUSED_PARAMETER(frontOnLane);
569 UNUSED_PARAMETER(timeOnLane);
570 UNUSED_PARAMETER(meanSpeedFrontOnLane);
571 UNUSED_PARAMETER(meanSpeedVehicleOnLane);
572 UNUSED_PARAMETER(travelledDistanceFrontOnLane);
573 UNUSED_PARAMETER(travelledDistanceVehicleOnLane);
574 UNUSED_PARAMETER(meanLengthOnLane);
575}
576
577void
579 if (myPreviousOverheadWireSegment != nullptr) {
581 //check if all pointers to vehicle elements and nodes are not nullptr
582 if (veh_elem == nullptr || veh_pos_tail_elem == nullptr || pos_veh_node == nullptr) {
583 WRITE_ERRORF("During deleting vehicle '%' from circuit some init previous Nodes or Elements was not assigned.", veh.getID());
584 }
585 //check if pos_veh_node has 3 elements - they should be: veh_elem, veh_pos_tail_elem and an overhead line resistor element "ahead" of vehicle.
586 if (pos_veh_node->getElements()->size() != 3) {
587 WRITE_ERRORF("During deleting vehicle '%' from circuit the size of element-vector of pNode or nNode was not 3. It should be 3 by Jakub's opinion.", veh.getID());
588 }
589 //delete vehicle resistor element "veh_elem" in the previous circuit,
592 delete veh_elem;
593 veh_elem = nullptr;
594
595 //erasing of tail elements (the element connected to the veh_node is after then only the ahead overhead line resistor element)
597
598 if (pos_veh_node->getElements()->size() != 1) {
599 WRITE_ERRORF("During deleting vehicle '%' from circuit the size of element-vector of pNode or nNode was not 1. It should be 1 by Jakub's opinion.", veh.getID());
600 }
601
602 // add the resistance value of veh_tail element to the resistance value of the ahead overhead line element
603 pos_veh_node->getElements()->front()->setResistance(pos_veh_node->getElements()->front()->getResistance() + veh_pos_tail_elem->getResistance());
604 //set PosNode of the ahead overhead line element to the posNode value of tail element
605 Element* aux = pos_veh_node->getElements()->front();
606 //set node = 3 operations
608 aux->getPosNode()->eraseElement(aux);
610
611 // erase tail element from its PosNode
613 // delete veh_pos_tail_elem
615 delete veh_pos_tail_elem;
616 veh_pos_tail_elem = nullptr;
617
618 //erase pos_veh_node
620 //modify id of other elements (the id of erasing element should be the greatest)
622 if (pos_veh_node->getId() != lastId) {
623 Node* node_last = myPreviousOverheadWireSegment->getCircuit()->getNode(lastId);
624 if (node_last != nullptr) {
625 node_last->setId(pos_veh_node->getId());
626 } else {
628 if (elem_last != nullptr) {
629 elem_last->setId(pos_veh_node->getId());
630 } else {
631 WRITE_ERROR(TL("The element or node with the last Id was not found in the circuit!"));
632 }
633 }
634 }
636 delete pos_veh_node;
637 pos_veh_node = nullptr;
638 }
639 }
640}
641
642bool
644 SUMOTrafficObject& tObject,
645 MSMoveReminder::Notification /* reason */,
646 const MSLane* /* enteredLane */) {
647 if (!tObject.isVehicle()) {
648 return false;
649 }
650#ifdef ELECHYBRID_MESOSCOPIC_DEBUG
651 SUMOVehicle& veh = static_cast<SUMOVehicle&>(tObject);
652 std::cout << "device '" << getID() << "' notifyEnter: reason=" << reason << " currentEdge=" << veh.getEdge()->getID() << "\n";
653#endif
654
655 return true; // keep the device
656}
657
658bool
660 SUMOTrafficObject& tObject,
661 double /*lastPos*/,
663 const MSLane* /* enteredLane */) {
664 if (!tObject.isVehicle()) {
665 return false;
666 }
667 SUMOVehicle& veh = static_cast<SUMOVehicle&>(tObject);
668#ifdef ELECHYBRID_MESOSCOPIC_DEBUG
669 SUMOVehicle& veh = static_cast<SUMOVehicle&>(tObject);
670 std::cout << "device '" << getID() << "' notifyLeave: reason=" << reason << " currentEdge=" << veh.getEdge()->getID() << "\n";
671 SUMOVehicle* sumoVehicle = *veh;
673 MEVehicle& v = dynamic_cast<MEVehicle&>(veh);
674 std::cout << "***************** MESO - notifyLeave*** START ****************** '" << v.getID() << "' \n";
675 //TODO the second argument of getStoptime should change
676 std::cout << "getSpeed: '" << v.getSpeed() << "' | getAverageSpeed: '" << v.getAverageSpeed() << "' | getStoptime: '" << v.getStoptime(v.getSegment(), 0) << "' \n";
677 std::cout << "getStopEdges: '" << "' | getLastEntryTime: '" << v.getLastEntryTime() << "' | getBlockTimeSeconds: '" << v.getBlockTimeSeconds() << "' \n";
678 std::cout << "getWaitingTime: '" << v.getWaitingTime() << "' | getAccumulatedWaitingTime: '" << v.getWaitingTime(true) << "' | getLastEntryTimeSeconds: '" << v.getLastEntryTimeSeconds() << "' \n";
679 std::cout << "***************** MESO - notifyLeave*** END ****************** '" << v.getID() << "' \n";
680 }
681#endif
682
683 // The MSMoveReminders are sorted so that we can do `<`. See also BTreceiver and BTsender devices...
685 return true;
686 }
687
689#ifdef HAVE_EIGEN
690 // ------- *** ------- delete vehicle resistor element, vehicle resistor nodes and vehicle resistor tails in the previous circuit (circuit used in the previous timestep)------- *** -------
692#else
693 UNUSED_PARAMETER(veh);
694 WRITE_ERROR(TL("Overhead wire solver is on, but the Eigen library has not been compiled in!"))
695#endif
696 }
697 // disable charging vehicle from overhead wire and segment and traction station
698 if (myPreviousOverheadWireSegment != nullptr) {
701 if (prevSubstation != nullptr) {
702 prevSubstation->decreaseElecHybridCount();
703 prevSubstation->eraseVehicle(this);
704 }
706 }
707 return true;
708}
709
710
711void
713 if (tripinfoOut != nullptr) {
714 // Write the summary elecHybrid information into tripinfo output
715 tripinfoOut->openTag("elechybrid");
716 tripinfoOut->writeAttr("maxBatteryCharge", myMaxBatteryCharge);
717 tripinfoOut->writeAttr("minBatteryCharge", myMinBatteryCharge);
718 tripinfoOut->writeAttr("totalEnergyConsumed", myTotalEnergyConsumed);
719 tripinfoOut->writeAttr("totalEnergyRegenerated", myTotalEnergyRegenerated);
720 tripinfoOut->writeAttr("totalEnergyWasted", myTotalEnergyWasted);
721 tripinfoOut->closeTag();
722 }
723}
724
725
726double
730
731
732double
736
737std::string
738MSDevice_ElecHybrid::getParameter(const std::string& key) const {
739 // RICE_TODO: full traci support
742 } else if (key == toString(SUMO_ATTR_ENERGYCONSUMED)) {
743 return toString(myConsum);
744 } else if (key == toString(SUMO_ATTR_ENERGYCHARGED)) {
746 } else if (key == toString(SUMO_ATTR_MAXIMUMBATTERYCAPACITY)) {
748 } else if (key == toString(SUMO_ATTR_OVERHEADWIREID)) {
750 } else if (key == toString(SUMO_ATTR_SUBSTATIONID)) {
752 } else if (key == toString(SUMO_ATTR_VEHICLEMASS)) {
753 WRITE_WARNING(TL("Getting the vehicle mass via parameters is deprecated, please use getMass for the vehicle or its type."));
755 }
756 throw InvalidArgument("Parameter '" + key + "' is not supported for device of type '" + deviceName() + "'");
757}
758
759
761 double energyCharged = energyIn - myConsum;
762 /*
763 Apply recuperation or propulsion efficiency if necessary
764 1. if (energyIn > 0.0 && energyCharged > 0 && it->getConsum() >= 0) = > recuper eff for energyCharged
765 2. if (energyIn > 0.0 && energyCharged > 0 && it->getConsum() < 0) => recuper eff only for energyIn
766 3. if (energyIn < 0.0 && it->getConsum() > 0) => 1/propulsion eff only for energyIn
767 4. if (energyIn < 0.0 && energyCharged < 0 && it->getConsum() < 0) => 1/propulsion eff only for energyCharged
768 */
769 if (energyIn > 0.0 && energyCharged > 0.0) {
770 // the vehicle is charging battery from overhead wire
771 if (myConsum >= 0) {
773 } else {
775 }
776 } else if (energyIn < 0.0 && energyCharged < 0.0) {
777 // the vehicle is recuperating energy into the overhead wire and discharging batterypack at the same time
778 if (myConsum >= 0) {
780 } else {
782 }
783 }
784 return energyCharged;
785}
786
787double
789 return myConsum;
790}
791
792void
793MSDevice_ElecHybrid::setConsum(const double consumption) {
795}
796
797void
799 myTotalEnergyWasted += energyWasted;
800}
801
802double
806
807void
809 myEnergyCharged = energyCharged;
810}
811
812double
815#ifdef HAVE_EIGEN
817 if (owc != nullptr) {
818 return owc->getAlphaBest() ;
819 }
820#else
821 WRITE_ERROR(TL("Overhead wire solver is on, but the Eigen library has not been compiled in!"))
822#endif
823 }
824 return NAN;
825}
826
827double
829 if (veh_elem != nullptr) {
830 return veh_elem->getPowerWanted();
831 }
832 return NAN;
833}
834
835double
839
840void
844
845double
849
850void
854
855std::string
857 if (myActOverheadWireSegment != nullptr) {
859 } else {
860 return "";
861 }
862}
863
864std::string
866 if (myActOverheadWireSegment != nullptr) {
868 if (ts != nullptr) {
869 return ts->getID();
870 }
871 }
872 return "";
873}
874
875bool
879
880double
882 // Original energy state of the battery pack
883 double previousEnergyInBattery = myActualBatteryCapacity;
884 // Push as much energy as the battery pack can accomodate.
885 // The battery has SOC limits that will prevent it from being overcharged, hence some energy may remain "free".
887 // The "free" energy that still remains and has to be stored elsewhere or burned on resistors is the difference.
888 return myActualBatteryCapacity - previousEnergyInBattery;
889}
890
891void
892MSDevice_ElecHybrid::setActualBatteryCapacity(const double actualBatteryCapacity) {
893 // Use the SOC limits to cap the actual battery capacity
894 if (actualBatteryCapacity < mySOCMin * myMaximumBatteryCapacity) {
895 //WRITE_WARNINGF(TL("The Battery of vehicle '%' has been exhausted."), getID());
897 } else if (actualBatteryCapacity > mySOCMax * myMaximumBatteryCapacity) {
899 } else {
900 myActualBatteryCapacity = actualBatteryCapacity;
901 }
902}
903
904void
905MSDevice_ElecHybrid::setParameter(const std::string& key, const std::string& value) {
906 double doubleValue;
907 try {
908 doubleValue = StringUtils::toDouble(value);
909 } catch (NumberFormatException&) {
910 throw InvalidArgument("Setting parameter '" + key + "' requires a number for device of type '" + deviceName() + "'");
911 }
913 myActualBatteryCapacity = doubleValue;
914 } else if (key == toString(SUMO_ATTR_MAXIMUMBATTERYCAPACITY)) {
915 myMaximumBatteryCapacity = doubleValue;
917 myOverheadWireChargingPower = doubleValue;
918 } else {
919 throw InvalidArgument("Setting parameter '" + key + "' is not supported for device of type '" + deviceName() + "'");
920 }
921}
922
923double
927
928double
932
933
934/****************************************************************************/
#define WATT2WATTHR(_x)
#define WATTHR2WATT(_x)
const double WIRE_RESISTIVITY
#define WRITE_WARNINGF(...)
Definition MsgHandler.h:296
#define WRITE_ERRORF(...)
Definition MsgHandler.h:305
#define WRITE_ERROR(msg)
Definition MsgHandler.h:304
#define WRITE_WARNING(msg)
Definition MsgHandler.h:295
#define TL(string)
Definition MsgHandler.h:315
SUMOTime DELTA_T
Definition SUMOTime.cpp:38
#define ACCEL2SPEED(x)
Definition SUMOTime.h:51
#define TS
Definition SUMOTime.h:42
@ SUMO_TAG_OVERHEAD_WIRE_SEGMENT
An overhead wire segment.
@ SUMO_ATTR_ENERGYCONSUMED
Energy consumed.
@ SUMO_ATTR_SUBSTATIONID
id of a traction substation substation
@ SUMO_ATTR_MAXIMUMBATTERYCAPACITY
Maxium battery capacity.
@ SUMO_ATTR_MASS
@ SUMO_ATTR_RECUPERATIONEFFICIENCY
Recuperation efficiency (constant)
@ SUMO_ATTR_ACTUALBATTERYCAPACITY
@ SUMO_ATTR_VEHICLEMASS
Vehicle mass.
@ SUMO_ATTR_ENERGYCHARGED
tgotal of Energy charged
@ SUMO_ATTR_OVERHEADWIREID
@ SUMO_ATTR_PROPULSIONEFFICIENCY
Propulsion efficiency.
@ SUMO_ATTR_OVERHEADWIRECHARGINGPOWER
#define UNUSED_PARAMETER(x)
Definition StdDefs.h:30
T MIN2(T a, T b)
Definition StdDefs.h:76
T MAX2(T a, T b)
Definition StdDefs.h:82
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
double getAlphaBest()
return alphaBest variable, the best alpha scaling value
Definition Circuit.h:127
Node * addNode(std::string name)
Definition Circuit.cpp:42
Element * addElement(std::string name, double value, Node *pNode, Node *nNode, Element::ElementType et)
Definition Circuit.cpp:787
void eraseNode(Node *node)
Definition Circuit.cpp:62
int getLastId()
Definition Circuit.h:240
Element * getElement(std::string name)
Definition Circuit.cpp:116
Element * getVoltageSource(int id)
Definition Circuit.cpp:139
void decreaseLastId()
Definition Circuit.h:245
Node * getNode(std::string name)
Definition Circuit.cpp:98
void eraseElement(Element *element)
Definition Circuit.cpp:831
void setId(int id)
Definition Element.cpp:133
double getResistance()
Definition Element.cpp:99
void setCurrent(double current)
Definition Element.cpp:63
double getPowerWanted()
Definition Element.cpp:102
Node * getNegNode()
Definition Element.cpp:115
std::string getName()
Definition Element.cpp:122
void setPosNode(Node *node)
Definition Element.cpp:126
Node * getPosNode()
Definition Element.cpp:112
void setResistance(double resistance)
Definition Element.cpp:66
void setPowerWanted(double powerWanted)
Definition Element.cpp:73
@ RESISTOR_traction_wire
Definition Element.h:54
@ CURRENT_SOURCE_traction_wire
Definition Element.h:55
double getDouble(SumoXMLAttr attr) const
Returns the value for a given key.
double compute(const SUMOEmissionClass c, const PollutantsInterface::EmissionType e, const double v, const double a, const double slope, const EnergyParams *param) const
Computes the emitted pollutant amount using the given speed and acceleration.
double acceleration(const SUMOEmissionClass c, const PollutantsInterface::EmissionType e, const double v, const double P, const double slope, const EnergyParams *param) const
Computes the achievable acceleration using the given speed and amount of consumed electric power.
A vehicle from the mesoscopic point of view.
Definition MEVehicle.h:42
double getLastEntryTimeSeconds() const
Returns the entry time for the current segment.
Definition MEVehicle.h:300
double getBlockTimeSeconds() const
Returns the time at which the vehicle was blocked on the current segment.
Definition MEVehicle.h:305
double getAverageSpeed() const
Returns the vehicle's estimated average speed on the segment assuming no further delays.
SUMOTime getWaitingTime(const bool accumulated=false) const
Returns the duration for which the vehicle was blocked.
Definition MEVehicle.h:284
SUMOTime getLastEntryTime() const
Returns the time the vehicle entered the current segment.
Definition MEVehicle.h:255
MESegment * getSegment() const
Returns the current segment the vehicle is on.
Definition MEVehicle.h:224
double getSpeed() const
Returns the vehicle's estimated speed assuming no delays.
A device which collects info on the vehicle trip (mainly on departure and arrival)
void setEnergyCharged(double energyCharged)
bool myCharging
Parameter, Flag: Vehicle is charging (by default is false)
MSDevice_ElecHybrid(SUMOVehicle &holder, const std::string &id, const double actualBatteryCapacity, const double maximumBatteryCapacity, const double overheadWireChargingPower)
Constructor.
void setCurrentFromOverheadWire(double current)
double myMaximumBatteryCapacity
Parameter, The total vehicles's Battery Capacity in Wh, [myMaximumBatteryCapacity >= 0].
MSOverheadWire * myPreviousOverheadWireSegment
Parameter, Pointer to the act overhead wire segment in previous step (by default is nullptr),...
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
void deleteVehicleFromCircuit(SUMOVehicle &veh)
double getVoltageOfOverheadWire() const
Get actual voltage on the overhead wire segment.
double myEnergyCharged
Energy flowing into (+) or from (-) the battery pack in the given timestep.
bool notifyLeave(SUMOTrafficObject &tObject, double lastPos, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Saves arrival info.
double mySOCMax
Maximal SOC of the battery pack, battery will not be charged above this level. (But the buffer may st...
double getMaximumBatteryCapacity() const
Get the total vehicle's Battery Capacity in kWh.
double consumption(SUMOVehicle &veh, double a, double newSpeed)
return energy consumption in Wh (power multiplied by TS)
double computeChargedEnergy(double energyIn)
compute charged energy properly considering recuperation and propulsion efficiency during charging ba...
double myTotalEnergyWasted
Energy that could not be stored back to the battery or traction station and was wasted on resistors....
void setConsum(const double consumption)
bool isBatteryDischarged() const
Get consum.
void generateOutput(OutputDevice *tripinfoOut) const
Called on writing tripinfo output.
double myConsum
Parameter, Vehicle consumption during a time step (by default is 0.)
void setActualBatteryCapacity(const double actualBatteryCapacity)
Set actual vehicle's Battery Capacity in kWh.
std::string getParameter(const std::string &key) const
try to retrieve the given parameter from this device. Throw exception for unsupported key
double acceleration(SUMOVehicle &veh, double power, double oldSpeed)
double storeEnergyToBattery(const double energy)
Attempt to store energy into battery pack and return the energy that could not be accommodated due to...
void updateTotalEnergyWasted(const double energyWasted)
Add energyWasted to the total sum myTotalEnergyWasted.
double getCurrentFromOverheadWire() const
Get actual current in the overhead wire segment.
bool myBatteryDischargedLogic
Parameter, Flag: Battery of Vehicle is fully discharged (by default is false)
const std::string deviceName() const
return the name for this type of device
bool notifyMove(SUMOTrafficObject &tObject, double oldPos, double newPos, double newSpeed)
Checks for waiting steps when the vehicle moves.
double myOverheadWireChargingPower
Parameter, overhead wire charging power to battery, if the battery SoC is not full (in Watt)
void setVoltageOfOverheadWire(double voltage)
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_ElecHybrid-options.
MSOverheadWire * myActOverheadWireSegment
Parameter, Pointer to the actual overhead wire segment in which vehicle is placed (by default is null...
double myActualBatteryCapacity
Parameter, The actual vehicles's Battery Capacity in Wh, [myActualBatteryCapacity <= myMaximumBattery...
double getEnergyCharged() const
Get charged energy.
std::string getTractionSubstationID() const
Get actual traction substation ID.
virtual void notifyMoveInternal(const SUMOTrafficObject &tObject, 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.
bool notifyEnter(SUMOTrafficObject &tObject, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Saves departure info on insertion.
double getActualBatteryCapacity() const
Get the actual vehicle's Battery Capacity in kWh.
double getConsum() const
Get consum.
double myCircuitCurrent
Parameter, Current wanted at overhead wire in next timestep.
std::string getOverheadWireSegmentID() const
Get actual overhead wire segment ID.
void setParameter(const std::string &key, const std::string &value)
try to set the given parameter for this device. Throw exception for unsupported key
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:155
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:195
MSLane * leftLane(const MSLane *const lane) const
Returns the lane left to the one given, 0 if the given lane is leftmost.
Definition MSEdge.cpp:450
MSLane * rightLane(const MSLane *const lane) const
Returns the lane right to the one given, 0 if the given lane is rightmost.
Definition MSEdge.cpp:456
static bool gUseMesoSim
Definition MSGlobals.h:106
static bool gOverheadWireRecuperation
Definition MSGlobals.h:124
static bool gOverheadWireSolver
Definition MSGlobals.h:121
Representation of a lane in the micro simulation.
Definition MSLane.h:84
double getLength() const
Returns the lane's length.
Definition MSLane.h:606
Notification
Definition of a vehicle state.
@ NOTIFICATION_TELEPORT
The vehicle is being teleported.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition MSNet.cpp:186
std::string getStoppingPlaceID(const MSLane *lane, const double pos, const SumoXMLTag category) const
Returns the stop of the given category close to the given position.
Definition MSNet.cpp:1402
MSStoppingPlace * getStoppingPlace(const std::string &id, const SumoXMLTag category) const
Returns the named stopping place of the given category.
Definition MSNet.cpp:1381
Definition of overhead wire segment.
Circuit * getCircuit() const
void addChargeValueForOutput(double WCharged, MSDevice_ElecHybrid *elecHybrid, bool ischarging=1)
add charge value for output
MSTractionSubstation * getTractionSubstation() const
void eraseVehicle(SUMOVehicle &veh)
void addVehicle(SUMOVehicle &veh)
const MSLane & getLane() const
Returns the lane this stop is located at.
Traction substation powering one or more overhead wire sections.
void eraseVehicle(MSDevice_ElecHybrid *elecHybrid)
double getSubstationVoltage() const
void addSolvingCircuitToEndOfTimestepEvents()
void addVehicle(MSDevice_ElecHybrid *elecHybrid)
Abstract in-vehicle device.
SUMOVehicle & myHolder
The vehicle that stores the device.
Representation of a vehicle in the micro simulation.
Definition MSVehicle.h:77
const SUMOVTypeParameter & getParameter() const
const std::string & getID() const
Returns the id.
Definition Named.h:74
Definition Node.h:39
int getId()
Definition Node.cpp:77
void addElement(Element *element)
Definition Node.cpp:44
void eraseElement(Element *element)
Definition Node.cpp:48
void setId(int id)
Definition Node.cpp:81
std::vector< Element * > * getElements()
Definition Node.cpp:101
A storage for options typed value containers)
Definition OptionsCont.h:89
void addOptionSubTopic(const std::string &topic)
Adds an option subtopic.
static OptionsCont & getOptions()
Retrieves the options.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
bool hasParameter(const std::string &key) const
Returns whether the parameter is set.
virtual const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
static const HelpersEnergy & getEnergyHelper()
get energy helper
Representation of a vehicle, person, or container.
virtual bool isVehicle() const
Whether it is a vehicle.
virtual const MSVehicleType & getVehicleType() const =0
Returns the object's "vehicle" type.
virtual double getSlope() const =0
Returns the slope of the road at object's position in degrees.
virtual const MSLane * getLane() const =0
Returns the lane the object is currently at.
virtual double getSpeed() const =0
Returns the object's current speed.
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle's parameter (including departure definition)
virtual const MSEdge * getEdge() const =0
Returns the edge the object is currently at.
virtual double getPositionOnLane() const =0
Get the object's position along the lane.
Structure representing possible vehicle parameter.
Representation of a vehicle.
Definition SUMOVehicle.h:62
virtual EnergyParams * getEmissionParameters() const =0
Returns the vehicle's emission model parameter.
Structure representing possible vehicle parameter.
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter