Skip to main content

AVxcelerate Simulation Framework 2025 R2 SP02

simulation_framework::evaluator::DistanceDrivenEvaluator Class Reference

Last update: 19.09.2025

class DistanceDrivenEvaluator More...

#include <distance_driven_evaluator.h>

Inheritance diagram for simulation_framework::evaluator::DistanceDrivenEvaluator:
Collaboration diagram for simulation_framework::evaluator::DistanceDrivenEvaluator:

Public Member Functions

 DistanceDrivenEvaluator (const std::string &kpi_name="driven_dist")
 
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 DistanceDrivenEvaluator

Definition of 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 of file distance_driven_evaluator.h.

Constructor & Destructor Documentation

◆ DistanceDrivenEvaluator()

simulation_framework::evaluator::DistanceDrivenEvaluator::DistanceDrivenEvaluator ( const std::string &  kpi_name = "driven_dist")

Definition at line 11 of file distance_driven_evaluator.cpp.

11 : driven_dist_(0.0), kpi_name_(kpi_name)
12{
13}

Member Function Documentation

◆ CalculateKpi()

core::kpi::KpiContent simulation_framework::evaluator::DistanceDrivenEvaluator::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 22 of file distance_driven_evaluator.cpp.

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();
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}
core::kpi::Type GetKpiType() const override
Retrieves the KPI type.

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

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

Definition at line 39 of file distance_driven_evaluator.cpp.

40{
41 return core::kpi::Type::kScalar;
42}

◆ 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< osi3::GroundTruth >.

Definition at line 15 of file distance_driven_evaluator.cpp.

15{}

◆ 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< osi3::GroundTruth >.

Definition at line 17 of file distance_driven_evaluator.cpp.

18{
19 driven_dist_ = 0.0;
20}

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

Connect with Ansys