Skip to content

Commit

Permalink
Remove vehicle from VehicleDataCache when it reaches the end of its b…
Browse files Browse the repository at this point in the history
…lock and is made unpredictable
  • Loading branch information
nselikoff committed Apr 10, 2019
1 parent ad1727a commit 6c6e326
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,9 @@ private boolean handlePossibleEndOfBlock(VehicleState vehicleState) {
makeVehicleUnpredictableAndTerminateAssignment(vehicleState,
eventDescription, VehicleEvent.END_OF_BLOCK);

// Remove vehicle from VehicleDataCache
VehicleDataCache.getInstance().removeVehicle(vehicleState.getVehicleId());

// Return that end of block reached
return true;
}
Expand Down Expand Up @@ -1341,7 +1344,7 @@ private void determineAndSetRealTimeSchAdh(VehicleState vehicleState) {
// Determine the schedule adherence for the vehicle
TemporalDifference scheduleAdherence = RealTimeSchedAdhProcessor
.generate(vehicleState);


// Store the schedule adherence with the vehicle
vehicleState.setRealTimeSchedAdh(scheduleAdherence);
}
Expand Down

0 comments on commit 6c6e326

Please sign in to comment.