Skip to content

Commit 44cf990

Browse files
committed
seat capacity and idling duration
1 parent ff55af1 commit 44cf990

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

ridepy/util/analytics/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,8 @@ def get_system_quantities(
959959

960960
avg_segment_dist = stops["dist_to_next"].mean()
961961
avg_segment_time = stops["time_to_next"].mean()
962+
avg_segment_duration = stops["state_duration"].mean()
963+
avg_idle_duration = (stops["state_duration"] - stops["time_to_next"]).mean()
962964

963965
total_dist_driven = stops["dist_to_next"].sum()
964966
total_time_driven = stops["time_to_next"].sum()
@@ -1080,6 +1082,7 @@ def get_system_quantities(
10801082
velocity=velocity,
10811083
load_theoretical=(theoretical_request_rate * avg_direct_dist_submitted)
10821084
/ (velocity * n_vehicles),
1085+
seat_capacity=params.get("general", {}).get("seat_capacity", np.nan),
10831086
)
10841087

10851088
load_submitted = (avg_request_rate_submitted * avg_direct_dist_submitted) / (
@@ -1094,6 +1097,8 @@ def get_system_quantities(
10941097
n_vehicles_used=n_vehicles_used,
10951098
avg_segment_dist=avg_segment_dist,
10961099
avg_segment_time=avg_segment_time,
1100+
avg_segment_duration=avg_segment_duration,
1101+
avg_idle_duration=avg_idle_duration,
10971102
total_dist_driven=total_dist_driven,
10981103
total_time_driven=total_time_driven,
10991104
avg_direct_dist=avg_direct_dist_serviced,

ridepy/vehicle_state_cython/cvehicle_state.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ template <typename Loc> class VehicleState {
116116
}
117117
} else {
118118
// stoplist is empty, only CPE is there. set CPE time to current time
119+
// TODO differentiate between case where we have to update the CPE's
120+
// location (stoplist now empty after having serviced all stops) and
121+
// those where we don't have to (stoplist empty, but we haven't serviced
122+
// any new stops
119123
stoplist[0].estimated_arrival_time = t;
120124
}
121125
return event_cache;

0 commit comments

Comments
 (0)