Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
move cleanup of ShipmentPlans to other step. This fixes also the issu…
Browse files Browse the repository at this point in the history
…e with the 0th iteration (empty ShipmentPlans).
  • Loading branch information
kt86 committed Sep 21, 2023
1 parent abff436 commit 8502a37
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/main/java/lsp/LSPControlerListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8502a37

Please sign in to comment.