Skip to content

Commit

Permalink
compute energy estimation using vehicle properties ref #9663
Browse files Browse the repository at this point in the history
Signed-off-by: m-kro <m.barthauer@t-online.de>
  • Loading branch information
m-kro committed May 10, 2024
1 parent 2c1d124 commit 56fa2ba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/microsim/devices/MSDevice_StationFinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,9 @@ MSDevice_StationFinder::estimateConsumption(const MSEdge* target, const bool inc
} else {
// fallback consumption rate for vehicles starting with low battery
const double speed = MIN2(myHolder.getMaxSpeed(), myHolder.getLane()->getSpeedLimit());
expectedConsumption = DEFAULT_ENERGY_PER_DISTANCE * speed * (remainingTime - passedTime) / 1000.;
EnergyParams* const params = myHolder.getEmissionParameters();
expectedConsumption = PollutantsInterface::compute(myVeh.getVehicleType().getEmissionClass(), PollutantsInterface::ELEC,
speed * 0.8, 0., 0., params) * (remainingTime - passedTime);
}
if (includeEmptySoC) {
expectedConsumption += MAX2(0., myEmptySoC * myBattery->getMaximumBatteryCapacity() - myBattery->getActualBatteryCapacity());
Expand Down

0 comments on commit 56fa2ba

Please sign in to comment.