private void setStartAndEnd(Vehicle vehicle, double vehicleDepTime) { if (!(vehicle instanceof VehicleImpl.NoVehicle)) { if (start == null && end == null) { start = new Start(vehicle.getStartLocation(), vehicle.getEarliestDeparture(), vehicle.getLatestArrival()); end = new End(vehicle.getEndLocation(), vehicle.getEarliestDeparture(), vehicle.getLatestArrival()); } start.setEndTime(Math.max(vehicleDepTime, vehicle.getEarliestDeparture())); start.setTheoreticalEarliestOperationStartTime(vehicle.getEarliestDeparture()); start.setTheoreticalLatestOperationStartTime(vehicle.getLatestArrival()); start.setLocation(vehicle.getStartLocation()); end.setLocation(vehicle.getEndLocation()); end.setTheoreticalEarliestOperationStartTime(vehicle.getEarliestDeparture()); end.setTheoreticalLatestOperationStartTime(vehicle.getLatestArrival()); } }
private void initialiseStartAndEnd(final Vehicle newVehicle, double newVehicleDepartureTime) { if (start == null) { start = new Start(newVehicle.getStartLocation(), newVehicle.getEarliestDeparture(), Double.MAX_VALUE); start.setEndTime(newVehicleDepartureTime); } else { start.setLocation(Location.newInstance(newVehicle.getStartLocation().getId())); start.setTheoreticalEarliestOperationStartTime(newVehicle.getEarliestDeparture()); start.setTheoreticalLatestOperationStartTime(Double.MAX_VALUE); start.setEndTime(newVehicleDepartureTime); } if (end == null) { end = new End(newVehicle.getEndLocation(), 0.0, newVehicle.getLatestArrival()); } else { end.setLocation(Location.newInstance(newVehicle.getEndLocation().getId())); end.setTheoreticalEarliestOperationStartTime(0.0); end.setTheoreticalLatestOperationStartTime(newVehicle.getLatestArrival()); } }
private void setStartAndEnd(Vehicle vehicle, double vehicleDepTime) { if (!(vehicle instanceof VehicleImpl.NoVehicle)) { if (start == null && end == null) { start = new Start(vehicle.getStartLocation(), vehicle.getEarliestDeparture(), vehicle.getLatestArrival()); end = new End(vehicle.getEndLocation(), vehicle.getEarliestDeparture(), vehicle.getLatestArrival()); } start.setEndTime(Math.max(vehicleDepTime, vehicle.getEarliestDeparture())); start.setTheoreticalEarliestOperationStartTime(vehicle.getEarliestDeparture()); start.setTheoreticalLatestOperationStartTime(vehicle.getLatestArrival()); start.setLocation(vehicle.getStartLocation()); end.setLocation(vehicle.getEndLocation()); end.setTheoreticalEarliestOperationStartTime(vehicle.getEarliestDeparture()); end.setTheoreticalLatestOperationStartTime(vehicle.getLatestArrival()); } }
private void initialiseStartAndEnd(final Vehicle newVehicle, double newVehicleDepartureTime) { if (start == null) { start = new Start(newVehicle.getStartLocation(), newVehicle.getEarliestDeparture(), Double.MAX_VALUE); start.setEndTime(newVehicleDepartureTime); } else { start.setLocation(Location.newInstance(newVehicle.getStartLocation().getId())); start.setTheoreticalEarliestOperationStartTime(newVehicle.getEarliestDeparture()); start.setTheoreticalLatestOperationStartTime(Double.MAX_VALUE); start.setEndTime(newVehicleDepartureTime); } if (end == null) { end = new End(newVehicle.getEndLocation(), 0.0, newVehicle.getLatestArrival()); } else { end.setLocation(Location.newInstance(newVehicle.getEndLocation().getId())); end.setTheoreticalEarliestOperationStartTime(0.0); end.setTheoreticalLatestOperationStartTime(newVehicle.getLatestArrival()); } }