    

 ## On this page

  

 

 # simulation\_framework::evaluator::DistanceDrivenEvaluator Class Reference

 Last update: 16.07.2025 

class [DistanceDrivenEvaluator](classsimulation__framework_1_1evaluator_1_1DistanceDrivenEvaluator.xhtml "class DistanceDrivenEvaluator") [More...](classsimulation__framework_1_1evaluator_1_1DistanceDrivenEvaluator.xhtml#details)

`#include <<a class="el" href="distance__driven__evaluator_8h_source.xhtml">distance_driven_evaluator.h</a>>`

Inheritance diagram for simulation_framework::evaluator::DistanceDrivenEvaluator:

![Inheritance graph](/sites/default/files/migrate-content/avxcelerate_simulation_framework_2025_r2_2/classsimulation__framework_1_1evaluator_1_1DistanceDrivenEvaluator__inherit__graph.png)

\[[legend](graph_legend.xhtml)\]

Collaboration diagram for simulation_framework::evaluator::DistanceDrivenEvaluator:

![Collaboration graph](/sites/default/files/migrate-content/avxcelerate_simulation_framework_2025_r2_2/classsimulation__framework_1_1evaluator_1_1DistanceDrivenEvaluator__coll__graph.png)

\[[legend](graph_legend.xhtml)\]

## <a id="pub-methods" name="pub-methods"></a>Public Member Functions

 [DistanceDrivenEvaluator](classsimulation__framework_1_1evaluator_1_1DistanceDrivenEvaluator.xhtml#a73f1fbf32fa117be135700df7bd9bf80) (const std::string &amp;kpi\_name="driven\_dist") void [Init](classsimulation__framework_1_1evaluator_1_1DistanceDrivenEvaluator.xhtml#abfe81ec22fdea705cf8ed83d51f2f3eb) () override Initializes the KPI logic.   
 void [Reset](classsimulation__framework_1_1evaluator_1_1DistanceDrivenEvaluator.xhtml#a0ae35bde229b1db909a6331e8062d3ac) () override Resets the KPI logic.   
 [core::kpi::KpiContent](structsimulation__framework_1_1core_1_1kpi_1_1KpiContent.xhtml) [CalculateKpi](classsimulation__framework_1_1evaluator_1_1DistanceDrivenEvaluator.xhtml#a84b5bd6ae0f4af77a17363b20ed5b086) (const osi3::GroundTruth &amp;ground\_truth) override Executes the core KPI calculation logic.   
 core::kpi::Type [GetKpiType](classsimulation__framework_1_1evaluator_1_1DistanceDrivenEvaluator.xhtml#acc4088bba0acb50e544228f3ed1fa35a) () const override Retrieves the KPI type.   
 ![-](/sites/default/files/migrate-content/avxcelerate_simulation_framework_2025_r2_2/closed.png) Public Member Functions inherited from [simulation\_framework::core::kpi::IKpi&lt; osi3::GroundTruth &gt;](classsimulation__framework_1_1core_1_1kpi_1_1IKpi.xhtml)[virtual](classsimulation__framework_1_1core_1_1Topic.xhtml) **~IKpi** ()=[default](classsimulation__framework_1_1core_1_1Topic.xhtml) Virtual destructor for proper cleanup of derived classes.   
 <a id="details" name="details"></a>## Detailed Description

class [DistanceDrivenEvaluator](classsimulation__framework_1_1evaluator_1_1DistanceDrivenEvaluator.xhtml "class DistanceDrivenEvaluator")

Definition of [DistanceDrivenEvaluator](classsimulation__framework_1_1evaluator_1_1DistanceDrivenEvaluator.xhtml "class DistanceDrivenEvaluator") class to To fulfill this we want to implement a KPI evaluator that aggregates the distance driven by the ego vehicle over the course of the simulation.

Definition at line [29](distance__driven__evaluator_8h_source.xhtml#l00029) of file [distance\_driven\_evaluator.h](distance__driven__evaluator_8h_source.xhtml).



## Constructor &amp; Destructor Documentation

<a id="a73f1fbf32fa117be135700df7bd9bf80" name="a73f1fbf32fa117be135700df7bd9bf80"></a>## [◆ ](#a73f1fbf32fa117be135700df7bd9bf80)DistanceDrivenEvaluator()

 simulation\_framework::evaluator::DistanceDrivenEvaluator::DistanceDrivenEvaluator  ( const std::string &amp;  *kpi\_name* = `"driven_dist"`) 

Definition at line [11](distance__driven__evaluator_8cpp_source.xhtml#l00011) of file [distance\_driven\_evaluator.cpp](distance__driven__evaluator_8cpp_source.xhtml).

 11 : driven_dist_(0.0), kpi_name_(kpi_name)

 12{

 13}







## Member Function Documentation

<a id="a84b5bd6ae0f4af77a17363b20ed5b086" name="a84b5bd6ae0f4af77a17363b20ed5b086"></a>## [◆ ](#a84b5bd6ae0f4af77a17363b20ed5b086)CalculateKpi()

 [core::kpi::KpiContent](structsimulation__framework_1_1core_1_1kpi_1_1KpiContent.xhtml) simulation\_framework::evaluator::DistanceDrivenEvaluator::CalculateKpi  ( const osi3::GroundTruth &amp;  *input*)   overridevirtual 

Executes the core KPI calculation logic.

Parameters inputThe input data required for KPI calculation. ReturnsThe calculated KPI content as a `KpiContent` object. Implements [simulation\_framework::core::kpi::IKpi&lt; osi3::GroundTruth &gt;](classsimulation__framework_1_1core_1_1kpi_1_1IKpi.xhtml#a614cb6051405e8865257360eefff9ab6).

Definition at line [22](distance__driven__evaluator_8cpp_source.xhtml#l00022) of file [distance\_driven\_evaluator.cpp](distance__driven__evaluator_8cpp_source.xhtml).

 23{

 24 core::kpi::KpiContent kpi_content;

 25 kpi_content.name = kpi_name_;

 26 kpi_content.data_type = core::kpi::Datatype::Value::kDouble;

 27 kpi_content.type = [GetKpiType](classsimulation__framework_1_1evaluator_1_1DistanceDrivenEvaluator.xhtml#acc4088bba0acb50e544228f3ed1fa35a)();

 28 kpi_content.unit = "m";

 29 kpi_content.timestamp.seconds = ground_truth.timestamp().seconds();

 30 kpi_content.timestamp.nanoseconds = ground_truth.timestamp().nanos();

 31 

 32 const auto dist_from_last_position = distance_calculator_.Calculate(ground_truth);

 33 driven_dist_ += dist_from_last_position;

 34 kpi_content.value = std::to_string(driven_dist_);

 35 

 36 return kpi_content;

 37}

[simulation\_framework::evaluator::DistanceDrivenEvaluator::GetKpiType](classsimulation__framework_1_1evaluator_1_1DistanceDrivenEvaluator.xhtml#acc4088bba0acb50e544228f3ed1fa35a)

core::kpi::Type GetKpiType() const override

Retrieves the KPI type.

**Definition** [distance\_driven\_evaluator.cpp:39](distance__driven__evaluator_8cpp_source.xhtml#l00039)









<a id="acc4088bba0acb50e544228f3ed1fa35a" name="acc4088bba0acb50e544228f3ed1fa35a"></a>## [◆ ](#acc4088bba0acb50e544228f3ed1fa35a)GetKpiType()

 core::kpi::Type simulation\_framework::evaluator::DistanceDrivenEvaluator::GetKpiType  ( )  const  overridevirtual 

Retrieves the KPI type.

Indicates the type of KPI, which can be one of the following:

- `kpi::Type::kScalar`: A scalar value with a unit.
- `kpi::Type::kTimeSeries`: A time series representation.
- `kpi::Type::kLog`: A continuous log. ReturnsThe type of the KPI as a `kpi::Type` enum value.

Implements [simulation\_framework::core::kpi::IKpi&lt; osi3::GroundTruth &gt;](classsimulation__framework_1_1core_1_1kpi_1_1IKpi.xhtml#aeef163c532f5b7b03e685642cb75ccaa).

Definition at line [39](distance__driven__evaluator_8cpp_source.xhtml#l00039) of file [distance\_driven\_evaluator.cpp](distance__driven__evaluator_8cpp_source.xhtml).

 40{

 41 return core::kpi::Type::kScalar;

 42}







<a id="abfe81ec22fdea705cf8ed83d51f2f3eb" name="abfe81ec22fdea705cf8ed83d51f2f3eb"></a>## [◆ ](#abfe81ec22fdea705cf8ed83d51f2f3eb)Init()

 void simulation\_framework::evaluator::DistanceDrivenEvaluator::Init  ( )   overridevirtual 

Initializes the KPI logic.

Sets up any necessary state or resources required for KPI calculation.

Implements [simulation\_framework::core::kpi::IKpi&lt; osi3::GroundTruth &gt;](classsimulation__framework_1_1core_1_1kpi_1_1IKpi.xhtml#affa38e79e2d2fe57ac913fa736437fae).

Definition at line [15](distance__driven__evaluator_8cpp_source.xhtml#l00015) of file [distance\_driven\_evaluator.cpp](distance__driven__evaluator_8cpp_source.xhtml).

 15{}







<a id="a0ae35bde229b1db909a6331e8062d3ac" name="a0ae35bde229b1db909a6331e8062d3ac"></a>## [◆ ](#a0ae35bde229b1db909a6331e8062d3ac)Reset()

 void simulation\_framework::evaluator::DistanceDrivenEvaluator::Reset  ( )   overridevirtual 

Resets the KPI logic.

Clears temporary data and prepares the KPI logic for a new calculation, especially if the simulation needs to be restarted.

Implements [simulation\_framework::core::kpi::IKpi&lt; osi3::GroundTruth &gt;](classsimulation__framework_1_1core_1_1kpi_1_1IKpi.xhtml#ad08cdb1d1091c84920a9733a81c752a5).

Definition at line [17](distance__driven__evaluator_8cpp_source.xhtml#l00017) of file [distance\_driven\_evaluator.cpp](distance__driven__evaluator_8cpp_source.xhtml).

 18{

 19 driven_dist_ = 0.0;

 20}







---

The documentation for this class was generated from the following files:- [distance\_driven\_evaluator.h](distance__driven__evaluator_8h_source.xhtml)
- [distance\_driven\_evaluator.cpp](distance__driven__evaluator_8cpp_source.xhtml)