Skip to content

Commit

Permalink
added new finished and aborted summary in console output
Browse files Browse the repository at this point in the history
  • Loading branch information
addy90 committed Dec 8, 2024
1 parent 98d9d36 commit 746e549
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/library/include/io/results/match/match_output_printer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace map_matching_2::io::results {
}

protected:
std::size_t _track_points{}, _prepared_points{}, _candidates{}, _combinations{};
std::size_t _aborted{}, _track_points{}, _prepared_points{}, _candidates{}, _combinations{};

[[nodiscard]] std::string parse_task(task_type &&task) {
if (this->is_active()) {
Expand All @@ -83,6 +83,10 @@ namespace map_matching_2::io::results {
_candidates += task.edges;
_combinations += task.combinations;

if (task.aborted) {
++_aborted;
}

return std::format(
"Match {} with id '{}' {} {:.3f} s, "
"track points: {}, prepared points: {}, candidates: {}, combinations: {}",
Expand All @@ -96,11 +100,12 @@ namespace map_matching_2::io::results {
[[nodiscard]] std::string parse_aggregated_result() {
if (this->is_active()) {
if (this->_counter > 0) {
_aborted = _aborted > this->_counter ? this->_counter : _aborted;
return std::format(
"Matches count: {}, total duration: {:.3f} s, "
"Matches count: {}, finished: {}, aborted: {}, total duration: {:.3f} s, "
"tracks points: {}, prepared points: {}, candidates: {}, combinations: {}",
this->_counter, this->_duration, _track_points, _prepared_points,
_candidates, _combinations);
this->_counter, this->_counter - _aborted, _aborted, this->_duration,
_track_points, _prepared_points, _candidates, _combinations);
}
}
return "";
Expand Down

0 comments on commit 746e549

Please sign in to comment.