    

 ## On this page

  

 

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

 Last update: 16.07.2025 

class [PredictiveMinTtcEvaluator](classsimulation__framework_1_1evaluator_1_1PredictiveMinTtcEvaluator.xhtml "class PredictiveMinTtcEvaluator") [More...](classsimulation__framework_1_1evaluator_1_1PredictiveMinTtcEvaluator.xhtml#details)

`#include <<a class="el" href="predictive__min__ttc__evaluator_8h_source.xhtml">predictive_min_ttc_evaluator.h</a>>`

Inheritance diagram for simulation_framework::evaluator::PredictiveMinTtcEvaluator:

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

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

Collaboration diagram for simulation_framework::evaluator::PredictiveMinTtcEvaluator:

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

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

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

 [PredictiveMinTtcEvaluator](classsimulation__framework_1_1evaluator_1_1PredictiveMinTtcEvaluator.xhtml#ad053b6beae6e2c424e89c268bc4c8941) (const std::string &amp;kpi\_name="predictive\_min\_ttc") void [Init](classsimulation__framework_1_1evaluator_1_1PredictiveMinTtcEvaluator.xhtml#aad25aefd4cb26ff9697c441d39de2deb) () override Initializes the KPI logic.   
 void [Reset](classsimulation__framework_1_1evaluator_1_1PredictiveMinTtcEvaluator.xhtml#a8f78acf7646d8476fdbbdc931fbc3ffe) () override Resets the KPI logic.   
 [core::kpi::KpiContent](structsimulation__framework_1_1core_1_1kpi_1_1KpiContent.xhtml) [CalculateKpi](classsimulation__framework_1_1evaluator_1_1PredictiveMinTtcEvaluator.xhtml#a8778dbbad77b21dec72930729a8f52a7) (const osi3::GroundTruth &amp;ground\_truth) override Executes the core KPI calculation logic.   
 core::kpi::Type [GetKpiType](classsimulation__framework_1_1evaluator_1_1PredictiveMinTtcEvaluator.xhtml#afa04796b1e66b16c1f33ee011530cb90) () 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 [PredictiveMinTtcEvaluator](classsimulation__framework_1_1evaluator_1_1PredictiveMinTtcEvaluator.xhtml "class PredictiveMinTtcEvaluator")

Definition of [PredictiveMinTtcEvaluator](classsimulation__framework_1_1evaluator_1_1PredictiveMinTtcEvaluator.xhtml "class PredictiveMinTtcEvaluator") class to calculate the minimum time to collision. This will store the lowest value of TTC being observed during one simulation run.

Definition at line [30](predictive__min__ttc__evaluator_8h_source.xhtml#l00030) of file [predictive\_min\_ttc\_evaluator.h](predictive__min__ttc__evaluator_8h_source.xhtml).



## Constructor &amp; Destructor Documentation

<a id="ad053b6beae6e2c424e89c268bc4c8941" name="ad053b6beae6e2c424e89c268bc4c8941"></a>## [◆ ](#ad053b6beae6e2c424e89c268bc4c8941)PredictiveMinTtcEvaluator()

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

Definition at line [11](predictive__min__ttc__evaluator_8cpp_source.xhtml#l00011) of file [predictive\_min\_ttc\_evaluator.cpp](predictive__min__ttc__evaluator_8cpp_source.xhtml).

 12 : min_ttc_(std::chrono::milliseconds::max()), kpi_name_(kpi_name)

 13{

 14}







## Member Function Documentation

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

 [core::kpi::KpiContent](structsimulation__framework_1_1core_1_1kpi_1_1KpiContent.xhtml) simulation\_framework::evaluator::PredictiveMinTtcEvaluator::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 [23](predictive__min__ttc__evaluator_8cpp_source.xhtml#l00023) of file [predictive\_min\_ttc\_evaluator.cpp](predictive__min__ttc__evaluator_8cpp_source.xhtml).

 24{

 25 core::kpi::KpiContent kpi_content;

 26 kpi_content.name = kpi_name_;

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

 28 kpi_content.type = [GetKpiType](classsimulation__framework_1_1evaluator_1_1PredictiveMinTtcEvaluator.xhtml#afa04796b1e66b16c1f33ee011530cb90)();

 29 kpi_content.unit = "ms";

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

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

 32 

 33 auto ttc = predictive_ttc_calculator_.Calculate(ground_truth);

 34 

 35 if (ttc &lt; min_ttc_)

 36 {

 37 min_ttc_ = ttc;

 38 }

 39 

 40 kpi_content.value = std::to_string(min_ttc_.count());

 41 

 42 return kpi_content;

 43}

[simulation\_framework::evaluator::PredictiveMinTtcEvaluator::GetKpiType](classsimulation__framework_1_1evaluator_1_1PredictiveMinTtcEvaluator.xhtml#afa04796b1e66b16c1f33ee011530cb90)

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

Retrieves the KPI type.

**Definition** [predictive\_min\_ttc\_evaluator.cpp:45](predictive__min__ttc__evaluator_8cpp_source.xhtml#l00045)









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

 core::kpi::Type simulation\_framework::evaluator::PredictiveMinTtcEvaluator::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 [45](predictive__min__ttc__evaluator_8cpp_source.xhtml#l00045) of file [predictive\_min\_ttc\_evaluator.cpp](predictive__min__ttc__evaluator_8cpp_source.xhtml).

 46{

 47 return core::kpi::Type::kScalar;

 48}







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

 void simulation\_framework::evaluator::PredictiveMinTtcEvaluator::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 [16](predictive__min__ttc__evaluator_8cpp_source.xhtml#l00016) of file [predictive\_min\_ttc\_evaluator.cpp](predictive__min__ttc__evaluator_8cpp_source.xhtml).

 16{}







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

 void simulation\_framework::evaluator::PredictiveMinTtcEvaluator::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 [18](predictive__min__ttc__evaluator_8cpp_source.xhtml#l00018) of file [predictive\_min\_ttc\_evaluator.cpp](predictive__min__ttc__evaluator_8cpp_source.xhtml).

 19{

 20 min_ttc_ = std::chrono::milliseconds::max();

 21}







---

The documentation for this class was generated from the following files:- [predictive\_min\_ttc\_evaluator.h](predictive__min__ttc__evaluator_8h_source.xhtml)
- [predictive\_min\_ttc\_evaluator.cpp](predictive__min__ttc__evaluator_8cpp_source.xhtml)