From 8502a372f8e0416d99f437f6bab39f8fd4754917 Mon Sep 17 00:00:00 2001 From: Kai Martins-Turner Date: Thu, 21 Sep 2023 21:45:47 +0200 Subject: [PATCH] move cleanup of ShipmentPlans to other step. This fixes also the issue with the 0th iteration (empty ShipmentPlans). --- src/main/java/lsp/LSPControlerListener.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/main/java/lsp/LSPControlerListener.java b/src/main/java/lsp/LSPControlerListener.java index 901ac73d..2083d221 100644 --- a/src/main/java/lsp/LSPControlerListener.java +++ b/src/main/java/lsp/LSPControlerListener.java @@ -120,6 +120,7 @@ public void notifyReplanning(ReplanningEvent event) { strategyManager.run(lsps.getLSPs().values(), event.getIteration(), event.getReplanningContext()); for (LSP lsp : lsps.getLSPs().values()) { + lsp.getSelectedPlan().getShipmentPlans().clear(); //clear ShipmentPlans to start with clear(n) state. Otherwise, some times were accumulating over the time. :( lsp.scheduleLogisticChains(); } @@ -168,15 +169,6 @@ Carriers getCarriersFromLSP() { @Override public void notifyIterationStarts(IterationStartsEvent event) { - //clear ShipmentPlans - var lsps = LSPUtils.getLSPs(scenario); - for (LSP lsp : lsps.getLSPs().values()) { - lsp.getSelectedPlan().getShipmentPlans().clear(); -// //clearing all seems to be wrong, because we want to keep them. -// for (LSPPlan lspPlan : lsp.getPlans()) { -// lspPlan.getShipmentPlans().clear(); -// } - } } @Override