Skip to content

Commit

Permalink
fix #1852
Browse files Browse the repository at this point in the history
git-svn-id: file:///home/behr_mi/git/sumo_synched/trunk@20388 afbd958f-9f77-42d5-a016-97a22340ccf4
  • Loading branch information
namdre committed Apr 8, 2016
1 parent 8a3a886 commit 27871a5
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 70 deletions.
10 changes: 5 additions & 5 deletions sumo/src/microsim/devices/MSDevice_Battery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ MSDevice_Battery::buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*>& in


bool MSDevice_Battery::notifyMove(SUMOVehicle& veh, SUMOReal /* oldPos */, SUMOReal /* newPos */, SUMOReal /* newSpeed */) {
// Start vehicleStoppedTimer if the vehicle is stopped (that's mean, speed is < 0.2). In other case reset timer
if (veh.getSpeed() < 0.2) {
// Start vehicleStoppedTimer if the vehicle is stopped. In other case reset timer
if (veh.getSpeed() < SUMO_const_haltingSpeed) {
// Increase vehicle stopped timer
increaseVehicleStoppedTimer();
} else {
Expand Down Expand Up @@ -171,9 +171,9 @@ bool MSDevice_Battery::notifyMove(SUMOVehicle& veh, SUMOReal /* oldPos */, SUMOR
MSChargingStation* ChargingStationPointer = MSNet::getInstance()->getChargingStation(ChargingStationID);

// if the vehicle is almost stopped, or charge in transit is enabled, then charge vehicle
if ((veh.getSpeed() < 0.2) || (ChargingStationPointer->getChargeInTransit() == 1)) {
if ((veh.getSpeed() < SUMO_const_haltingSpeed) || (ChargingStationPointer->getChargeInTransit() == 1)) {
// Set Flags Stopped/intransit to
if (veh.getSpeed() < 0.2) {
if (veh.getSpeed() < SUMO_const_haltingSpeed) {
// vehicle ist almost stopped, then is charging stopped
ItsChargingStopped = true;

Expand All @@ -192,7 +192,7 @@ bool MSDevice_Battery::notifyMove(SUMOVehicle& veh, SUMOReal /* oldPos */, SUMOR

// Only update charging start time if vehicle allow charge in transit, or in other case
// if the vehicle not allow charge in transit but it's stopped.
if (ChargingStationPointer->getChargeInTransit() == 1 || veh.getSpeed() < 0.2) {
if (ChargingStationPointer->getChargeInTransit() == 1 || veh.getSpeed() < SUMO_const_haltingSpeed) {
// Update Charging start time
increaseChargingStartTime();
}
Expand Down

0 comments on commit 27871a5

Please sign in to comment.