From 1f901f0fe7f41a68a3644b276d3dca027db9347a Mon Sep 17 00:00:00 2001 From: Kai Martins-Turner Date: Wed, 14 Aug 2024 13:59:43 +0200 Subject: [PATCH] remove unused var from method signature --- .../CollectionCarrierScheduler.java | 5 ++--- .../DistributionCarrierScheduler.java | 12 ++++-------- .../MainRunCarrierScheduler.java | 13 +++++-------- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/src/main/java/org/matsim/freight/logistics/resourceImplementations/CollectionCarrierScheduler.java b/src/main/java/org/matsim/freight/logistics/resourceImplementations/CollectionCarrierScheduler.java index abc6c317..4d8c35b3 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/CollectionCarrierScheduler.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/CollectionCarrierScheduler.java @@ -107,7 +107,7 @@ protected void updateShipments() { && pair.carrierService.getId() == carrierPair.carrierService.getId()) { addShipmentLoadElement(lspShipment, tour, serviceActivity); addShipmentTransportElement(lspShipment, tour, serviceActivity); - addShipmentUnloadElement(lspShipment, tour, serviceActivity); + addShipmentUnloadElement(lspShipment, tour); addCollectionTourEndEventHandler(pair.carrierService, lspShipment, resource, tour); addCollectionServiceEventHandler(pair.carrierService, lspShipment, resource); } @@ -211,8 +211,7 @@ private void addCollectionTourEndEventHandler( } } - private void addShipmentUnloadElement( - LspShipment lspShipment, Tour tour, Tour.ServiceActivity serviceActivity) { + private void addShipmentUnloadElement(LspShipment lspShipment, Tour tour) { LspShipmentUtils.ScheduledShipmentUnloadBuilder builder = LspShipmentUtils.ScheduledShipmentUnloadBuilder.newInstance(); diff --git a/src/main/java/org/matsim/freight/logistics/resourceImplementations/DistributionCarrierScheduler.java b/src/main/java/org/matsim/freight/logistics/resourceImplementations/DistributionCarrierScheduler.java index b78da4e1..ad42d7d2 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/DistributionCarrierScheduler.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/DistributionCarrierScheduler.java @@ -193,7 +193,7 @@ protected void updateShipments() { for (LSPCarrierPair pair : pairs) { if (pair.lspShipment == carrierPair.lspShipment && pair.carrierService.getId() == carrierPair.carrierService.getId()) { - addShipmentLoadElement(lspShipment, tour, serviceActivity); + addShipmentLoadElement(lspShipment, tour); addShipmentTransportElement(lspShipment, tour, serviceActivity); addShipmentUnloadElement(lspShipment, tour, serviceActivity); addDistributionTourStartEventHandler(pair.carrierService, lspShipment, resource, tour); @@ -206,9 +206,7 @@ protected void updateShipments() { } } - private void addShipmentLoadElement( - LspShipment lspShipment, Tour tour, Tour.ServiceActivity serviceActivity) { - + private void addShipmentLoadElement(LspShipment lspShipment, Tour tour) { LspShipmentUtils.ScheduledShipmentLoadBuilder builder = LspShipmentUtils.ScheduledShipmentLoadBuilder.newInstance(); builder.setResourceId(resource.getId()); @@ -219,8 +217,7 @@ private void addShipmentLoadElement( } } - int startIndex = - tour.getTourElements().indexOf(tour.getTourElements().indexOf(tour.getStart())); + int startIndex = tour.getTourElements().indexOf(tour.getTourElements().indexOf(tour.getStart())); Leg legAfterStart = (Leg) tour.getTourElements().get(startIndex + 1); double startTimeOfTransport = legAfterStart.getExpectedDepartureTime(); double cumulatedLoadingTime = 0; @@ -253,8 +250,7 @@ private void addShipmentTransportElement( } } - int startIndex = - tour.getTourElements().indexOf(tour.getTourElements().indexOf(tour.getStart())); + int startIndex = tour.getTourElements().indexOf(tour.getTourElements().indexOf(tour.getStart())); final Leg legAfterStart = (Leg) tour.getTourElements().get(startIndex + 1); final int serviceIndex = tour.getTourElements().indexOf(serviceActivity); final Leg legBeforeService = (Leg) tour.getTourElements().get(serviceIndex - 1); diff --git a/src/main/java/org/matsim/freight/logistics/resourceImplementations/MainRunCarrierScheduler.java b/src/main/java/org/matsim/freight/logistics/resourceImplementations/MainRunCarrierScheduler.java index 54bc52b4..33f47487 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/MainRunCarrierScheduler.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/MainRunCarrierScheduler.java @@ -248,7 +248,7 @@ protected void updateShipments() { && pair.carrierService.getId() == carrierPair.carrierService.getId()) { addShipmentLoadElement(LspShipment, tour); addShipmentTransportElement(LspShipment, tour, serviceActivity); - addShipmentUnloadElement(LspShipment, tour, serviceActivity); + addShipmentUnloadElement(LspShipment, tour); addMainTourRunStartEventHandler(pair.carrierService, LspShipment, resource, tour); addMainRunTourEndEventHandler(pair.carrierService, LspShipment, resource, tour); } @@ -268,8 +268,7 @@ private void addShipmentLoadElement(LspShipment lspShipment, Tour tour) { builder.setLogisticChainElement(element); } } - int startIndex = - tour.getTourElements().indexOf(tour.getTourElements().indexOf(tour.getStart())); + int startIndex = tour.getTourElements().indexOf(tour.getTourElements().indexOf(tour.getStart())); Leg legAfterStart = (Leg) tour.getTourElements().get(startIndex + 1); double startTimeOfTransport = legAfterStart.getExpectedDepartureTime(); double cumulatedLoadingTime = 0; @@ -300,8 +299,7 @@ private void addShipmentTransportElement(LspShipment lspShipment, Tour tour, Tou builder.setLogisticChainElement(element); } } - int startIndex = - tour.getTourElements().indexOf(tour.getTourElements().indexOf(tour.getStart())); + int startIndex = tour.getTourElements().indexOf(tour.getTourElements().indexOf(tour.getStart())); Leg legAfterStart = (Leg) tour.getTourElements().get(startIndex + 1); double startTimeOfTransport = legAfterStart.getExpectedDepartureTime(); builder.setStartTime(startTimeOfTransport); @@ -320,7 +318,7 @@ private void addShipmentTransportElement(LspShipment lspShipment, Tour tour, Tou .addPlanElement(id, transport); } - private void addShipmentUnloadElement(LspShipment lspShipment, Tour tour, Tour.ServiceActivity serviceActivity) { + private void addShipmentUnloadElement(LspShipment lspShipment, Tour tour) { LspShipmentUtils.ScheduledShipmentUnloadBuilder builder = LspShipmentUtils.ScheduledShipmentUnloadBuilder.newInstance(); builder.setResourceId(resource.getId()); @@ -335,8 +333,7 @@ private void addShipmentUnloadElement(LspShipment lspShipment, Tour tour, Tour.S cumulatedLoadingTime = cumulatedLoadingTime + activity.getDuration(); } } - int startIndex = - tour.getTourElements().indexOf(tour.getTourElements().indexOf(tour.getStart())); + int startIndex = tour.getTourElements().indexOf(tour.getTourElements().indexOf(tour.getStart())); Leg legAfterStart = (Leg) tour.getTourElements().get(startIndex + 1); builder.setStartTime( legAfterStart.getExpectedDepartureTime() + legAfterStart.getExpectedTransportTime());