Skip to content

Commit

Permalink
feat: add health penalty for driving too fast
Browse files Browse the repository at this point in the history
  • Loading branch information
Devdutt Shenoi committed Nov 16, 2023
1 parent 529042f commit c243f2d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion uplink/src/collector/simulator/data/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ impl ElectricVehicle {
self.state = "Running".to_string();

if self.soc < 0.2 {
self.soh -= HEALTH_PENALTY; // penalty for driving on low battery
self.soh -= HEALTH_PENALTY * TIME_PERIOD; // penalty for driving on low battery
}

if self.speed < 65.0 {
self.soh -= HEALTH_PENALTY * TIME_PERIOD; // penalty for driving too fast
}
}

Expand Down

0 comments on commit c243f2d

Please sign in to comment.