Skip to main content

AVxcelerate Simulation Framework 2025 R2 SP02

simulation_framework::evaluator::MinTtcEvaluator Class Reference

Last update: 19.09.2025

class MinTtcEvaluator More...

#include <min_ttc_evaluator.h>

Inheritance diagram for simulation_framework::evaluator::MinTtcEvaluator:
Collaboration diagram for simulation_framework::evaluator::MinTtcEvaluator:

Public Member Functions

 MinTtcEvaluator (const std::string &kpi_name="min_ttc")
 
void Init () override
 Initializes the KPI logic.
 
void Reset () override
 Resets the KPI logic.
 
core::kpi::KpiContent CalculateKpi (const osi3::GroundTruth &ground_truth) override
 Executes the core KPI calculation logic.
 
core::kpi::Type GetKpiType () const override
 Retrieves the KPI type.
 
- Public Member Functions inherited from simulation_framework::core::kpi::IKpi< osi3::GroundTruth >
virtual ~IKpi ()=default
 Virtual destructor for proper cleanup of derived classes.
 

Detailed Description

class MinTtcEvaluator

Definition of MinTtcEvaluator 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 32 of file min_ttc_evaluator.h.

Constructor & Destructor Documentation

◆ MinTtcEvaluator()

simulation_framework::evaluator::MinTtcEvaluator::MinTtcEvaluator ( const std::string &  kpi_name = "min_ttc")

Definition at line 20 of file min_ttc_evaluator.cpp.

21 : min_ttc_(std::chrono::milliseconds::max()), kpi_name_(kpi_name)
22{
23}

Member Function Documentation

◆ CalculateKpi()

core::kpi::KpiContent simulation_framework::evaluator::MinTtcEvaluator::CalculateKpi ( const osi3::GroundTruth &  input)
overridevirtual

Executes the core KPI calculation logic.

Parameters
inputThe input data required for KPI calculation.
Returns
The calculated KPI content as a KpiContent object.

Implements simulation_framework::core::kpi::IKpi< osi3::GroundTruth >.

Definition at line 32 of file min_ttc_evaluator.cpp.

33{
34 core::kpi::KpiContent kpi_content;
35 kpi_content.name = kpi_name_;
36 kpi_content.data_type = core::kpi::Datatype::Value::kDouble;
37 kpi_content.type = GetKpiType();
38 kpi_content.unit = "ms";
39 kpi_content.timestamp.seconds = ground_truth.timestamp().seconds();
40 kpi_content.timestamp.nanoseconds = ground_truth.timestamp().nanos();
41
42 const auto ttc = ttc_calculator_.Calculate(ground_truth);
43
44 if (ttc < min_ttc_)
45 {
46 min_ttc_ = ttc;
47 }
48
49 kpi_content.value = std::to_string(min_ttc_.count());
50
51 return kpi_content;
52}
core::kpi::Type GetKpiType() const override
Retrieves the KPI type.

◆ GetKpiType()

core::kpi::Type simulation_framework::evaluator::MinTtcEvaluator::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.
    Returns
    The type of the KPI as a kpi::Type enum value.

Implements simulation_framework::core::kpi::IKpi< osi3::GroundTruth >.

Definition at line 54 of file min_ttc_evaluator.cpp.

55{
56 return core::kpi::Type::kScalar;
57}

◆ Init()

void simulation_framework::evaluator::MinTtcEvaluator::Init ( )
overridevirtual

Initializes the KPI logic.

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

Implements simulation_framework::core::kpi::IKpi< osi3::GroundTruth >.

Definition at line 25 of file min_ttc_evaluator.cpp.

25{}

◆ Reset()

void simulation_framework::evaluator::MinTtcEvaluator::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< osi3::GroundTruth >.

Definition at line 27 of file min_ttc_evaluator.cpp.

28{
29 min_ttc_ = std::chrono::milliseconds::max();
30}

The documentation for this class was generated from the following files:

Connect with Ansys