LCOV - code coverage report
Current view: top level - app/src/Dynamic/Policy/RewardFunction - RewardFunctionLocal.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 10 0.0 %
Date: 2023-08-17 16:45:52 Functions: 0 1 0.0 %

          Line data    Source code
       1             : #include "Dynamic/Policy/RewardFunction/RewardFunctionLocal.hpp"
       2             : 
       3             : #include "Dynamic/Env/Env.hpp"
       4             : 
       5             : using namespace std;
       6             : using namespace Dynamic;
       7             : 
       8           0 : Reward RewardFunctionLocal::operator()(const Env::Env &env, const Env::Vehicle &vehicle) {
       9           0 :     Time leftLane = env.getTime();
      10             : 
      11           0 : #pragma GCC diagnostic push
      12           0 : #pragma GCC diagnostic ignored "-Wfloat-equal"
      13           0 :     assert(vehicle.enteredLane == vehicle.path.back().first);
      14           0 : #pragma GCC diagnostic pop
      15             : 
      16           0 :     Time t = leftLane - vehicle.enteredLane;
      17             : 
      18           0 :     Env::Lane &lane = vehicle.position.lane;
      19             : 
      20           0 :     t *= (Time)(lane.moving.size() + lane.stopped.size());
      21             : 
      22           0 :     return -t;
      23             : }
      24             : 
      25             : RewardFunctionLocal RewardFunctionLocal::INSTANCE;

Generated by: LCOV version 1.14