Skip to content

Commit

Permalink
adapting transportable mass #2337
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Dec 16, 2024
1 parent d8720b1 commit 5d83955
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/microsim/MSBaseVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,9 @@ MSBaseVehicle::addTransportable(MSTransportable* transportable) {
}
myContainerDevice->addTransportable(transportable);
}
if (myEnergyParams != nullptr) {
myEnergyParams->setTransportableMass(myEnergyParams->getTransportableMass() + transportable->getVehicleType().getMass());
}
}


Expand Down Expand Up @@ -2216,6 +2219,9 @@ MSBaseVehicle::removeTransportable(MSTransportable* t) {
if (myContainerDevice != nullptr) {
myContainerDevice->removeTransportable(t);
}
if (myEnergyParams != nullptr) {
myEnergyParams->setTransportableMass(myEnergyParams->getTransportableMass() - t->getVehicleType().getMass());
}
}


Expand Down

0 comments on commit 5d83955

Please sign in to comment.