Skip to content

Commit

Permalink
update handling of occupany analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhoerl committed Nov 11, 2023
1 parent d139575 commit 9d4e210
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
*/
public class DrtModeAnalysisModule extends AbstractDvrpModeModule {
private final DrtConfigGroup drtCfg;
private ImmutableSet<Task.TaskType> passengerServingTaskTypes = ImmutableSet.of(DrtDriveTask.TYPE, DefaultDrtStopTask.TYPE, DrtStayTask.TYPE);
private ImmutableSet<Task.TaskType> passengerServingTaskTypes = ImmutableSet.of(DrtDriveTask.TYPE, DefaultDrtStopTask.TYPE);

private static final Comparator<Task.TaskType> taskTypeComparator = Comparator.comparing(type -> {
//we want the following order on the plot: STAY, RELOCATE, other
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,7 @@ private void increment(VehicleState state, double endTime) {
Verify.verify(state.occupancy >= 0);
Verify.verify(state.occupancy <= maxCapacity);

boolean servingPassengers = passengerServingTaskTypes.contains(state.taskType);
Verify.verify(servingPassengers || state.occupancy == 0,
"Vehicles not serving passengers must not be occupied");
boolean servingPassengers = passengerServingTaskTypes.contains(state.taskType) || state.occupancy > 0;

double[] profile = servingPassengers ?
vehicleOccupancyProfiles.get(state.occupancy) :
Expand Down

0 comments on commit 9d4e210

Please sign in to comment.