Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ff6a89a

Browse files
track separate trip counts
1 parent 99163ea commit ff6a89a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

modules/rt/include/motis/rt/statistics.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ struct statistics {
2525
c("track", s.track_change_msgs_);
2626
c("free text", s.free_text_msgs_);
2727

28+
o << "\nseparate trip:\n";
29+
c("edge fit", s.edge_fit_);
30+
c("trip fit", s.trip_fit_);
31+
c("edge fit | trip fit", s.edge_fit_or_trip_fit_);
32+
c("edge fit & trip fit", s.edge_fit_and_trip_fit_);
33+
c("total", s.total_);
34+
2835
o << "\nevs:\n";
2936
c("total", s.total_evs_);
3037
c("invalid time", s.ev_invalid_time_);
@@ -185,6 +192,12 @@ struct statistics {
185192
canceled_trp_not_found_) != 0;
186193
}
187194

195+
unsigned edge_fit_ = 0;
196+
unsigned trip_fit_ = 0;
197+
unsigned edge_fit_and_trip_fit_ = 0;
198+
unsigned edge_fit_or_trip_fit_ = 0;
199+
unsigned total_ = 0;
200+
188201
unsigned delay_msgs_ = 0;
189202
unsigned cancel_msgs_ = 0;
190203
unsigned additional_msgs_ = 0;

modules/rt/src/rt_handler.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,14 @@ void rt_handler::propagate() {
271271

272272
auto const edge_fit = fits_edge(k, t);
273273
auto const trip_fit = fits_trip(sched_, k, t);
274+
275+
stats_.edge_fit_ += !edge_fit ? 1 : 0;
276+
stats_.trip_fit_ += !trip_fit ? 1 : 0;
277+
stats_.edge_fit_and_trip_fit_ += (!edge_fit && !trip_fit) ? 1 : 0;
278+
++stats_.total_;
279+
274280
if (!edge_fit || !trip_fit) {
281+
stats_.edge_fit_or_trip_fit_ += (!edge_fit || !trip_fit) ? 1 : 0;
275282
auto const trp = sched_.merged_trips_[k.lcon()->trips_]->front();
276283
separate_trip(sched_, trp, update_builder_);
277284

0 commit comments

Comments
 (0)