Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhoerl committed Feb 15, 2024
1 parent afe9070 commit 8448467
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,8 @@ void startEmpty_onlineRequest_beforeAlreadyPrebookedOtherRequest() {
Waypoint.Start start = new Waypoint.Start(null, link("start"), 0, 0);
Waypoint.Stop stop0 = stop(200, fromLink, 1);
Waypoint.Stop stop1 = stop(400, link("stop"), 0);
VehicleEntry entry = entry(start, stop0, stop1);
List<Double> precedingStayTimes = Arrays.asList(100.0, 0.0);
VehicleEntry entry = entry(start, precedingStayTimes, stop0, stop1);
assertInsertionsOnly(drtRequest, entry,
new Insertion(drtRequest, entry, 0, 0),
new Insertion(drtRequest, entry, 0, 1),
Expand Down Expand Up @@ -524,9 +525,13 @@ private Waypoint.Stop stop(double beginTime, Link link, int outgoingOccupancy) {
}

private VehicleEntry entry(Waypoint.Start start, Waypoint.Stop... stops) {
List<Double> precedingStayTimes = Collections.nCopies(stops.length, 0.0);
return entry(start, precedingStayTimes, stops);
}

private VehicleEntry entry(Waypoint.Start start, List<Double> precedingStayTimes, Waypoint.Stop... stops) {
var slackTimes = new double[stops.length + 2];
Arrays.fill(slackTimes, Double.POSITIVE_INFINITY);
List<Double> precedingStayTimes = Collections.nCopies(stops.length, 0.0);
return new VehicleEntry(vehicle, start, ImmutableList.copyOf(stops), slackTimes, precedingStayTimes, 0);
}
}

0 comments on commit 8448467

Please sign in to comment.