Skip to content

Commit

Permalink
Merge pull request #39 from ibi-group/car-and-vehicle-rental-back-mod…
Browse files Browse the repository at this point in the history
…e-fix

Properly set the backMode after car and vehicle rentals are ended
  • Loading branch information
landonreed authored Jun 12, 2020
2 parents 56f5e08 + e934e2c commit db49742
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ public class StateData implements Cloneable {

protected ServiceDay serviceDay;

/**
* The mode of transit to use when not traveling on transit. This should be updated each time transitions happen to
* other modes such as during parking a car at a park and ride or dropping off a bike rental.
*/
protected TraverseMode nonTransitMode;

/**
Expand All @@ -93,7 +97,7 @@ public class StateData implements Cloneable {
protected int lastNextArrivalDelta;

/**
* The mode that was used to traverse the backEdge
* The mode that was used to traverse the state's backEdge
*/
protected TraverseMode backMode;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@ public void boardHailedCar(double initialEdgeDistance) {
public void endCarRenting() {
cloneStateDataAsNeeded();
child.stateData.usingRentedCar = false;
child.stateData.backMode = TraverseMode.WALK;
child.stateData.nonTransitMode = TraverseMode.WALK;
}

Expand Down Expand Up @@ -636,6 +637,7 @@ public void addRentedCar(String carId) {
public void endVehicleRenting() {
cloneStateDataAsNeeded();
child.stateData.usingRentedVehicle = false;
child.stateData.backMode = TraverseMode.WALK;
child.stateData.nonTransitMode = TraverseMode.WALK;
}

Expand Down

0 comments on commit db49742

Please sign in to comment.