diff --git a/pom.xml b/pom.xml index 7527ef07..eb383983 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ org.matsim matsim-all - 16.0-PR2857 + 16.0-2023w46 diff --git a/src/main/java/org/matsim/freight/logistics/example/lsp/initialPlans/ExampleSchedulingOfTransportChainHubsVsDirect.java b/src/main/java/org/matsim/freight/logistics/example/lsp/initialPlans/ExampleSchedulingOfTransportChainHubsVsDirect.java index 34bea242..83ae1543 100644 --- a/src/main/java/org/matsim/freight/logistics/example/lsp/initialPlans/ExampleSchedulingOfTransportChainHubsVsDirect.java +++ b/src/main/java/org/matsim/freight/logistics/example/lsp/initialPlans/ExampleSchedulingOfTransportChainHubsVsDirect.java @@ -50,8 +50,8 @@ import org.matsim.freight.carriers.controler.CarrierStrategyManager; import org.matsim.freight.carriers.events.CarrierServiceEndEvent; import org.matsim.freight.carriers.events.CarrierTourEndEvent; -import org.matsim.freight.carriers.events.eventhandler.FreightServiceEndEventHandler; -import org.matsim.freight.carriers.events.eventhandler.FreightTourEndEventHandler; +import org.matsim.freight.carriers.events.eventhandler.CarrierServiceEndEventHandler; +import org.matsim.freight.carriers.events.eventhandler.CarrierTourEndEventHandler; import org.matsim.vehicles.VehicleType; import java.util.*; @@ -511,7 +511,7 @@ private static Collection createInitialLSPShipments(Network network enum SolutionType {onePlan_withHub, onePlan_direct, twoPlans_directAndHub} - private static class MyLSPScorer implements LSPScorer, FreightTourEndEventHandler, FreightServiceEndEventHandler { + private static class MyLSPScorer implements LSPScorer, CarrierTourEndEventHandler, CarrierServiceEndEventHandler { private double score = 0.; @Override diff --git a/src/main/java/org/matsim/freight/logistics/example/lsp/lspScoring/ExampleLSPScoring.java b/src/main/java/org/matsim/freight/logistics/example/lsp/lspScoring/ExampleLSPScoring.java index 0ed9e151..84dd4dfd 100644 --- a/src/main/java/org/matsim/freight/logistics/example/lsp/lspScoring/ExampleLSPScoring.java +++ b/src/main/java/org/matsim/freight/logistics/example/lsp/lspScoring/ExampleLSPScoring.java @@ -41,7 +41,7 @@ import org.matsim.freight.carriers.*; import org.matsim.freight.carriers.CarrierCapabilities.FleetSize; import org.matsim.freight.carriers.events.CarrierServiceEndEvent; -import org.matsim.freight.carriers.events.eventhandler.FreightServiceEndEventHandler; +import org.matsim.freight.carriers.events.eventhandler.CarrierServiceEndEventHandler; import org.matsim.vehicles.VehicleType; import java.util.*; @@ -208,7 +208,7 @@ static Config prepareConfig() { } - /*package-private*/ static class TipScorer implements LSPScorer, LSPSimulationTracker, FreightServiceEndEventHandler { + /*package-private*/ static class TipScorer implements LSPScorer, LSPSimulationTracker, CarrierServiceEndEventHandler { private static final Logger log = LogManager.getLogger(TipScorer.class); diff --git a/src/main/java/org/matsim/freight/logistics/example/lsp/simulationTrackers/CollectionServiceHandler.java b/src/main/java/org/matsim/freight/logistics/example/lsp/simulationTrackers/CollectionServiceHandler.java index 7386c203..cbb3a863 100644 --- a/src/main/java/org/matsim/freight/logistics/example/lsp/simulationTrackers/CollectionServiceHandler.java +++ b/src/main/java/org/matsim/freight/logistics/example/lsp/simulationTrackers/CollectionServiceHandler.java @@ -25,8 +25,8 @@ import org.matsim.freight.carriers.CarrierService; import org.matsim.freight.carriers.events.CarrierServiceEndEvent; import org.matsim.freight.carriers.events.CarrierServiceStartEvent; -import org.matsim.freight.carriers.events.eventhandler.FreightServiceEndEventHandler; -import org.matsim.freight.carriers.events.eventhandler.FreightServiceStartEventHandler; +import org.matsim.freight.carriers.events.eventhandler.CarrierServiceEndEventHandler; +import org.matsim.freight.carriers.events.eventhandler.CarrierServiceStartEventHandler; import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.VehicleUtils; import org.matsim.vehicles.Vehicles; @@ -35,7 +35,7 @@ import java.util.Collection; -/*package-private*/ class CollectionServiceHandler implements FreightServiceStartEventHandler, FreightServiceEndEventHandler { +/*package-private*/ class CollectionServiceHandler implements CarrierServiceStartEventHandler, CarrierServiceEndEventHandler { private final Collection tuples; private final Vehicles allVehicles; diff --git a/src/main/java/org/matsim/freight/logistics/example/lsp/simulationTrackers/LinearCostTracker.java b/src/main/java/org/matsim/freight/logistics/example/lsp/simulationTrackers/LinearCostTracker.java index 7b577dbb..de349726 100644 --- a/src/main/java/org/matsim/freight/logistics/example/lsp/simulationTrackers/LinearCostTracker.java +++ b/src/main/java/org/matsim/freight/logistics/example/lsp/simulationTrackers/LinearCostTracker.java @@ -35,9 +35,9 @@ import org.matsim.freight.carriers.events.CarrierServiceEndEvent; import org.matsim.freight.carriers.events.CarrierServiceStartEvent; import org.matsim.freight.carriers.events.CarrierTourStartEvent; -import org.matsim.freight.carriers.events.eventhandler.FreightServiceEndEventHandler; -import org.matsim.freight.carriers.events.eventhandler.FreightServiceStartEventHandler; -import org.matsim.freight.carriers.events.eventhandler.FreightTourStartEventHandler; +import org.matsim.freight.carriers.events.eventhandler.CarrierServiceEndEventHandler; +import org.matsim.freight.carriers.events.eventhandler.CarrierServiceStartEventHandler; +import org.matsim.freight.carriers.events.eventhandler.CarrierTourStartEventHandler; import java.util.ArrayList; import java.util.Collection; @@ -45,9 +45,9 @@ /*package-private*/ class LinearCostTracker implements AfterMobsimListener, LSPSimulationTracker, LinkEnterEventHandler, VehicleLeavesTrafficEventHandler, - FreightTourStartEventHandler, - FreightServiceStartEventHandler, - FreightServiceEndEventHandler, + CarrierTourStartEventHandler, + CarrierServiceStartEventHandler, + CarrierServiceEndEventHandler, LinkLeaveEventHandler { private final Collection eventHandlers; @@ -155,22 +155,22 @@ public void reset(int iteration) { } @Override public void handleEvent( CarrierTourStartEvent event ){ for( EventHandler eventHandler : this.eventHandlers ){ - if ( eventHandler instanceof FreightTourStartEventHandler) { - ((FreightTourStartEventHandler) eventHandler).handleEvent( event ); + if ( eventHandler instanceof CarrierTourStartEventHandler) { + ((CarrierTourStartEventHandler) eventHandler).handleEvent( event ); } } } @Override public void handleEvent( CarrierServiceEndEvent event ){ for( EventHandler eventHandler : this.eventHandlers ){ - if ( eventHandler instanceof FreightServiceEndEventHandler) { - ((FreightServiceEndEventHandler) eventHandler).handleEvent( event ); + if ( eventHandler instanceof CarrierServiceEndEventHandler) { + ((CarrierServiceEndEventHandler) eventHandler).handleEvent( event ); } } } @Override public void handleEvent( CarrierServiceStartEvent event ){ for( EventHandler eventHandler : this.eventHandlers ){ - if ( eventHandler instanceof FreightServiceStartEventHandler) { - ((FreightServiceStartEventHandler) eventHandler).handleEvent( event ); + if ( eventHandler instanceof CarrierServiceStartEventHandler) { + ((CarrierServiceStartEventHandler) eventHandler).handleEvent( event ); } } } diff --git a/src/main/java/org/matsim/freight/logistics/example/lsp/simulationTrackers/TourStartHandler.java b/src/main/java/org/matsim/freight/logistics/example/lsp/simulationTrackers/TourStartHandler.java index b200d57c..a1bf006c 100644 --- a/src/main/java/org/matsim/freight/logistics/example/lsp/simulationTrackers/TourStartHandler.java +++ b/src/main/java/org/matsim/freight/logistics/example/lsp/simulationTrackers/TourStartHandler.java @@ -25,11 +25,11 @@ import org.matsim.api.core.v01.Scenario; import org.matsim.freight.carriers.*; import org.matsim.freight.carriers.events.CarrierTourStartEvent; -import org.matsim.freight.carriers.events.eventhandler.FreightTourStartEventHandler; +import org.matsim.freight.carriers.events.eventhandler.CarrierTourStartEventHandler; import java.util.Collection; -/*package-private*/ class TourStartHandler implements FreightTourStartEventHandler { +/*package-private*/ class TourStartHandler implements CarrierTourStartEventHandler { private static final Logger log = LogManager.getLogger(TourStartHandler.class); private final Carriers carriers; diff --git a/src/main/java/org/matsim/freight/logistics/io/LSPPlanXmlWriter.java b/src/main/java/org/matsim/freight/logistics/io/LSPPlanXmlWriter.java index 4ba079e6..1fe08d18 100644 --- a/src/main/java/org/matsim/freight/logistics/io/LSPPlanXmlWriter.java +++ b/src/main/java/org/matsim/freight/logistics/io/LSPPlanXmlWriter.java @@ -20,18 +20,18 @@ package org.matsim.freight.logistics.io; -import org.matsim.freight.logistics.*; -import org.matsim.freight.logistics.resourceImplementations.transshipmentHub.TransshipmentHubResource; -import org.matsim.freight.logistics.shipment.LSPShipment; -import org.matsim.freight.logistics.shipment.ShipmentPlanElement; -import org.matsim.freight.logistics.shipment.ShipmentUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; import org.matsim.core.gbl.Gbl; import org.matsim.core.utils.collections.Tuple; import org.matsim.core.utils.io.MatsimXmlWriter; -import org.matsim.core.utils.io.UncheckedIOException; +import org.matsim.freight.logistics.LSP; +import org.matsim.freight.logistics.*; +import org.matsim.freight.logistics.resourceImplementations.transshipmentHub.TransshipmentHubResource; +import org.matsim.freight.logistics.shipment.LSPShipment; +import org.matsim.freight.logistics.shipment.ShipmentPlanElement; +import org.matsim.freight.logistics.shipment.ShipmentUtils; import java.io.BufferedWriter; import java.io.IOException; @@ -84,7 +84,7 @@ public void write(String filename) { } } - private void writeRootElement() throws UncheckedIOException, IOException { + private void writeRootElement() throws IOException { List> atts = new ArrayList>(); atts.add(createTuple(XMLNS, MatsimXmlWriter.MATSIM_NAMESPACE)); atts.add(createTuple(XMLNS + ":xsi", DEFAULTSCHEMANAMESPACELOCATION)); diff --git a/src/main/java/org/matsim/freight/logistics/resourceImplementations/collectionCarrier/CollectionServiceEndEventHandler.java b/src/main/java/org/matsim/freight/logistics/resourceImplementations/collectionCarrier/CollectionServiceEndEventHandler.java index d8af8f3b..af9e392e 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/collectionCarrier/CollectionServiceEndEventHandler.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/collectionCarrier/CollectionServiceEndEventHandler.java @@ -33,9 +33,9 @@ import org.matsim.core.controler.listener.AfterMobsimListener; import org.matsim.freight.carriers.CarrierService; import org.matsim.freight.carriers.events.CarrierServiceEndEvent; -import org.matsim.freight.carriers.events.eventhandler.FreightServiceEndEventHandler; +import org.matsim.freight.carriers.events.eventhandler.CarrierServiceEndEventHandler; -public class CollectionServiceEndEventHandler implements AfterMobsimListener, FreightServiceEndEventHandler, LSPSimulationTracker { +public class CollectionServiceEndEventHandler implements AfterMobsimListener, CarrierServiceEndEventHandler, LSPSimulationTracker { // Todo: I have made it (temporarily) public because of junit tests :( -- need to find another way to do the junit testing. kmt jun'23 private final CarrierService carrierService; diff --git a/src/main/java/org/matsim/freight/logistics/resourceImplementations/collectionCarrier/CollectionTourEndEventHandler.java b/src/main/java/org/matsim/freight/logistics/resourceImplementations/collectionCarrier/CollectionTourEndEventHandler.java index fdf06b68..32a40366 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/collectionCarrier/CollectionTourEndEventHandler.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/collectionCarrier/CollectionTourEndEventHandler.java @@ -36,9 +36,9 @@ import org.matsim.freight.carriers.Tour.ServiceActivity; import org.matsim.freight.carriers.Tour.TourElement; import org.matsim.freight.carriers.events.CarrierTourEndEvent; -import org.matsim.freight.carriers.events.eventhandler.FreightTourEndEventHandler; +import org.matsim.freight.carriers.events.eventhandler.CarrierTourEndEventHandler; -public class CollectionTourEndEventHandler implements AfterMobsimListener, FreightTourEndEventHandler, LSPSimulationTracker { +public class CollectionTourEndEventHandler implements AfterMobsimListener, CarrierTourEndEventHandler, LSPSimulationTracker { // Todo: I have made it (temporarily) public because of junit tests :( -- need to find another way to do the junit testing. kmt jun'23 private final CarrierService carrierService; diff --git a/src/main/java/org/matsim/freight/logistics/resourceImplementations/distributionCarrier/DistributionServiceStartEventHandler.java b/src/main/java/org/matsim/freight/logistics/resourceImplementations/distributionCarrier/DistributionServiceStartEventHandler.java index ee447d3f..799d53f2 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/distributionCarrier/DistributionServiceStartEventHandler.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/distributionCarrier/DistributionServiceStartEventHandler.java @@ -32,9 +32,9 @@ import org.matsim.core.controler.listener.AfterMobsimListener; import org.matsim.freight.carriers.CarrierService; import org.matsim.freight.carriers.events.CarrierServiceStartEvent; -import org.matsim.freight.carriers.events.eventhandler.FreightServiceStartEventHandler; +import org.matsim.freight.carriers.events.eventhandler.CarrierServiceStartEventHandler; -public class DistributionServiceStartEventHandler implements AfterMobsimListener, FreightServiceStartEventHandler, LSPSimulationTracker { +public class DistributionServiceStartEventHandler implements AfterMobsimListener, CarrierServiceStartEventHandler, LSPSimulationTracker { // Todo: I have made it (temporarily) public because of junit tests :( -- need to find another way to do the junit testing. kmt jun'23 private final CarrierService carrierService; diff --git a/src/main/java/org/matsim/freight/logistics/resourceImplementations/distributionCarrier/DistributionTourStartEventHandler.java b/src/main/java/org/matsim/freight/logistics/resourceImplementations/distributionCarrier/DistributionTourStartEventHandler.java index 5bfdf005..943606b3 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/distributionCarrier/DistributionTourStartEventHandler.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/distributionCarrier/DistributionTourStartEventHandler.java @@ -32,9 +32,9 @@ import org.matsim.freight.carriers.Tour.ServiceActivity; import org.matsim.freight.carriers.Tour.TourElement; import org.matsim.freight.carriers.events.CarrierTourStartEvent; -import org.matsim.freight.carriers.events.eventhandler.FreightTourStartEventHandler; +import org.matsim.freight.carriers.events.eventhandler.CarrierTourStartEventHandler; -public class DistributionTourStartEventHandler implements FreightTourStartEventHandler, LSPSimulationTracker { +public class DistributionTourStartEventHandler implements CarrierTourStartEventHandler, LSPSimulationTracker { // Todo: I have made it (temporarily) public because of junit tests :( -- need to find another way to do the junit testing. kmt jun'23 private final CarrierService carrierService; diff --git a/src/main/java/org/matsim/freight/logistics/resourceImplementations/mainRunCarrier/MainRunTourEndEventHandler.java b/src/main/java/org/matsim/freight/logistics/resourceImplementations/mainRunCarrier/MainRunTourEndEventHandler.java index 2df12a38..20bc8481 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/mainRunCarrier/MainRunTourEndEventHandler.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/mainRunCarrier/MainRunTourEndEventHandler.java @@ -35,9 +35,9 @@ import org.matsim.freight.carriers.Tour.ServiceActivity; import org.matsim.freight.carriers.Tour.TourElement; import org.matsim.freight.carriers.events.CarrierTourEndEvent; -import org.matsim.freight.carriers.events.eventhandler.FreightTourEndEventHandler; +import org.matsim.freight.carriers.events.eventhandler.CarrierTourEndEventHandler; -public class MainRunTourEndEventHandler implements AfterMobsimListener, FreightTourEndEventHandler, LSPSimulationTracker { +public class MainRunTourEndEventHandler implements AfterMobsimListener, CarrierTourEndEventHandler, LSPSimulationTracker { // Todo: I have made it (temporarily) public because of junit tests :( -- need to find another way to do the junit testing. kmt jun'23 private final CarrierService carrierService; diff --git a/src/main/java/org/matsim/freight/logistics/resourceImplementations/mainRunCarrier/MainRunTourStartEventHandler.java b/src/main/java/org/matsim/freight/logistics/resourceImplementations/mainRunCarrier/MainRunTourStartEventHandler.java index 56d4f399..76466268 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/mainRunCarrier/MainRunTourStartEventHandler.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/mainRunCarrier/MainRunTourStartEventHandler.java @@ -35,9 +35,9 @@ import org.matsim.freight.carriers.Tour.ServiceActivity; import org.matsim.freight.carriers.Tour.TourElement; import org.matsim.freight.carriers.events.CarrierTourStartEvent; -import org.matsim.freight.carriers.events.eventhandler.FreightTourStartEventHandler; +import org.matsim.freight.carriers.events.eventhandler.CarrierTourStartEventHandler; -public class MainRunTourStartEventHandler implements AfterMobsimListener, FreightTourStartEventHandler, LSPSimulationTracker { +public class MainRunTourStartEventHandler implements AfterMobsimListener, CarrierTourStartEventHandler, LSPSimulationTracker { // Todo: I have made it (temporarily) public because of junit tests :( -- need to find another way to do the junit testing. kmt jun'23 diff --git a/src/main/java/org/matsim/freight/logistics/resourceImplementations/transshipmentHub/TransshipmentHubTourEndEventHandler.java b/src/main/java/org/matsim/freight/logistics/resourceImplementations/transshipmentHub/TransshipmentHubTourEndEventHandler.java index 45314810..e045db38 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/transshipmentHub/TransshipmentHubTourEndEventHandler.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/transshipmentHub/TransshipmentHubTourEndEventHandler.java @@ -33,13 +33,13 @@ import org.matsim.freight.carriers.Tour.ServiceActivity; import org.matsim.freight.carriers.Tour.TourElement; import org.matsim.freight.carriers.events.CarrierTourEndEvent; -import org.matsim.freight.carriers.events.eventhandler.FreightTourEndEventHandler; +import org.matsim.freight.carriers.events.eventhandler.CarrierTourEndEventHandler; import java.util.Collection; import java.util.HashMap; import java.util.Map; -public class TransshipmentHubTourEndEventHandler implements AfterMobsimListener, LSPSimulationTracker, FreightTourEndEventHandler { +public class TransshipmentHubTourEndEventHandler implements AfterMobsimListener, LSPSimulationTracker, CarrierTourEndEventHandler { // Todo: I have made it (temporarily) public because of junit tests :( -- need to find another way to do the junit testing. kmt jun'23 private final Scenario scenario;