From f3c2efb9f8cd27fb90627a631a12f07a83d0d8ec Mon Sep 17 00:00:00 2001 From: Kai Martins-Turner Date: Thu, 12 Oct 2023 22:19:00 +0200 Subject: [PATCH] rename/move packages: ....contrib.freight.* -> ....freight.carriers.* --- .../CarrierReaderFromCSV.java | 8 +- .../DemandReaderFromCSV.java | 4 +- .../FreightDemandGeneration.java | 16 ++-- .../FreightDemandGenerationUtils.java | 8 +- ...rateSmallScaleCommercialTrafficDemand.java | 10 +-- .../SmallScaleCommercialTrafficUtils.java | 14 +-- .../TrafficVolumeGeneration.java | 10 +-- .../TripDistributionMatrix.java | 2 +- .../CarrierReaderFromCSVTest.java | 12 +-- .../DemandReaderFromCSVTest.java | 12 +-- ...nerateSmallScaleCommercialTrafficTest.java | 6 +- .../TrafficVolumeGenerationTest.java | 8 +- .../ChangeCommercialJobOperator.java | 4 +- .../jointDemand/CommercialJobGenerator.java | 2 +- .../CommercialTrafficAnalysisListener.java | 6 +- .../jointDemand/CommercialTrafficChecker.java | 4 +- .../DefaultCommercialJobGenerator.java | 26 +++--- .../jointDemand/JointDemandModule.java | 8 +- .../jointDemand/JointDemandUtils.java | 6 +- .../RunJointDemandCarToggleJspritExample.java | 4 +- .../jointDemand/ScoreCommercialJobs.java | 8 +- .../jointDemand/TourLengthAnalyzer.java | 2 +- .../jointDemand/TourPlanning.java | 21 ++--- .../examples/RunJointDemandCarExample.java | 4 +- .../examples/RunJointDemandDRTExample.java | 4 +- .../ChangeCommercialJobOperatorTest.java | 9 +- .../CommercialTrafficIntegrationTest.java | 4 +- .../IsTheRightCustomerScoredTest.java | 6 +- .../jointDemand/TestScenarioGeneration.java | 2 +- .../contrib/freight/events/HasCarrierId.java | 13 --- .../Vehicle2CarrierEventHandler.java | 69 --------------- .../contrib/freight/jsprit/NetworkRouter.java | 42 --------- .../carriers}/FreightConfigGroup.java | 43 +++++----- .../carriers}/carrier/Carrier.java | 8 +- .../carrier/CarrierCapabilities.java | 6 +- .../carriers}/carrier/CarrierConstants.java | 2 +- .../carriers}/carrier/CarrierImpl.java | 10 +-- .../carriers}/carrier/CarrierPlan.java | 7 +- .../carrier/CarrierPlanReaderV1.java | 11 +-- .../carriers}/carrier/CarrierPlanWriter.java | 2 +- .../carrier/CarrierPlanXmlParserV2.java | 21 ++--- .../carrier/CarrierPlanXmlParserV2_1.java | 8 +- .../carrier/CarrierPlanXmlReader.java | 2 +- .../carrier/CarrierPlanXmlWriterV1.java | 24 +++--- .../carrier/CarrierPlanXmlWriterV2.java | 18 ++-- .../carrier/CarrierPlanXmlWriterV2_1.java | 21 +++-- .../carriers}/carrier/CarrierService.java | 40 ++++----- .../carriers}/carrier/CarrierShipment.java | 2 +- .../carriers}/carrier/CarrierUtils.java | 2 +- .../carriers}/carrier/CarrierVehicle.java | 2 +- .../carriers}/carrier/CarrierVehicleType.java | 2 +- .../carrier/CarrierVehicleTypeLoader.java | 2 +- .../carrier/CarrierVehicleTypeReader.java | 2 +- .../carrier/CarrierVehicleTypeReaderV1.java | 2 +- .../carrier/CarrierVehicleTypeWriter.java | 4 +- .../carrier/CarrierVehicleTypeWriterV1.java | 2 +- .../carrier/CarrierVehicleTypes.java | 8 +- .../carriers}/carrier/Carriers.java | 11 ++- .../carriers}/carrier/ScheduledTour.java | 14 +-- .../carriers}/carrier/TimeWindow.java | 2 +- .../carriers}/carrier/Tour.java | 2 +- .../carriers}/controler/CarrierAgent.java | 27 ++---- .../controler/CarrierAgentTracker.java | 10 +-- .../controler/CarrierControlerListener.java | 40 ++++----- .../controler/CarrierDriverAgent.java | 27 +++++- .../carriers}/controler/CarrierModule.java | 43 +++++----- .../controler/CarrierReRouteVehicles.java | 44 +++++----- .../CarrierScoringFunctionFactory.java | 4 +- .../controler/CarrierStrategyManager.java | 6 +- .../controler/CarrierStrategyManagerImpl.java | 28 +++++- .../CarrierTimeAllocationMutator.java | 50 +++++------ .../CarrierTimeAndSpaceTourRouter.java | 18 ++-- .../controler/CarrierVehicleReRouter.java | 19 ++-- .../carriers}/controler/FreightActivity.java | 10 +-- .../controler/FreightAgentSource.java | 44 +++++----- .../carriers}/controler/FreightUtils.java | 55 ++++++------ .../WithinDayActivityReScheduling.java | 15 ++-- .../events/AbstractCarrierEvent.java | 25 +++++- .../events/CarrierEventAttributes.java | 2 +- .../carriers}/events/CarrierEventCreator.java | 6 +- .../events/CarrierEventCreatorUtils.java | 2 +- .../events/CarrierEventsReaders.java | 37 ++++---- .../events/CarrierServiceEndEvent.java | 18 ++-- .../events/CarrierServiceEndEventCreator.java | 15 ++-- .../events/CarrierServiceStartEvent.java | 20 ++--- .../CarrierServiceStartEventCreator.java | 15 ++-- .../CarrierShipmentDeliveryEndEvent.java | 20 ++--- ...arrierShipmentDeliveryEndEventCreator.java | 15 ++-- .../CarrierShipmentDeliveryStartEvent.java | 8 +- ...rierShipmentDeliveryStartEventCreator.java | 15 ++-- .../events/CarrierShipmentPickupEndEvent.java | 8 +- .../CarrierShipmentPickupEndEventCreator.java | 15 ++-- .../CarrierShipmentPickupStartEvent.java | 20 ++--- ...arrierShipmentPickupStartEventCreator.java | 15 ++-- .../carriers}/events/CarrierTourEndEvent.java | 14 ++- .../events/CarrierTourEndEventCreator.java | 8 +- .../events/CarrierTourStartEvent.java | 8 +- .../events/CarrierTourStartEventCreator.java | 8 +- .../freight/carriers/events/HasCarrierId.java | 34 ++++++++ .../FreightServiceEndEventHandler.java | 4 +- .../FreightServiceStartEventHandler.java | 4 +- .../FreightShipmentDeliveryEventHandler.java | 4 +- .../FreightShipmentPickupEventHandler.java | 4 +- .../FreightTourEndEventHandler.java | 4 +- .../FreightTourStartEventHandler.java | 4 +- .../Vehicle2CarrierEventHandler.java | 70 +++++++++++++++ .../carriers}/jsprit/DistanceConstraint.java | 6 +- .../carriers}/jsprit/DistanceUpdater.java | 4 +- .../carriers}/jsprit/FiFoTravelTime.java | 2 +- .../carriers}/jsprit/MatsimJspritFactory.java | 81 ++++++++++-------- .../jsprit/NetworkBasedTransportCosts.java | 36 +++++--- .../NetworkBasedTransportCostsFactory.java | 6 +- .../carriers/jsprit/NetworkRouter.java | 50 +++++++++++ .../carriers}/jsprit/VRPTransportCosts.java | 2 +- .../jsprit/VRPTransportCostsFactory.java | 2 +- ...cleTypeDependentRoadPricingCalculator.java | 39 +++++---- .../carriers}/package-info.java | 7 +- .../usecases/analysis/CarrierScoreStats.java | 49 +++++------ .../usecases/analysis/LegHistogram.java | 64 +++++++------- .../CarrierScoringFunctionFactoryImpl.java | 10 +-- .../chessboard/CarrierTravelDisutilities.java | 10 +-- .../chessboard/FreightScenarioCreator.java | 6 +- .../chessboard/InitialCarrierPlanCreator.java | 15 ++-- .../InnerOuterCityScenarioCreator.java | 8 +- .../chessboard/PassengerScenarioCreator.java | 16 ++-- .../usecases/chessboard/PlotPlans.java | 12 +-- .../usecases/chessboard/RunChessboard.java | 17 ++-- .../RunPassengerAlongWithCarriers.java | 23 +++-- .../RunPassengerPlansFromConfig.java | 2 +- .../RunPassengerPlansFromScratch.java | 4 +- ...PlanAndOptimizeItsVehicleRouteFactory.java | 21 +++-- .../carrier/CarrierPlanXmlWriterV1Test.java | 61 ------------- .../carrier/CarrierVehicleTypeWriterTest.java | 21 ----- .../RunPassengerAlongWithCarriersIT.java | 30 ------- .../carriers}/FreightConfigGroupTest.java | 27 +++++- .../carriers}/carrier/CarrierModuleTest.java | 53 ++++++------ .../carrier/CarrierPlanReaderV1Test.java | 40 ++++----- .../carrier/CarrierPlanXmlReaderV2Test.java | 44 +++++++--- .../CarrierPlanXmlReaderV2WithDtdTest.java | 33 +++++-- .../carrier/CarrierPlanXmlWriterV1Test.java | 54 ++++++++++++ .../carrier/CarrierPlanXmlWriterV2Test.java | 25 +++++- .../carrier/CarrierPlanXmlWriterV2_1Test.java | 27 +++++- .../carrier/CarrierReadWriteV2_1Test.java | 23 ++++- .../carriers}/carrier/CarrierUtilsTest.java | 45 ++++------ .../carrier/CarrierVehicleTypeLoaderTest.java | 23 ++++- .../carrier/CarrierVehicleTypeReaderTest.java | 23 ++++- .../carrier/CarrierVehicleTypeTest.java | 23 ++++- .../carrier/CarrierVehicleTypeWriterTest.java | 42 +++++++++ .../EquilWithCarrierWithPersonsIT.java | 51 +++++------ .../EquilWithCarrierWithoutPersonsIT.java | 57 ++++++------ ...istanceConstraintFromVehiclesFileTest.java | 14 +-- .../jsprit/DistanceConstraintTest.java | 14 +-- .../carriers}/jsprit/FixedCostsTest.java | 55 ++++++------ .../carriers}/jsprit/IntegrationIT.java | 31 +++++-- .../jsprit/MatsimTransformerTest.java | 56 ++++++++---- .../NetworkBasedTransportCostsTest.java | 34 ++++++-- .../carriers}/jsprit/SkillsIT.java | 43 +++++----- ...istanceScoringFunctionFactoryForTests.java | 40 ++++++--- .../ScoringFunctionFactoryForTests.java | 39 +++++++-- .../StrategyManagerFactoryForTests.java | 35 ++++++-- .../TimeScoringFunctionFactoryForTests.java | 40 ++++++--- .../usecases/chessboard/RunChessboardIT.java | 23 ++++- .../RunPassengerAlongWithCarriersIT.java | 51 +++++++++++ .../carriers}/utils/FreightUtilsIT.java | 69 +++++++-------- .../carriers}/utils/FreightUtilsTest.java | 76 ++++++++-------- .../testSetupScenario/grid10.xml | 0 .../CarrierModuleTest/carrierPlansEquils.xml | 0 .../carrier/CarrierModuleTest/network.xml | 0 .../carrier/CarrierModuleTest/plans100.xml | 0 .../CarrierModuleTest/vehicleTypes.xml | 0 .../carrierPlansEquils.xml | 0 ...carrierPlansEquils_unscored_unselected.xml | 0 .../carrierPlansEquils.xml | 0 .../carrierPlansEquilsFiniteFleet.xml | 0 .../carrierPlansEquilsFiniteFleetWithDtd.xml | 0 .../carrierPlansEquilsWithDtd.xml | 0 .../carrierPlansEquils.xml | 0 .../carrierPlansEquils.xml | 0 .../carrierPlansEquilsWritten.xml | 0 .../carrierPlansEquils.xml | 0 .../CarrierReadWriteV2_1Test/carriers.xml | 0 .../CarrierReadWriteV2_1Test/vehicles.xml | 0 .../carrierPlansEquils.xml | 0 .../vehicleTypes.xml | 0 .../vehicleTypes.xml | 0 .../vehicleTypes_v2.xml | 0 .../carrierVehicleTypes_v1.xsd | 0 .../carrierVehicleTypes_v2.xsd | 0 .../vehicleTypes.xml | 0 .../carriers}/carrier/vehicleTypes_v2.xml | 0 .../carrierPlansEquils.xml | 0 .../EquilWithCarrierWithPersonsIT/network.xml | 0 .../plans100.xml | 0 .../carrierPlansEquils.xml | 0 .../network.xml | 0 .../output_events.xml.gz | Bin .../carriers}/controler/vehicleTypes_v2.xml | 0 .../jsprit/IntegrationIT/carrier.xml | 0 .../merged-network-simplified.xml.gz | Bin .../jsprit/IntegrationIT/vehicleTypes.xml | 0 .../MatsimTransformerTest/grid-network.xml | 0 .../network.xml | 0 .../jsprit/SkillsIT/grid-network.xml | 0 .../jsprit/vehicleTypesForDCTest.xml | 0 .../CarrierAgentTest/carrierPlansEquils.xml | 0 .../mobsim/CarrierAgentTest/network.xml | 0 .../runChessboard/output_events.xml.gz | Bin .../runChessboard/output_plans.xml.gz | Bin .../carriers}/utils/grid-network.xml | 0 .../testCreateTours/carrierPlansEquils.xml | 0 .../carrierPlansEquils.xml | 0 .../carrierPlansEquils.xml | 0 .../network.xml | 0 .../freightreceiver/ReceiverAgent.java | 6 +- .../ReceiverControlerListener.java | 8 +- .../ReceiverCostAllocation.java | 2 +- ...ReceiverCostAllocationEqualProportion.java | 2 +- .../ReceiverCostAllocationFixed.java | 2 +- .../freightreceiver/ReceiverModule.java | 2 +- .../freightreceiver/ReceiverOrder.java | 2 +- .../contrib/freightreceiver/ReceiverPlan.java | 4 +- .../freightreceiver/ReceiverScoreStats.java | 2 +- ...iverTriggersCarrierReplanningListener.java | 13 +-- .../freightreceiver/ReceiverUtils.java | 2 +- .../freightreceiver/ReceiversReaderV2.java | 4 +- .../freightreceiver/ReceiversWriter.java | 2 +- .../ReceiversWriterHandler.java | 2 +- .../ReceiversWriterHandlerImplV1.java | 2 +- .../ReceiversWriterHandlerImplV2.java | 2 +- ...UsecasesCarrierScoringFunctionFactory.java | 6 +- .../collaboration/Coalition.java | 2 +- .../collaboration/CollaborationUtils.java | 6 +- .../collaboration/CollaborationUtilsNew.java | 2 +- .../collaboration/MutableCoalition.java | 2 +- .../collaboration/TimeWindowMutator.java | 2 +- .../replanning/ReceiverStrategyManager.java | 2 +- .../TimeWindowUpperBoundMutator.java | 2 +- .../ReceiverChessboardScenario.java | 6 +- ...iverChessboardWithEqualProportionCost.java | 6 +- ...eceiverChessboardWithFixedCarrierCost.java | 6 +- .../freightreceiver/ReceiversReaderTest.java | 4 +- .../analysis/CarrierLoadAnalysis.java | 31 +++++-- .../analysis/CarrierPlanAnalysis.java | 27 +++++- .../analysis/FreightAnalysisEventHandler.java | 28 +++--- .../FreightAnalysisServiceTracking.java | 10 +-- .../FreightAnalysisShipmentTracking.java | 12 +-- .../FreightAnalysisVehicleTracking.java | 6 +- ...tTimeAndDistanceAnalysisEventsHandler.java | 33 +++++-- .../carriers/analysis}/analysis/Readme.md | 0 .../analysis/RunFreightAnalysis.java | 10 +-- .../RunFreightAnalysisEventBased.java | 10 +-- .../FreightAnalysisEventBasedTest.java | 25 ------ .../MyServiceTrackerEventHandler.java | 59 ------------- .../FreightAnalysisEventBasedTest.java | 47 ++++++++++ .../MyFreightVehicleTrackerEventHandler.java | 7 +- .../MyServiceTrackerEventHandler.java | 81 ++++++++++++++++++ .../MyShipmentTrackerEventHandler.java | 38 ++++++-- .../analysis/RunFreightAnalysisIT.java | 6 +- .../RunFreightAnalysisWithShipmentTest.java | 32 +++++-- .../output_allVehicles.xml.gz | Bin .../output_carriers.xml.gz | Bin .../output_events.xml.gz | Bin .../output_network.xml.gz | Bin .../Carrier_stats.tsv | 0 .../Load_perVehicle.tsv | 0 .../TimeDistance_perVehicle.tsv | 0 .../TimeDistance_perVehicleType.tsv | 0 .../compareResults/carrierStats.tsv | 0 .../carrier_##carrier1_tripStats.tsv | 0 .../carrier_##carrier1_vehicleStats.tsv | 0 .../carrier_carrier1_ServiceStats.tsv | 0 .../carrier_carrier1_ShipmentStats.tsv | 0 .../carrier_carrier1_VehicleTypeStats.tsv | 0 .../compareResults/freightVehicleStats.tsv | 0 .../freightVehicleTripStats.tsv | 0 .../compareResults/serviceStats.tsv | 0 .../compareResults/shipmentStats.tsv | 0 .../output_allVehicles.xml.gz | Bin .../output_carriers.xml.gz | Bin .../RunFreightAnalysisIT/output_events.xml.gz | Bin .../output_network.xml.gz | Bin .../compareResults/shipment/carrierStats.tsv | 0 .../shipment/carrier_##carrier1_tripStats.tsv | 0 .../carrier_##carrier1_vehicleStats.tsv | 0 .../carrier_carrier1_ShipmentStats.tsv | 0 .../carrier_carrier1_VehicleTypeStats.tsv | 0 .../shipment/freightVehicleStats.tsv | 0 .../shipment/freightVehicleTripStats.tsv | 0 .../shipment/output_allVehicles.xml.gz | Bin .../shipment/output_carriers.xml.gz | Bin .../shipment/output_events.xml.gz | Bin .../shipment/output_network.xml.gz | Bin 292 files changed, 2238 insertions(+), 1637 deletions(-) delete mode 100644 contribs/freight/src/main/java/org/matsim/contrib/freight/events/HasCarrierId.java delete mode 100644 contribs/freight/src/main/java/org/matsim/contrib/freight/events/eventhandler/Vehicle2CarrierEventHandler.java delete mode 100644 contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/NetworkRouter.java rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/FreightConfigGroup.java (85%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/Carrier.java (98%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierCapabilities.java (99%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierConstants.java (98%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierImpl.java (98%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlan.java (97%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlanReaderV1.java (98%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlanWriter.java (98%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlanXmlParserV2.java (97%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlanXmlParserV2_1.java (98%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlanXmlReader.java (99%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlanXmlWriterV1.java (95%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlanXmlWriterV2.java (97%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlanXmlWriterV2_1.java (94%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierService.java (97%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierShipment.java (99%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierUtils.java (99%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierVehicle.java (99%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierVehicleType.java (99%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierVehicleTypeLoader.java (98%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierVehicleTypeReader.java (99%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierVehicleTypeReaderV1.java (99%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierVehicleTypeWriter.java (98%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierVehicleTypeWriterV1.java (98%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierVehicleTypes.java (98%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/Carriers.java (98%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/ScheduledTour.java (97%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/TimeWindow.java (98%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/carrier/Tour.java (99%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/controler/CarrierAgent.java (91%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/controler/CarrierAgentTracker.java (95%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/controler/CarrierControlerListener.java (65%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/controler/CarrierDriverAgent.java (87%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/controler/CarrierModule.java (78%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/controler/CarrierReRouteVehicles.java (68%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/controler/CarrierScoringFunctionFactory.java (93%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/controler/CarrierStrategyManager.java (93%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/controler/CarrierStrategyManagerImpl.java (54%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/controler/CarrierTimeAllocationMutator.java (65%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/controler/CarrierTimeAndSpaceTourRouter.java (94%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/controler/CarrierVehicleReRouter.java (95%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/controler/FreightActivity.java (97%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/controler/FreightAgentSource.java (67%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/controler/FreightUtils.java (93%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/controler/WithinDayActivityReScheduling.java (96%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/AbstractCarrierEvent.java (54%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/CarrierEventAttributes.java (97%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/CarrierEventCreator.java (92%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/CarrierEventCreatorUtils.java (98%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/CarrierEventsReaders.java (61%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/CarrierServiceEndEvent.java (86%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/CarrierServiceEndEventCreator.java (80%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/CarrierServiceStartEvent.java (83%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/CarrierServiceStartEventCreator.java (80%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/CarrierShipmentDeliveryEndEvent.java (80%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/CarrierShipmentDeliveryEndEventCreator.java (81%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/CarrierShipmentDeliveryStartEvent.java (94%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/CarrierShipmentDeliveryStartEventCreator.java (81%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/CarrierShipmentPickupEndEvent.java (93%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/CarrierShipmentPickupEndEventCreator.java (81%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/CarrierShipmentPickupStartEvent.java (80%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/CarrierShipmentPickupStartEventCreator.java (81%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/CarrierTourEndEvent.java (89%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/CarrierTourEndEventCreator.java (90%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/CarrierTourStartEvent.java (93%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/CarrierTourStartEventCreator.java (95%) create mode 100644 contribs/freight/src/main/java/org/matsim/freight/carriers/events/HasCarrierId.java rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/eventhandler/FreightServiceEndEventHandler.java (92%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/eventhandler/FreightServiceStartEventHandler.java (92%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/eventhandler/FreightShipmentDeliveryEventHandler.java (92%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/eventhandler/FreightShipmentPickupEventHandler.java (92%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/eventhandler/FreightTourEndEventHandler.java (92%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/events/eventhandler/FreightTourStartEventHandler.java (92%) create mode 100644 contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/Vehicle2CarrierEventHandler.java rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/jsprit/DistanceConstraint.java (98%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/jsprit/DistanceUpdater.java (96%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/jsprit/FiFoTravelTime.java (98%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/jsprit/MatsimJspritFactory.java (92%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/jsprit/NetworkBasedTransportCosts.java (95%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/jsprit/NetworkBasedTransportCostsFactory.java (95%) create mode 100644 contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/NetworkRouter.java rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/jsprit/VRPTransportCosts.java (97%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/jsprit/VRPTransportCostsFactory.java (97%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/jsprit/VehicleTypeDependentRoadPricingCalculator.java (79%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/package-info.java (95%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/usecases/analysis/CarrierScoreStats.java (85%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/usecases/analysis/LegHistogram.java (90%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/usecases/chessboard/CarrierScoringFunctionFactoryImpl.java (96%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/usecases/chessboard/CarrierTravelDisutilities.java (94%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/usecases/chessboard/FreightScenarioCreator.java (98%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/usecases/chessboard/InitialCarrierPlanCreator.java (96%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/usecases/chessboard/InnerOuterCityScenarioCreator.java (97%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/usecases/chessboard/PassengerScenarioCreator.java (93%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/usecases/chessboard/PlotPlans.java (86%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/usecases/chessboard/RunChessboard.java (93%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/usecases/chessboard/RunPassengerAlongWithCarriers.java (89%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/usecases/chessboard/RunPassengerPlansFromConfig.java (96%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/usecases/chessboard/RunPassengerPlansFromScratch.java (98%) rename contribs/freight/src/main/java/org/matsim/{contrib/freight => freight/carriers}/usecases/chessboard/SelectBestPlanAndOptimizeItsVehicleRouteFactory.java (94%) delete mode 100644 contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlWriterV1Test.java delete mode 100644 contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeWriterTest.java delete mode 100644 contribs/freight/src/test/java/org/matsim/contrib/freight/usecases/chessboard/RunPassengerAlongWithCarriersIT.java rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/FreightConfigGroupTest.java (63%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierModuleTest.java (73%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlanReaderV1Test.java (75%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlanXmlReaderV2Test.java (82%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlanXmlReaderV2WithDtdTest.java (78%) create mode 100644 contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlWriterV1Test.java rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlanXmlWriterV2Test.java (79%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlanXmlWriterV2_1Test.java (81%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierReadWriteV2_1Test.java (63%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierUtilsTest.java (72%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierVehicleTypeLoaderTest.java (69%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierVehicleTypeReaderTest.java (73%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierVehicleTypeTest.java (85%) create mode 100644 contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeWriterTest.java rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/controler/EquilWithCarrierWithPersonsIT.java (72%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/controler/EquilWithCarrierWithoutPersonsIT.java (83%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/jsprit/DistanceConstraintFromVehiclesFileTest.java (97%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/jsprit/DistanceConstraintTest.java (98%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/jsprit/FixedCostsTest.java (87%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/jsprit/IntegrationIT.java (72%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/jsprit/MatsimTransformerTest.java (93%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/jsprit/NetworkBasedTransportCostsTest.java (83%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/jsprit/SkillsIT.java (88%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/mobsim/DistanceScoringFunctionFactoryForTests.java (76%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/mobsim/ScoringFunctionFactoryForTests.java (74%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/mobsim/StrategyManagerFactoryForTests.java (60%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/mobsim/TimeScoringFunctionFactoryForTests.java (77%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/usecases/chessboard/RunChessboardIT.java (58%) create mode 100644 contribs/freight/src/test/java/org/matsim/freight/carriers/usecases/chessboard/RunPassengerAlongWithCarriersIT.java rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/utils/FreightUtilsIT.java (89%) rename contribs/freight/src/test/java/org/matsim/{contrib/freight => freight/carriers}/utils/FreightUtilsTest.java (93%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/algorithms/SetupSimpleFreightScenarioTest/testSetupScenario/grid10.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierModuleTest/carrierPlansEquils.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierModuleTest/network.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierModuleTest/plans100.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierModuleTest/vehicleTypes.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlanReaderV1Test/carrierPlansEquils.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlanReaderV1Test/carrierPlansEquils_unscored_unselected.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlanXmlReaderV2Test/carrierPlansEquils.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlanXmlReaderV2Test/carrierPlansEquilsFiniteFleet.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlanXmlReaderV2WithDtdTest/carrierPlansEquilsFiniteFleetWithDtd.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlanXmlReaderV2WithDtdTest/carrierPlansEquilsWithDtd.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlanXmlWriterV1Test/carrierPlansEquils.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlanXmlWriterV2Test/carrierPlansEquils.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlanXmlWriterV2Test/carrierPlansEquilsWritten.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierPlanXmlWriterV2_1Test/carrierPlansEquils.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierReadWriteV2_1Test/carriers.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierReadWriteV2_1Test/vehicles.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierVehicleTypeLoaderTest/carrierPlansEquils.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierVehicleTypeLoaderTest/vehicleTypes.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierVehicleTypeReaderTest/vehicleTypes.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierVehicleTypeReaderTest/vehicleTypes_v2.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierVehicleTypeReaderWithDtdV1Test/carrierVehicleTypes_v1.xsd (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierVehicleTypeReaderWithDtdV1Test/carrierVehicleTypes_v2.xsd (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/CarrierVehicleTypeWriterTest/vehicleTypes.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/carrier/vehicleTypes_v2.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/controler/EquilWithCarrierWithPersonsIT/carrierPlansEquils.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/controler/EquilWithCarrierWithPersonsIT/network.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/controler/EquilWithCarrierWithPersonsIT/plans100.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/controler/EquilWithCarrierWithoutPersonsIT/carrierPlansEquils.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/controler/EquilWithCarrierWithoutPersonsIT/network.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/controler/EquilWithCarrierWithoutPersonsIT/output_events.xml.gz (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/controler/vehicleTypes_v2.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/jsprit/IntegrationIT/carrier.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/jsprit/IntegrationIT/merged-network-simplified.xml.gz (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/jsprit/IntegrationIT/vehicleTypes.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/jsprit/MatsimTransformerTest/grid-network.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/jsprit/NetworkBasedTransportCostsTest/network.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/jsprit/SkillsIT/grid-network.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/jsprit/vehicleTypesForDCTest.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/mobsim/CarrierAgentTest/carrierPlansEquils.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/mobsim/CarrierAgentTest/network.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/usecases/chessboard/RunChessboardIT/runChessboard/output_events.xml.gz (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/usecases/chessboard/RunChessboardIT/runChessboard/output_plans.xml.gz (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/utils/grid-network.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/vrp/Matsim2VrpUtilsTest/testCreateTours/carrierPlansEquils.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/vrp/Matsim2VrpUtilsTest/testCreateVehicleRoutes/carrierPlansEquils.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/vrp/MatsimVrpSolverImplTest/testSelectedPlanIsInitialSolution/carrierPlansEquils.xml (100%) rename contribs/freight/test/input/org/matsim/{contrib/freight => freight/carriers}/vrp/MatsimVrpSolverImplTest/testSelectedPlanIsInitialSolution/network.xml (100%) rename contribs/vsp/src/main/java/org/matsim/{contrib/freight => freight/carriers/analysis}/analysis/CarrierLoadAnalysis.java (64%) rename contribs/vsp/src/main/java/org/matsim/{contrib/freight => freight/carriers/analysis}/analysis/CarrierPlanAnalysis.java (56%) rename contribs/vsp/src/main/java/org/matsim/{contrib/freight => freight/carriers/analysis}/analysis/FreightAnalysisEventHandler.java (95%) rename contribs/vsp/src/main/java/org/matsim/{contrib/freight => freight/carriers/analysis}/analysis/FreightAnalysisServiceTracking.java (96%) rename contribs/vsp/src/main/java/org/matsim/{contrib/freight => freight/carriers/analysis}/analysis/FreightAnalysisShipmentTracking.java (93%) rename contribs/vsp/src/main/java/org/matsim/{contrib/freight => freight/carriers/analysis}/analysis/FreightAnalysisVehicleTracking.java (97%) rename contribs/vsp/src/main/java/org/matsim/{contrib/freight => freight/carriers/analysis}/analysis/FreightTimeAndDistanceAnalysisEventsHandler.java (83%) rename contribs/vsp/src/main/java/org/matsim/{contrib/freight => freight/carriers/analysis}/analysis/Readme.md (100%) rename contribs/vsp/src/main/java/org/matsim/{contrib/freight => freight/carriers/analysis}/analysis/RunFreightAnalysis.java (92%) rename contribs/vsp/src/main/java/org/matsim/{contrib/freight => freight/carriers/analysis}/analysis/RunFreightAnalysisEventBased.java (94%) delete mode 100644 contribs/vsp/src/test/java/org/matsim/contrib/freight/analysis/FreightAnalysisEventBasedTest.java delete mode 100644 contribs/vsp/src/test/java/org/matsim/contrib/freight/analysis/MyServiceTrackerEventHandler.java create mode 100644 contribs/vsp/src/test/java/org/matsim/freight/carriers/analysis/analysis/FreightAnalysisEventBasedTest.java rename contribs/vsp/src/test/java/org/matsim/{contrib/freight => freight/carriers/analysis}/analysis/MyFreightVehicleTrackerEventHandler.java (92%) create mode 100644 contribs/vsp/src/test/java/org/matsim/freight/carriers/analysis/analysis/MyServiceTrackerEventHandler.java rename contribs/vsp/src/test/java/org/matsim/{contrib/freight => freight/carriers/analysis}/analysis/MyShipmentTrackerEventHandler.java (51%) rename contribs/vsp/src/test/java/org/matsim/{contrib/freight => freight/carriers/analysis}/analysis/RunFreightAnalysisIT.java (99%) rename contribs/vsp/src/test/java/org/matsim/{contrib/freight => freight/carriers/analysis}/analysis/RunFreightAnalysisWithShipmentTest.java (73%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/FreightAnalysisEventBasedTest/output_allVehicles.xml.gz (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/FreightAnalysisEventBasedTest/output_carriers.xml.gz (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/FreightAnalysisEventBasedTest/output_events.xml.gz (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/FreightAnalysisEventBasedTest/output_network.xml.gz (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/FreightAnalysisEventBasedTest/runFreightAnalysisEventBasedTest/Carrier_stats.tsv (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/FreightAnalysisEventBasedTest/runFreightAnalysisEventBasedTest/Load_perVehicle.tsv (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/FreightAnalysisEventBasedTest/runFreightAnalysisEventBasedTest/TimeDistance_perVehicle.tsv (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/FreightAnalysisEventBasedTest/runFreightAnalysisEventBasedTest/TimeDistance_perVehicleType.tsv (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisIT/compareResults/carrierStats.tsv (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_##carrier1_tripStats.tsv (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_##carrier1_vehicleStats.tsv (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_carrier1_ServiceStats.tsv (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_carrier1_ShipmentStats.tsv (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_carrier1_VehicleTypeStats.tsv (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisIT/compareResults/freightVehicleStats.tsv (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisIT/compareResults/freightVehicleTripStats.tsv (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisIT/compareResults/serviceStats.tsv (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisIT/compareResults/shipmentStats.tsv (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisIT/output_allVehicles.xml.gz (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisIT/output_carriers.xml.gz (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisIT/output_events.xml.gz (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisIT/output_network.xml.gz (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrierStats.tsv (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrier_##carrier1_tripStats.tsv (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrier_##carrier1_vehicleStats.tsv (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrier_carrier1_ShipmentStats.tsv (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrier_carrier1_VehicleTypeStats.tsv (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/freightVehicleStats.tsv (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/freightVehicleTripStats.tsv (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisWithShipmentTest/shipment/output_allVehicles.xml.gz (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisWithShipmentTest/shipment/output_carriers.xml.gz (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisWithShipmentTest/shipment/output_events.xml.gz (100%) rename contribs/vsp/test/input/org/matsim/{contrib => }/freight/analysis/RunFreightAnalysisWithShipmentTest/shipment/output_network.xml.gz (100%) diff --git a/contribs/application/src/main/java/org/matsim/freightDemandGeneration/CarrierReaderFromCSV.java b/contribs/application/src/main/java/org/matsim/freightDemandGeneration/CarrierReaderFromCSV.java index 591a895aa84..a499851f09f 100644 --- a/contribs/application/src/main/java/org/matsim/freightDemandGeneration/CarrierReaderFromCSV.java +++ b/contribs/application/src/main/java/org/matsim/freightDemandGeneration/CarrierReaderFromCSV.java @@ -27,10 +27,10 @@ import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.network.Link; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize; -import org.matsim.contrib.freight.controler.FreightUtils; +import org.matsim.freight.carriers.FreightConfigGroup; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.carrier.CarrierCapabilities.FleetSize; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.core.utils.geometry.CoordinateTransformation; import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.VehicleType; diff --git a/contribs/application/src/main/java/org/matsim/freightDemandGeneration/DemandReaderFromCSV.java b/contribs/application/src/main/java/org/matsim/freightDemandGeneration/DemandReaderFromCSV.java index fa3357d473c..f8243d5d4d4 100644 --- a/contribs/application/src/main/java/org/matsim/freightDemandGeneration/DemandReaderFromCSV.java +++ b/contribs/application/src/main/java/org/matsim/freightDemandGeneration/DemandReaderFromCSV.java @@ -31,8 +31,8 @@ import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.population.Person; import org.matsim.api.core.v01.population.Population; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.controler.FreightUtils; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.core.network.NetworkUtils; import org.matsim.core.utils.geometry.CoordinateTransformation; import org.matsim.core.utils.geometry.geotools.MGC; diff --git a/contribs/application/src/main/java/org/matsim/freightDemandGeneration/FreightDemandGeneration.java b/contribs/application/src/main/java/org/matsim/freightDemandGeneration/FreightDemandGeneration.java index 8f6c2e87446..58653204d18 100644 --- a/contribs/application/src/main/java/org/matsim/freightDemandGeneration/FreightDemandGeneration.java +++ b/contribs/application/src/main/java/org/matsim/freightDemandGeneration/FreightDemandGeneration.java @@ -26,14 +26,14 @@ import org.matsim.api.core.v01.population.Population; import org.matsim.application.MATSimAppCommand; import org.matsim.application.options.ShpOptions; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierPlanWriter; -import org.matsim.contrib.freight.carrier.Carriers; -import org.matsim.contrib.freight.controler.CarrierModule; -import org.matsim.contrib.freight.controler.CarrierScoringFunctionFactory; -import org.matsim.contrib.freight.controler.FreightUtils; -import org.matsim.contrib.freight.usecases.chessboard.CarrierScoringFunctionFactoryImpl; +import org.matsim.freight.carriers.FreightConfigGroup; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierPlanWriter; +import org.matsim.freight.carriers.carrier.Carriers; +import org.matsim.freight.carriers.controler.CarrierModule; +import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controler.FreightUtils; +import org.matsim.freight.carriers.usecases.chessboard.CarrierScoringFunctionFactoryImpl; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.ControllerConfigGroup; diff --git a/contribs/application/src/main/java/org/matsim/freightDemandGeneration/FreightDemandGenerationUtils.java b/contribs/application/src/main/java/org/matsim/freightDemandGeneration/FreightDemandGenerationUtils.java index 82be3284375..5b54115b3af 100644 --- a/contribs/application/src/main/java/org/matsim/freightDemandGeneration/FreightDemandGenerationUtils.java +++ b/contribs/application/src/main/java/org/matsim/freightDemandGeneration/FreightDemandGenerationUtils.java @@ -29,10 +29,10 @@ import org.matsim.api.core.v01.network.Network; import org.matsim.api.core.v01.population.*; import org.matsim.application.options.ShpOptions; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierService; -import org.matsim.contrib.freight.carrier.CarrierShipment; -import org.matsim.contrib.freight.controler.FreightUtils; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierService; +import org.matsim.freight.carriers.carrier.CarrierShipment; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.core.controler.Controler; import org.matsim.core.utils.geometry.CoordinateTransformation; import org.matsim.core.utils.geometry.geotools.MGC; diff --git a/contribs/application/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/GenerateSmallScaleCommercialTrafficDemand.java b/contribs/application/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/GenerateSmallScaleCommercialTrafficDemand.java index 1ef1365d510..a5e51cb8346 100644 --- a/contribs/application/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/GenerateSmallScaleCommercialTrafficDemand.java +++ b/contribs/application/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/GenerateSmallScaleCommercialTrafficDemand.java @@ -38,11 +38,11 @@ import org.matsim.application.MATSimAppCommand; import org.matsim.application.options.ShpOptions; import org.matsim.application.options.ShpOptions.Index; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize; -import org.matsim.contrib.freight.controler.*; -import org.matsim.contrib.freight.usecases.chessboard.CarrierTravelDisutilities; +import org.matsim.freight.carriers.FreightConfigGroup; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.controler.*; +import org.matsim.freight.carriers.carrier.CarrierCapabilities.FleetSize; +import org.matsim.freight.carriers.usecases.chessboard.CarrierTravelDisutilities; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.ControllerConfigGroup; diff --git a/contribs/application/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/SmallScaleCommercialTrafficUtils.java b/contribs/application/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/SmallScaleCommercialTrafficUtils.java index 9d7ab8ad305..294b5c8ab0b 100644 --- a/contribs/application/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/SmallScaleCommercialTrafficUtils.java +++ b/contribs/application/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/SmallScaleCommercialTrafficUtils.java @@ -40,13 +40,13 @@ import org.matsim.api.core.v01.population.*; import org.matsim.application.options.ShpOptions; import org.matsim.application.options.ShpOptions.Index; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize; -import org.matsim.contrib.freight.carrier.Tour.Pickup; -import org.matsim.contrib.freight.carrier.Tour.ServiceActivity; -import org.matsim.contrib.freight.carrier.Tour.TourElement; -import org.matsim.contrib.freight.controler.FreightUtils; -import org.matsim.contrib.freight.jsprit.MatsimJspritFactory; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.carrier.CarrierCapabilities.FleetSize; +import org.matsim.freight.carriers.carrier.Tour.Pickup; +import org.matsim.freight.carriers.carrier.Tour.ServiceActivity; +import org.matsim.freight.carriers.carrier.Tour.TourElement; +import org.matsim.freight.carriers.controler.FreightUtils; +import org.matsim.freight.carriers.jsprit.MatsimJspritFactory; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.network.NetworkUtils; import org.matsim.core.population.PopulationUtils; diff --git a/contribs/application/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/TrafficVolumeGeneration.java b/contribs/application/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/TrafficVolumeGeneration.java index 6f747bc2ee5..301f14decca 100644 --- a/contribs/application/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/TrafficVolumeGeneration.java +++ b/contribs/application/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/TrafficVolumeGeneration.java @@ -27,11 +27,11 @@ import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.network.Link; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.carrier.Tour.Pickup; -import org.matsim.contrib.freight.carrier.Tour.ServiceActivity; -import org.matsim.contrib.freight.carrier.Tour.TourElement; -import org.matsim.contrib.freight.controler.FreightUtils; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.carrier.Tour.Pickup; +import org.matsim.freight.carriers.carrier.Tour.ServiceActivity; +import org.matsim.freight.carriers.carrier.Tour.TourElement; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.utils.io.IOUtils; diff --git a/contribs/application/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/TripDistributionMatrix.java b/contribs/application/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/TripDistributionMatrix.java index 698f43a967a..0f3a2f3dcfe 100644 --- a/contribs/application/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/TripDistributionMatrix.java +++ b/contribs/application/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/TripDistributionMatrix.java @@ -33,7 +33,7 @@ import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.network.Network; import org.matsim.application.options.ShpOptions; -import org.matsim.contrib.freight.jsprit.NetworkBasedTransportCosts; +import org.matsim.freight.carriers.jsprit.NetworkBasedTransportCosts; import org.matsim.core.utils.io.IOUtils; import org.matsim.core.utils.io.UncheckedIOException; import org.matsim.vehicles.VehicleType; diff --git a/contribs/application/src/test/java/org/matsim/freightDemandGeneration/CarrierReaderFromCSVTest.java b/contribs/application/src/test/java/org/matsim/freightDemandGeneration/CarrierReaderFromCSVTest.java index cca68b4d44b..11097157601 100644 --- a/contribs/application/src/test/java/org/matsim/freightDemandGeneration/CarrierReaderFromCSVTest.java +++ b/contribs/application/src/test/java/org/matsim/freightDemandGeneration/CarrierReaderFromCSVTest.java @@ -17,12 +17,12 @@ import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.network.Network; import org.matsim.application.options.ShpOptions; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.controler.FreightUtils; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize; -import org.matsim.contrib.freight.carrier.CarrierUtils; -import org.matsim.contrib.freight.carrier.CarrierVehicle; +import org.matsim.freight.carriers.FreightConfigGroup; +import org.matsim.freight.carriers.controler.FreightUtils; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierCapabilities.FleetSize; +import org.matsim.freight.carriers.carrier.CarrierUtils; +import org.matsim.freight.carriers.carrier.CarrierVehicle; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.network.NetworkUtils; diff --git a/contribs/application/src/test/java/org/matsim/freightDemandGeneration/DemandReaderFromCSVTest.java b/contribs/application/src/test/java/org/matsim/freightDemandGeneration/DemandReaderFromCSVTest.java index fdc2aa30d12..10d7118b0c1 100644 --- a/contribs/application/src/test/java/org/matsim/freightDemandGeneration/DemandReaderFromCSVTest.java +++ b/contribs/application/src/test/java/org/matsim/freightDemandGeneration/DemandReaderFromCSVTest.java @@ -18,12 +18,12 @@ import org.matsim.api.core.v01.population.Person; import org.matsim.api.core.v01.population.Population; import org.matsim.application.options.ShpOptions; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierService; -import org.matsim.contrib.freight.carrier.CarrierShipment; -import org.matsim.contrib.freight.carrier.TimeWindow; -import org.matsim.contrib.freight.controler.FreightUtils; +import org.matsim.freight.carriers.FreightConfigGroup; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierService; +import org.matsim.freight.carriers.carrier.CarrierShipment; +import org.matsim.freight.carriers.carrier.TimeWindow; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.network.NetworkUtils; diff --git a/contribs/application/src/test/java/org/matsim/smallScaleCommercialTrafficGeneration/RunGenerateSmallScaleCommercialTrafficTest.java b/contribs/application/src/test/java/org/matsim/smallScaleCommercialTrafficGeneration/RunGenerateSmallScaleCommercialTrafficTest.java index 7e05a64a48e..c1e44d96aaf 100644 --- a/contribs/application/src/test/java/org/matsim/smallScaleCommercialTrafficGeneration/RunGenerateSmallScaleCommercialTrafficTest.java +++ b/contribs/application/src/test/java/org/matsim/smallScaleCommercialTrafficGeneration/RunGenerateSmallScaleCommercialTrafficTest.java @@ -25,9 +25,9 @@ import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.population.Person; import org.matsim.api.core.v01.population.Population; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.controler.FreightUtils; +import org.matsim.freight.carriers.FreightConfigGroup; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.population.PopulationUtils; diff --git a/contribs/application/src/test/java/org/matsim/smallScaleCommercialTrafficGeneration/TrafficVolumeGenerationTest.java b/contribs/application/src/test/java/org/matsim/smallScaleCommercialTrafficGeneration/TrafficVolumeGenerationTest.java index 1d2109fcec7..5833eadb4dd 100644 --- a/contribs/application/src/test/java/org/matsim/smallScaleCommercialTrafficGeneration/TrafficVolumeGenerationTest.java +++ b/contribs/application/src/test/java/org/matsim/smallScaleCommercialTrafficGeneration/TrafficVolumeGenerationTest.java @@ -27,10 +27,10 @@ import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.network.Link; import org.matsim.application.options.ShpOptions; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize; -import org.matsim.contrib.freight.carrier.CarrierUtils; -import org.matsim.contrib.freight.controler.FreightUtils; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierCapabilities.FleetSize; +import org.matsim.freight.carriers.carrier.CarrierUtils; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.scenario.ScenarioUtils; diff --git a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/ChangeCommercialJobOperator.java b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/ChangeCommercialJobOperator.java index 29c3c8662e9..5d44ae94997 100644 --- a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/ChangeCommercialJobOperator.java +++ b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/ChangeCommercialJobOperator.java @@ -23,8 +23,8 @@ import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.population.Activity; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.Carriers; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.Carriers; import org.matsim.core.config.groups.GlobalConfigGroup; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.population.algorithms.PlanAlgorithm; diff --git a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/CommercialJobGenerator.java b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/CommercialJobGenerator.java index 024ab6e45e6..4faafad6785 100644 --- a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/CommercialJobGenerator.java +++ b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/CommercialJobGenerator.java @@ -21,7 +21,7 @@ import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.population.Population; -import org.matsim.contrib.freight.carrier.Carriers; +import org.matsim.freight.carriers.carrier.Carriers; import org.matsim.core.controler.listener.AfterMobsimListener; import org.matsim.core.controler.listener.BeforeMobsimListener; diff --git a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/CommercialTrafficAnalysisListener.java b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/CommercialTrafficAnalysisListener.java index fb67736cd99..26091293d12 100644 --- a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/CommercialTrafficAnalysisListener.java +++ b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/CommercialTrafficAnalysisListener.java @@ -25,8 +25,8 @@ import org.apache.commons.csv.CSVFormat; import org.apache.commons.csv.CSVPrinter; import org.matsim.api.core.v01.Id; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.Carriers; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.Carriers; import org.matsim.core.controler.MatsimServices; import org.matsim.core.controler.events.IterationEndsEvent; import org.matsim.core.controler.listener.IterationEndsListener; @@ -77,7 +77,7 @@ public void notifyIterationEnds(IterationEndsEvent event) { writeIterationCarrierStats(event); writeJobStats(services.getControlerIO().getIterationFilename(event.getIteration(), "commercialJobStats.csv")); analyzeCarrierMarketShares(event.getIteration()); - + firstIteration = false; } diff --git a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/CommercialTrafficChecker.java b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/CommercialTrafficChecker.java index 88e68e04d36..471cdf9a84e 100644 --- a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/CommercialTrafficChecker.java +++ b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/CommercialTrafficChecker.java @@ -27,8 +27,8 @@ import org.matsim.api.core.v01.population.Person; import org.matsim.api.core.v01.population.Plan; import org.matsim.api.core.v01.population.Population; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.Carriers; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.Carriers; import java.util.Collection; import java.util.Map; diff --git a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/DefaultCommercialJobGenerator.java b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/DefaultCommercialJobGenerator.java index c9a1becb44f..0d2c4e52661 100644 --- a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/DefaultCommercialJobGenerator.java +++ b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/DefaultCommercialJobGenerator.java @@ -36,18 +36,18 @@ import org.matsim.api.core.v01.population.Population; import org.matsim.api.core.v01.population.Route; import org.matsim.contrib.drt.run.MultiModeDrtConfigGroup; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierPlanWriter; -import org.matsim.contrib.freight.carrier.CarrierService; -import org.matsim.contrib.freight.carrier.CarrierUtils; -import org.matsim.contrib.freight.carrier.CarrierVehicle; -import org.matsim.contrib.freight.carrier.CarrierVehicleTypes; -import org.matsim.contrib.freight.carrier.Carriers; -import org.matsim.contrib.freight.carrier.CarrierConstants; -import org.matsim.contrib.freight.carrier.ScheduledTour; -import org.matsim.contrib.freight.carrier.TimeWindow; -import org.matsim.contrib.freight.carrier.Tour; -import org.matsim.contrib.freight.jsprit.VRPTransportCostsFactory; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierPlanWriter; +import org.matsim.freight.carriers.carrier.CarrierService; +import org.matsim.freight.carriers.carrier.CarrierUtils; +import org.matsim.freight.carriers.carrier.CarrierVehicle; +import org.matsim.freight.carriers.carrier.CarrierVehicleTypes; +import org.matsim.freight.carriers.carrier.Carriers; +import org.matsim.freight.carriers.carrier.CarrierConstants; +import org.matsim.freight.carriers.carrier.ScheduledTour; +import org.matsim.freight.carriers.carrier.TimeWindow; +import org.matsim.freight.carriers.carrier.Tour; +import org.matsim.freight.carriers.jsprit.VRPTransportCostsFactory; import org.matsim.core.config.Config; import org.matsim.core.config.groups.ReplanningConfigGroup.StrategySettings; import org.matsim.core.controler.events.AfterMobsimEvent; @@ -223,7 +223,7 @@ private Plan createPlainPlanFromTour(Carrier carrier, ScheduledTour scheduledTou plan.addActivity(startActivity); for (Tour.TourElement tourElement : scheduledTour.getTour().getTourElements()) { - if (tourElement instanceof org.matsim.contrib.freight.carrier.Tour.Leg) { + if (tourElement instanceof Tour.Leg) { // Take information from scheduled leg and create a defaultLeg Tour.Leg tourLeg = (Tour.Leg) tourElement; diff --git a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/JointDemandModule.java b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/JointDemandModule.java index 5860e8a5cd9..87977da1288 100644 --- a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/JointDemandModule.java +++ b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/JointDemandModule.java @@ -27,10 +27,10 @@ import org.matsim.contrib.drt.run.MultiModeDrtConfigGroup; import org.matsim.contrib.drt.run.MultiModeDrtModule; import org.matsim.contrib.dvrp.run.DvrpModule; -import org.matsim.contrib.freight.carrier.Carriers; -import org.matsim.contrib.freight.jsprit.NetworkBasedTransportCostsFactory; -import org.matsim.contrib.freight.jsprit.VRPTransportCostsFactory; -import org.matsim.contrib.freight.controler.FreightUtils; +import org.matsim.freight.carriers.carrier.Carriers; +import org.matsim.freight.carriers.jsprit.NetworkBasedTransportCostsFactory; +import org.matsim.freight.carriers.jsprit.VRPTransportCostsFactory; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.core.config.Config; import org.matsim.core.controler.AbstractModule; import org.matsim.core.replanning.PlanStrategy; diff --git a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/JointDemandUtils.java b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/JointDemandUtils.java index 5089e8b9e87..3ca98d6ade6 100644 --- a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/JointDemandUtils.java +++ b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/JointDemandUtils.java @@ -22,9 +22,9 @@ import org.matsim.api.core.v01.population.Activity; import org.matsim.api.core.v01.population.Person; import org.matsim.api.core.v01.population.Plan; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierVehicle; -import org.matsim.contrib.freight.carrier.Carriers; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierVehicle; +import org.matsim.freight.carriers.carrier.Carriers; import javax.annotation.Nullable; import java.util.*; diff --git a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/RunJointDemandCarToggleJspritExample.java b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/RunJointDemandCarToggleJspritExample.java index e2b9e8b9260..6c4da322185 100644 --- a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/RunJointDemandCarToggleJspritExample.java +++ b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/RunJointDemandCarToggleJspritExample.java @@ -22,8 +22,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Scenario; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.controler.FreightUtils; +import org.matsim.freight.carriers.FreightConfigGroup; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.ScoringConfigGroup; diff --git a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/ScoreCommercialJobs.java b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/ScoreCommercialJobs.java index 7cdab223e4b..7baed018f31 100644 --- a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/ScoreCommercialJobs.java +++ b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/ScoreCommercialJobs.java @@ -30,10 +30,10 @@ import org.matsim.api.core.v01.events.handler.ActivityStartEventHandler; import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.population.*; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierService; -import org.matsim.contrib.freight.carrier.Carriers; -import org.matsim.contrib.freight.carrier.CarrierConstants; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierService; +import org.matsim.freight.carriers.carrier.Carriers; +import org.matsim.freight.carriers.carrier.CarrierConstants; import org.matsim.core.api.experimental.events.EventsManager; import java.util.*; diff --git a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/TourLengthAnalyzer.java b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/TourLengthAnalyzer.java index 5ea36ca6528..c448116ac5f 100644 --- a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/TourLengthAnalyzer.java +++ b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/TourLengthAnalyzer.java @@ -33,7 +33,7 @@ import org.matsim.api.core.v01.events.handler.PersonLeavesVehicleEventHandler; import org.matsim.api.core.v01.network.Network; import org.matsim.api.core.v01.population.Person; -import org.matsim.contrib.freight.carrier.CarrierConstants; +import org.matsim.freight.carriers.carrier.CarrierConstants; import org.matsim.core.api.experimental.events.EventsManager; import org.matsim.vehicles.Vehicle; diff --git a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/TourPlanning.java b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/TourPlanning.java index 1a3fd7e9713..314e11224fe 100644 --- a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/TourPlanning.java +++ b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/TourPlanning.java @@ -31,14 +31,15 @@ import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierPlan; -import org.matsim.contrib.freight.carrier.CarrierUtils; -import org.matsim.contrib.freight.carrier.Carriers; -import org.matsim.contrib.freight.jsprit.MatsimJspritFactory; -import org.matsim.contrib.freight.jsprit.NetworkBasedTransportCosts; -import org.matsim.contrib.freight.jsprit.VRPTransportCosts; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierPlan; +import org.matsim.freight.carriers.carrier.CarrierUtils; +import org.matsim.freight.carriers.carrier.Carriers; +import org.matsim.freight.carriers.jsprit.MatsimJspritFactory; +import org.matsim.freight.carriers.jsprit.NetworkBasedTransportCosts; +import org.matsim.freight.carriers.jsprit.VRPTransportCosts; import org.matsim.core.router.util.TravelTime; +import org.matsim.freight.carriers.jsprit.NetworkRouter; import org.matsim.vehicles.VehicleType; import java.util.ArrayList; @@ -91,8 +92,8 @@ static void runTourPlanningForCarriers(Carriers carriers, Scenario scenario, VRP HashMap, Integer> sortedMap = carrierServiceCounterMap.entrySet().stream() .sorted(Collections.reverseOrder(Map.Entry.comparingByValue())) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2, LinkedHashMap::new)); - - + + ArrayList> tempList = new ArrayList<>(sortedMap.keySet()); ForkJoinPool forkJoinPool = new ForkJoinPool(Runtime.getRuntime().availableProcessors()); forkJoinPool.submit(() -> tempList.parallelStream().forEach(carrierId -> { @@ -167,7 +168,7 @@ static void runTourPlanningForCarriers(Carriers carriers, Scenario scenario, VRP CarrierPlan carrierPlan = MatsimJspritFactory.createPlan(carrier, bestSolution); log.info("routing plan for carrier " + carrier.getId()); - org.matsim.contrib.freight.jsprit.NetworkRouter.routePlan(carrierPlan, transportCosts); // we need to route + NetworkRouter.routePlan(carrierPlan, transportCosts); // we need to route // the plans in // order to create // reasonable diff --git a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/examples/RunJointDemandCarExample.java b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/examples/RunJointDemandCarExample.java index a8ba7de6f45..dc8324f75ab 100644 --- a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/examples/RunJointDemandCarExample.java +++ b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/examples/RunJointDemandCarExample.java @@ -25,8 +25,8 @@ import org.matsim.contrib.commercialTrafficApplications.jointDemand.ChangeCommercialJobOperator; import org.matsim.contrib.commercialTrafficApplications.jointDemand.JointDemandConfigGroup; import org.matsim.contrib.commercialTrafficApplications.jointDemand.JointDemandModule; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.controler.FreightUtils; +import org.matsim.freight.carriers.FreightConfigGroup; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.ReplanningConfigGroup; diff --git a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/examples/RunJointDemandDRTExample.java b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/examples/RunJointDemandDRTExample.java index 30619130f39..dcb0cbb0cc3 100644 --- a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/examples/RunJointDemandDRTExample.java +++ b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/examples/RunJointDemandDRTExample.java @@ -36,8 +36,8 @@ import org.matsim.contrib.drt.run.MultiModeDrtConfigGroup; import org.matsim.contrib.dvrp.run.DvrpConfigGroup; import org.matsim.contrib.dvrp.run.DvrpQSimComponents; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.controler.FreightUtils; +import org.matsim.freight.carriers.FreightConfigGroup; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.ScoringConfigGroup; diff --git a/contribs/commercialTrafficApplications/src/test/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/ChangeCommercialJobOperatorTest.java b/contribs/commercialTrafficApplications/src/test/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/ChangeCommercialJobOperatorTest.java index a66096756ac..ecf7813bd97 100644 --- a/contribs/commercialTrafficApplications/src/test/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/ChangeCommercialJobOperatorTest.java +++ b/contribs/commercialTrafficApplications/src/test/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/ChangeCommercialJobOperatorTest.java @@ -7,11 +7,8 @@ import org.matsim.api.core.v01.TransportMode; import org.matsim.api.core.v01.population.Activity; import org.matsim.api.core.v01.population.Plan; -import org.matsim.contrib.commercialTrafficApplications.jointDemand.ChangeCommercialJobOperator; -import org.matsim.contrib.commercialTrafficApplications.jointDemand.JointDemandUtils; -import org.matsim.contrib.commercialTrafficApplications.jointDemand.TestScenarioGeneration; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.Carriers; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.Carriers; import org.matsim.core.router.util.TravelTime; import org.matsim.core.trafficmonitoring.FreeSpeedTravelTime; @@ -49,4 +46,4 @@ public void getPlanAlgoInstance() { } -} \ No newline at end of file +} diff --git a/contribs/commercialTrafficApplications/src/test/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/CommercialTrafficIntegrationTest.java b/contribs/commercialTrafficApplications/src/test/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/CommercialTrafficIntegrationTest.java index 501f4057ae9..14880b6a7a5 100644 --- a/contribs/commercialTrafficApplications/src/test/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/CommercialTrafficIntegrationTest.java +++ b/contribs/commercialTrafficApplications/src/test/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/CommercialTrafficIntegrationTest.java @@ -2,8 +2,8 @@ import org.junit.Test; import org.matsim.api.core.v01.Scenario; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.controler.FreightUtils; +import org.matsim.freight.carriers.FreightConfigGroup; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.controler.Controler; diff --git a/contribs/commercialTrafficApplications/src/test/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/IsTheRightCustomerScoredTest.java b/contribs/commercialTrafficApplications/src/test/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/IsTheRightCustomerScoredTest.java index 339caa1695e..98d4b90baf6 100644 --- a/contribs/commercialTrafficApplications/src/test/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/IsTheRightCustomerScoredTest.java +++ b/contribs/commercialTrafficApplications/src/test/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/IsTheRightCustomerScoredTest.java @@ -27,9 +27,9 @@ import org.matsim.api.core.v01.population.Person; import org.matsim.api.core.v01.population.Plan; import org.matsim.api.core.v01.population.PopulationFactory; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.controler.FreightUtils; +import org.matsim.freight.carriers.FreightConfigGroup; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.controler.Controler; diff --git a/contribs/commercialTrafficApplications/src/test/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/TestScenarioGeneration.java b/contribs/commercialTrafficApplications/src/test/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/TestScenarioGeneration.java index 629c1bbd6c6..b7092208fd6 100644 --- a/contribs/commercialTrafficApplications/src/test/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/TestScenarioGeneration.java +++ b/contribs/commercialTrafficApplications/src/test/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/TestScenarioGeneration.java @@ -26,9 +26,9 @@ import org.matsim.api.core.v01.population.Activity; import org.matsim.api.core.v01.population.Person; import org.matsim.api.core.v01.population.Plan; -import org.matsim.contrib.freight.carrier.*; import org.matsim.core.config.Config; import org.matsim.core.population.PopulationUtils; +import org.matsim.freight.carriers.carrier.*; import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.VehicleType; import org.matsim.vehicles.VehicleUtils; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/HasCarrierId.java b/contribs/freight/src/main/java/org/matsim/contrib/freight/events/HasCarrierId.java deleted file mode 100644 index dbf01dd9590..00000000000 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/HasCarrierId.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.matsim.contrib.freight.events; - -import org.matsim.api.core.v01.Id; -import org.matsim.contrib.freight.carrier.Carrier; - -/** - * @author Kai Martins-Turner (kturner) - */ -public interface HasCarrierId { - String ATTRIBUTE_CARRIER_ID = "carrierId"; - - Id getCarrierId(); -} diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/eventhandler/Vehicle2CarrierEventHandler.java b/contribs/freight/src/main/java/org/matsim/contrib/freight/events/eventhandler/Vehicle2CarrierEventHandler.java deleted file mode 100644 index 0757c8b1333..00000000000 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/eventhandler/Vehicle2CarrierEventHandler.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * *********************************************************************** * - * * project: org.matsim.* * - * * * - * * *********************************************************************** * - * * * - * * copyright : (C) 2022 by the members listed in the COPYING, * - * * LICENSE and WARRANTY file. * - * * email : info at matsim dot org * - * * * - * * *********************************************************************** * - * * * - * * This program is free software; you can redistribute it and/or modify * - * * it under the terms of the GNU General Public License as published by * - * * the Free Software Foundation; either version 2 of the License, or * - * * (at your option) any later version. * - * * See also COPYING, LICENSE and WARRANTY file * - * * * - * * *********************************************************************** - */ -package org.matsim.contrib.freight.events.eventhandler; - -import org.matsim.api.core.v01.Id; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.events.CarrierTourEndEvent; -import org.matsim.contrib.freight.events.CarrierTourStartEvent; -import org.matsim.vehicles.Vehicle; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -/** - * Basic event handler that collects the relation between vehicles and carrier. - * Necessary since link enter and leave events do not contain any information of the carrier. - * For the connection between driver and Vehicle the {@link Vehicle2CarrierEventHandler} can be used. - * - * @author kturner - */ -public final class Vehicle2CarrierEventHandler implements FreightTourStartEventHandler, FreightTourEndEventHandler { - - - // Comment from Janek (in https://github.com/matsim-org/matsim-libs/pull/2128) - // Is this handler ever going to be called concurrently? If not a normal HashMap is probably sufficient - // At least the default events manager guarantees single threaded invocation of your handler. - // --> we can check this. Currently, it was made only analogous to Vehicle2DriverEventHandler kmt sep'22 - private final Map, Id> carrierVehicles = new ConcurrentHashMap<>(); - - @Override - public void reset(int iteration) { - carrierVehicles.clear(); - } - - @Override - public void handleEvent(CarrierTourStartEvent event) { - carrierVehicles.put(event.getVehicleId(), event.getCarrierId()); - } - - @Override - public void handleEvent(CarrierTourEndEvent event) { - carrierVehicles.remove(event.getVehicleId()); - } - - /** - * @param vehicleId the unique vehicle identifier. - * @return person id of the driver - */ - public Id getCarrierOfVehicle(Id vehicleId){ - return carrierVehicles.get(vehicleId); - } -} diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/NetworkRouter.java b/contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/NetworkRouter.java deleted file mode 100644 index 4d43abb8e73..00000000000 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/NetworkRouter.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 Stefan Schroeder. - * eMail: stefan.schroeder@kit.edu - *

- * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Public License v2.0 - * which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - *

- * Contributors: - * Stefan Schroeder - initial API and implementation - ******************************************************************************/ -package org.matsim.contrib.freight.jsprit; - -import org.matsim.contrib.freight.carrier.CarrierPlan; -import org.matsim.contrib.freight.carrier.ScheduledTour; -import org.matsim.contrib.freight.controler.CarrierTimeAndSpaceTourRouter; - -/** - * Router that routes {@link CarrierPlan}. - * - * @author stefan schröder - * - */ -public class NetworkRouter { - - /** - * Routes the {@link CarrierPlan} with the router defined in {@link NetworkBasedTransportCosts}. - * - *

Note that this changes the plan, i.e. it adds routes to the input-plan. - * - * @param {@link CarrierPlan} - * @param {@link NetworkBasedTransportCosts} - */ - public static void routePlan(CarrierPlan plan, VRPTransportCosts freightTransportCosts){ - if( plan == null) throw new IllegalStateException("plan is missing."); - for( ScheduledTour tour : plan.getScheduledTours()){ - new CarrierTimeAndSpaceTourRouter( freightTransportCosts.getRouter(), freightTransportCosts.getNetwork(), freightTransportCosts.getTravelTime()).route(tour ); - } - } - -} diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/FreightConfigGroup.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/FreightConfigGroup.java similarity index 85% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/FreightConfigGroup.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/FreightConfigGroup.java index a8bc1db3e98..7c5da781595 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/FreightConfigGroup.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/FreightConfigGroup.java @@ -1,27 +1,30 @@ -/* *********************************************************************** * - * project: org.matsim.* - * *********************************************************************** * - * * - * copyright : (C) 2007 by the members listed in the COPYING, * - * LICENSE and WARRANTY file. * - * email : info at matsim dot org * - * * - * *********************************************************************** * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * See also COPYING, LICENSE and WARRANTY file * - * * - * *********************************************************************** */ - -package org.matsim.contrib.freight; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers; +import jakarta.validation.constraints.Positive; import org.matsim.core.config.ConfigGroup; import org.matsim.core.config.ReflectiveConfigGroup; -import jakarta.validation.constraints.Positive; import java.net.URL; import java.util.Map; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/Carrier.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/Carrier.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/Carrier.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/Carrier.java index 52812bfbac7..29ddead11a6 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/Carrier.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/Carrier.java @@ -19,15 +19,15 @@ * */ -package org.matsim.contrib.freight.carrier; - -import java.util.List; -import java.util.Map; +package org.matsim.freight.carriers.carrier; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.population.HasPlansAndId; import org.matsim.utils.objectattributes.attributable.Attributable; +import java.util.List; +import java.util.Map; + /** * A carrier. * diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierCapabilities.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierCapabilities.java similarity index 99% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierCapabilities.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierCapabilities.java index 08808a2db6c..e0078021f38 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierCapabilities.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierCapabilities.java @@ -19,14 +19,14 @@ * */ -package org.matsim.contrib.freight.carrier; - -import java.util.*; +package org.matsim.freight.carriers.carrier; import org.matsim.api.core.v01.Id; import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.VehicleType; +import java.util.*; + /** * This contains the capabilities/resources a carrier has/can deploy. * diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierConstants.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierConstants.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierConstants.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierConstants.java index 4382b2b5bd9..b7dc2e3a5f9 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierConstants.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierConstants.java @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.carrier; +package org.matsim.freight.carriers.carrier; public class CarrierConstants { diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierImpl.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierImpl.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierImpl.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierImpl.java index 706010e95f5..b51274fa1a9 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierImpl.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierImpl.java @@ -19,17 +19,17 @@ * */ -package org.matsim.contrib.freight.carrier; +package org.matsim.freight.carriers.carrier; + +import org.matsim.api.core.v01.Id; +import org.matsim.utils.objectattributes.attributable.Attributes; +import org.matsim.utils.objectattributes.attributable.AttributesImpl; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import org.matsim.api.core.v01.Id; -import org.matsim.utils.objectattributes.attributable.Attributes; -import org.matsim.utils.objectattributes.attributable.AttributesImpl; - /** * This is a carrier that has capabilities and resources, jobs and plans to fulfill its obligations. *

diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierPlan.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierPlan.java similarity index 97% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierPlan.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierPlan.java index b63e0556eb8..77c1c43d2a0 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierPlan.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierPlan.java @@ -19,15 +19,16 @@ * */ -package org.matsim.contrib.freight.carrier; +package org.matsim.freight.carriers.carrier; -import java.util.Collection; import org.matsim.api.core.v01.population.BasicPlan; -import org.matsim.contrib.freight.controler.FreightUtils; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.utils.objectattributes.attributable.Attributable; import org.matsim.utils.objectattributes.attributable.Attributes; import org.matsim.utils.objectattributes.attributable.AttributesImpl; +import java.util.Collection; + /** * * A specific plan of a carrier, and its score. diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierPlanReaderV1.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierPlanReaderV1.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierPlanReaderV1.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierPlanReaderV1.java index ea924762842..7fa4ed91f4a 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierPlanReaderV1.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierPlanReaderV1.java @@ -19,14 +19,7 @@ * */ -package org.matsim.contrib.freight.carrier; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Stack; +package org.matsim.freight.carriers.carrier; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -41,6 +34,8 @@ import org.matsim.vehicles.VehicleType; import org.xml.sax.Attributes; +import java.util.*; + /** * A reader that reads carriers and their plans. * diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierPlanWriter.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierPlanWriter.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierPlanWriter.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierPlanWriter.java index 4a20ad55610..87447a0d0a2 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierPlanWriter.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierPlanWriter.java @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.carrier; +package org.matsim.freight.carriers.carrier; import com.google.inject.Inject; import org.matsim.utils.objectattributes.AttributeConverter; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlParserV2.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlParserV2.java similarity index 97% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlParserV2.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlParserV2.java index 42b4ca52eac..38ab9e33745 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlParserV2.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlParserV2.java @@ -19,33 +19,30 @@ * */ -package org.matsim.contrib.freight.carrier; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Stack; +package org.matsim.freight.carriers.carrier; import com.google.inject.Inject; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Link; -import org.matsim.contrib.freight.carrier.CarrierCapabilities.Builder; -import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize; import org.matsim.core.gbl.Gbl; import org.matsim.core.network.NetworkUtils; import org.matsim.core.population.routes.NetworkRoute; import org.matsim.core.population.routes.RouteUtils; import org.matsim.core.utils.io.MatsimXmlParser; import org.matsim.core.utils.misc.Time; +import org.matsim.freight.carriers.carrier.CarrierCapabilities.Builder; +import org.matsim.freight.carriers.carrier.CarrierCapabilities.FleetSize; import org.matsim.utils.objectattributes.AttributeConverter; import org.matsim.utils.objectattributes.attributable.AttributesXmlReaderDelegate; -import org.matsim.vehicles.*; +import org.matsim.vehicles.Vehicle; +import org.matsim.vehicles.VehicleType; import org.xml.sax.Attributes; -import static org.matsim.contrib.freight.carrier.CarrierConstants.*; + +import java.util.*; + +import static org.matsim.freight.carriers.carrier.CarrierConstants.*; class CarrierPlanXmlParserV2 extends MatsimXmlParser { diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlParserV2_1.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlParserV2_1.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlParserV2_1.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlParserV2_1.java index ac34b2fef83..0007f6fa2f6 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlParserV2_1.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlParserV2_1.java @@ -19,21 +19,21 @@ * */ -package org.matsim.contrib.freight.carrier; +package org.matsim.freight.carriers.carrier; import com.google.inject.Inject; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Link; -import org.matsim.contrib.freight.carrier.CarrierCapabilities.Builder; -import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize; import org.matsim.core.gbl.Gbl; import org.matsim.core.network.NetworkUtils; import org.matsim.core.population.routes.NetworkRoute; import org.matsim.core.population.routes.RouteUtils; import org.matsim.core.utils.io.MatsimXmlParser; import org.matsim.core.utils.misc.Time; +import org.matsim.freight.carriers.carrier.CarrierCapabilities.Builder; +import org.matsim.freight.carriers.carrier.CarrierCapabilities.FleetSize; import org.matsim.utils.objectattributes.AttributeConverter; import org.matsim.utils.objectattributes.attributable.AttributesXmlReaderDelegate; import org.matsim.vehicles.Vehicle; @@ -42,7 +42,7 @@ import java.util.*; -import static org.matsim.contrib.freight.carrier.CarrierConstants.*; +import static org.matsim.freight.carriers.carrier.CarrierConstants.*; class CarrierPlanXmlParserV2_1 extends MatsimXmlParser { diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlReader.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlReader.java similarity index 99% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlReader.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlReader.java index 9a97bf55522..cb5acfed7f5 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlReader.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlReader.java @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.carrier; +package org.matsim.freight.carriers.carrier; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlWriterV1.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlWriterV1.java similarity index 95% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlWriterV1.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlWriterV1.java index edfb26cefeb..d4732408b46 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlWriterV1.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlWriterV1.java @@ -19,27 +19,23 @@ * */ -package org.matsim.contrib.freight.carrier; - -import java.io.BufferedWriter; -import java.io.IOException; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; +package org.matsim.freight.carriers.carrier; import com.graphhopper.jsprit.core.problem.job.Shipment; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Link; -import org.matsim.contrib.freight.carrier.Tour.Leg; -import org.matsim.contrib.freight.carrier.Tour.ShipmentBasedActivity; -import org.matsim.contrib.freight.carrier.Tour.TourElement; import org.matsim.core.population.routes.NetworkRoute; import org.matsim.core.utils.io.MatsimXmlWriter; import org.matsim.core.utils.misc.Time; +import java.io.BufferedWriter; +import java.io.IOException; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + /** * A writer that writes carriers and their plans in a xml-file. * @@ -181,8 +177,8 @@ private void writePlans(Carrier carrier, BufferedWriter writer) writer.write("\t\t\t\t\t\n"); - for (TourElement tourElement : tour.getTour().getTourElements()) { - if (tourElement instanceof Leg leg) { + for (Tour.TourElement tourElement : tour.getTour().getTourElements()) { + if (tourElement instanceof Tour.Leg leg) { writer.write("\t\t\t\t\t\n"); } } - if (tourElement instanceof ShipmentBasedActivity act) { + if (tourElement instanceof Tour.ShipmentBasedActivity act) { writer.write("\t\t\t\t\t id, Id locationLinkId){ return new Builder(id,locationLinkId); } - + private final Id id; private final Id locationLinkId; private String name = "service"; - + private double serviceTime = 0.0; private TimeWindow timeWindow = TimeWindow.newInstance(0.0, Integer.MAX_VALUE); private int capacityDemand = 0; - + private Builder(Id id, Id locationLinkId) { super(); this.id = id; this.locationLinkId = locationLinkId; } - + public Builder setName(String name){ this.name = name; return this; } - + /** * By default it is [0.0,Integer.MaxValue]. - * + * * @param serviceDuration * @return */ @@ -65,13 +65,13 @@ public Builder setServiceDuration(double serviceDuration){ this.serviceTime = serviceDuration; return this; } - + /** * Sets a time-window for the service. - * + * *

Note that the time-window restricts the start-time of the service (i.e. serviceActivity). If one works with hard time-windows (which means that * time-windows must be met) than the service is allowed to start between startTimeWindow.getStart() and startTimeWindow.getEnd(). - * + * * @param startTimeWindow * @return */ @@ -79,7 +79,7 @@ public Builder setServiceStartTimeWindow(TimeWindow startTimeWindow){ this.timeWindow = startTimeWindow; return this; } - + public CarrierService build(){ return new CarrierService(this); } @@ -88,16 +88,16 @@ public Builder setCapacityDemand(int value) { this.capacityDemand = value; return this; } - + } - - + + private final Id id; private final Id locationId; - + private final String name; - + private final double serviceDuration; private final TimeWindow timeWindow; @@ -130,7 +130,7 @@ public double getServiceDuration() { public TimeWindow getServiceStartTimeWindow(){ return timeWindow; } - + public int getCapacityDemand() { return demand; } @@ -180,6 +180,6 @@ public boolean equals(Object obj) { } else return id.equals(other.id); } - - + + } diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierShipment.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierShipment.java similarity index 99% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierShipment.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierShipment.java index 07bee15376d..516484b3015 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierShipment.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierShipment.java @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.carrier; +package org.matsim.freight.carriers.carrier; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Link; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierUtils.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierUtils.java similarity index 99% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierUtils.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierUtils.java index a2f2c0d4cdb..37aed64d38b 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierUtils.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierUtils.java @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.carrier; +package org.matsim.freight.carriers.carrier; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicle.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicle.java similarity index 99% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicle.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicle.java index 314c3e56a2f..d0288621dad 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicle.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicle.java @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.carrier; +package org.matsim.freight.carriers.carrier; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicleType.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicleType.java similarity index 99% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicleType.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicleType.java index 89cae4f6f63..82600bb4b1f 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicleType.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicleType.java @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.carrier; +package org.matsim.freight.carriers.carrier; import org.matsim.api.core.v01.Id; import org.matsim.vehicles.VehicleType; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeLoader.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeLoader.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeLoader.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeLoader.java index d71e1562ed7..7aeaba2da3d 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeLoader.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeLoader.java @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.carrier; +package org.matsim.freight.carriers.carrier; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeReader.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeReader.java similarity index 99% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeReader.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeReader.java index c8f55f0344e..be2ec4e3e07 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeReader.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeReader.java @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.carrier; +package org.matsim.freight.carriers.carrier; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeReaderV1.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeReaderV1.java similarity index 99% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeReaderV1.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeReaderV1.java index fcc30581b16..aee8dfac36b 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeReaderV1.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeReaderV1.java @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.carrier; +package org.matsim.freight.carriers.carrier; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeWriter.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeWriter.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeWriter.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeWriter.java index ec8a6a86a88..6f423686b51 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeWriter.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeWriter.java @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.carrier; +package org.matsim.freight.carriers.carrier; import org.matsim.api.core.v01.Id; import org.matsim.core.api.internal.MatsimWriter; @@ -32,7 +32,7 @@ /** * A writer that writes carriers and their plans in a xml-file. - * + * * @author sschroeder * */ diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeWriterV1.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeWriterV1.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeWriterV1.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeWriterV1.java index f65029abd09..bec3b89dd37 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeWriterV1.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeWriterV1.java @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.carrier; +package org.matsim.freight.carriers.carrier; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypes.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypes.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypes.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypes.java index a2e8399cfaa..93d7028f6fd 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypes.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypes.java @@ -19,14 +19,14 @@ * */ -package org.matsim.contrib.freight.carrier; - -import java.util.HashMap; -import java.util.Map; +package org.matsim.freight.carriers.carrier; import org.matsim.api.core.v01.Id; import org.matsim.vehicles.VehicleType; +import java.util.HashMap; +import java.util.Map; + /** * VehicleTypeContainer mapping all vehicleTypes. * diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/Carriers.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/Carriers.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/Carriers.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/Carriers.java index ca801c90f90..1268b09f18a 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/Carriers.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/Carriers.java @@ -19,17 +19,16 @@ * */ -package org.matsim.contrib.freight.carrier; - -import java.util.Collection; -import java.util.LinkedHashMap; -import java.util.Map; +package org.matsim.freight.carriers.carrier; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; - import org.matsim.api.core.v01.Id; +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.Map; + /** * A container that maps carriers. * diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/ScheduledTour.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/ScheduledTour.java similarity index 97% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/ScheduledTour.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/ScheduledTour.java index f8769b4070f..e8e2f4250e6 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/ScheduledTour.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/ScheduledTour.java @@ -19,24 +19,24 @@ * */ -package org.matsim.contrib.freight.carrier; +package org.matsim.freight.carriers.carrier; /** * A concrete assignment of a tour, a vehicle and a departure time. - * + * * @author sschroeder, mzilske * */ public class ScheduledTour { - + /** * Returns a new instance of ScheduledTour. - * - *

Look at the builder. It might be easier to build a scheduled tour. + * + *

Look at the builder. It might be easier to build a scheduled tour. * You get the builder this way: ScheduledTour.Builder.newInstance(carrierVehicle). - * + * * @param tour * @param vehicle * @param departureTime @@ -46,7 +46,7 @@ public class ScheduledTour { public static ScheduledTour newInstance(Tour tour, CarrierVehicle vehicle, double departureTime){ return new ScheduledTour(tour,vehicle,departureTime); } - + private final Tour tour; private final CarrierVehicle vehicle; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/TimeWindow.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/TimeWindow.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/TimeWindow.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/TimeWindow.java index c198aa2ed79..d835d3845c8 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/TimeWindow.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/TimeWindow.java @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.carrier; +package org.matsim.freight.carriers.carrier; import org.matsim.core.utils.misc.Time; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/Tour.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/Tour.java similarity index 99% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/Tour.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/Tour.java index b1cadaef2cc..25fe3ee7894 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/carrier/Tour.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/carrier/Tour.java @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.carrier; +package org.matsim.freight.carriers.carrier; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierAgent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierAgent.java similarity index 91% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierAgent.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierAgent.java index cfe0cea13dc..ebb5c165865 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierAgent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierAgent.java @@ -19,36 +19,27 @@ * */ -package org.matsim.contrib.freight.controler; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +package org.matsim.freight.carriers.controler; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Identifiable; -import org.matsim.api.core.v01.events.*; -import org.matsim.api.core.v01.population.Activity; -import org.matsim.api.core.v01.population.Leg; -import org.matsim.api.core.v01.population.Person; -import org.matsim.api.core.v01.population.Plan; -import org.matsim.api.core.v01.population.Route; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.carrier.Tour.TourActivity; -import org.matsim.contrib.freight.carrier.Tour.TourElement; -import org.matsim.contrib.freight.events.CarrierEventCreator; +import org.matsim.api.core.v01.events.Event; +import org.matsim.api.core.v01.population.*; import org.matsim.core.api.experimental.events.EventsManager; import org.matsim.core.gbl.Gbl; import org.matsim.core.population.PopulationUtils; import org.matsim.core.scoring.ScoringFunction; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.carrier.Tour.TourActivity; +import org.matsim.freight.carriers.carrier.Tour.TourElement; +import org.matsim.freight.carriers.events.CarrierEventCreator; import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.VehicleUtils; +import java.util.*; + /** * This keeps track of the carrier during simulation. * diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierAgentTracker.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierAgentTracker.java similarity index 95% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierAgentTracker.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierAgentTracker.java index b93698f9034..cfa6b18b59d 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierAgentTracker.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierAgentTracker.java @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.controler; +package org.matsim.freight.carriers.controler; import com.google.inject.Inject; import org.apache.logging.log4j.LogManager; @@ -27,13 +27,13 @@ import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.*; import org.matsim.api.core.v01.population.Person; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.Carriers; -import org.matsim.contrib.freight.events.CarrierEventCreator; -import org.matsim.contrib.freight.events.CarrierEventCreatorUtils; import org.matsim.core.api.experimental.events.EventsManager; import org.matsim.core.events.algorithms.Vehicle2DriverEventHandler; import org.matsim.core.events.handler.BasicEventHandler; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.Carriers; +import org.matsim.freight.carriers.events.CarrierEventCreator; +import org.matsim.freight.carriers.events.CarrierEventCreatorUtils; import java.util.*; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierControlerListener.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierControlerListener.java similarity index 65% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierControlerListener.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierControlerListener.java index afbc91c7c8a..156c3fe4fe2 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierControlerListener.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierControlerListener.java @@ -1,28 +1,27 @@ /* - * *********************************************************************** * -// * * project: org.matsim.* - * * ${file_name} - * * * - * * *********************************************************************** * - * * * - * * copyright : (C) ${year} by the members listed in the COPYING, * - * * LICENSE and WARRANTY file. * - * * email : info at matsim dot org * - * * * - * * *********************************************************************** * - * * * - * * This program is free software; you can redistribute it and/or modify * - * * it under the terms of the GNU General Public License as published by * - * * the Free Software Foundation; either version 2 of the License, or * - * * (at your option) any later version. * - * * See also COPYING, LICENSE and WARRANTY file * - * * * - * * *********************************************************************** + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** * */ -package org.matsim.contrib.freight.controler; +package org.matsim.freight.carriers.controler; +import jakarta.inject.Inject; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Scenario; @@ -32,7 +31,6 @@ import org.matsim.core.controler.listener.ScoringListener; import javax.annotation.Nullable; -import jakarta.inject.Inject; /** * Controls the workflow of the simulation. diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierDriverAgent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierDriverAgent.java similarity index 87% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierDriverAgent.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierDriverAgent.java index 2a39409b5f9..eb52fe3770c 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierDriverAgent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierDriverAgent.java @@ -1,4 +1,25 @@ -package org.matsim.contrib.freight.controler; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.controler; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -11,13 +32,13 @@ import org.matsim.api.core.v01.population.Leg; import org.matsim.api.core.v01.population.Person; import org.matsim.api.core.v01.population.Route; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.events.CarrierEventCreator; import org.matsim.core.api.experimental.events.EventsManager; import org.matsim.core.population.PopulationUtils; import org.matsim.core.population.routes.NetworkRoute; import org.matsim.core.population.routes.RouteUtils; import org.matsim.core.scoring.ScoringFunction; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.events.CarrierEventCreator; import org.matsim.vehicles.Vehicle; import java.util.ArrayList; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierModule.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierModule.java similarity index 78% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierModule.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierModule.java index 2e4a2980780..4ed43f82baa 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierModule.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierModule.java @@ -1,26 +1,25 @@ /* - * *********************************************************************** * - * * project: org.matsim.* - * * CarrierModule.java - * * * - * * *********************************************************************** * - * * * - * * copyright : (C) 2015 by the members listed in the COPYING, * - * * LICENSE and WARRANTY file. * - * * email : info at matsim dot org * - * * * - * * *********************************************************************** * - * * * - * * This program is free software; you can redistribute it and/or modify * - * * it under the terms of the GNU General Public License as published by * - * * the Free Software Foundation; either version 2 of the License, or * - * * (at your option) any later version. * - * * See also COPYING, LICENSE and WARRANTY file * - * * * - * * *********************************************************************** + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * */ -package org.matsim.contrib.freight.controler; +package org.matsim.freight.carriers.controler; import com.google.inject.Inject; import com.google.inject.Provider; @@ -29,8 +28,6 @@ import org.matsim.api.core.v01.events.Event; import org.matsim.api.core.v01.population.Activity; import org.matsim.api.core.v01.population.Leg; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.carrier.*; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.controler.AbstractModule; @@ -39,6 +36,8 @@ import org.matsim.core.mobsim.qsim.AbstractQSimModule; import org.matsim.core.mobsim.qsim.components.QSimComponentsConfigGroup; import org.matsim.core.scoring.ScoringFunction; +import org.matsim.freight.carriers.FreightConfigGroup; +import org.matsim.freight.carriers.carrier.*; import java.util.List; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierReRouteVehicles.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierReRouteVehicles.java similarity index 68% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierReRouteVehicles.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierReRouteVehicles.java index 27d1153f804..7a3e26e4263 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierReRouteVehicles.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierReRouteVehicles.java @@ -1,34 +1,36 @@ -/* *********************************************************************** * - * project: org.matsim.* - * * - * *********************************************************************** * - * * - * copyright : (C) 2012 by the members listed in the COPYING, * - * LICENSE and WARRANTY file. * - * email : info at matsim dot org * - * * - * *********************************************************************** * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * See also COPYING, LICENSE and WARRANTY file * - * * - * *********************************************************************** */ +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ -package org.matsim.contrib.freight.controler; +package org.matsim.freight.carriers.controler; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.network.Network; -import org.matsim.contrib.freight.carrier.CarrierPlan; -import org.matsim.contrib.freight.carrier.ScheduledTour; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.replanning.ReplanningContext; import org.matsim.core.replanning.modules.GenericPlanStrategyModule; import org.matsim.core.router.util.LeastCostPathCalculator; import org.matsim.core.router.util.TravelTime; +import org.matsim.freight.carriers.carrier.CarrierPlan; +import org.matsim.freight.carriers.carrier.ScheduledTour; /** * Strategy module to reRoute a carrierPlan. diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierScoringFunctionFactory.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierScoringFunctionFactory.java similarity index 93% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierScoringFunctionFactory.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierScoringFunctionFactory.java index d412280b6cd..24dc40548ae 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierScoringFunctionFactory.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierScoringFunctionFactory.java @@ -19,10 +19,10 @@ * */ -package org.matsim.contrib.freight.controler; +package org.matsim.freight.carriers.controler; -import org.matsim.contrib.freight.carrier.Carrier; import org.matsim.core.scoring.ScoringFunction; +import org.matsim.freight.carriers.carrier.Carrier; public interface CarrierScoringFunctionFactory { diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierStrategyManager.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierStrategyManager.java similarity index 93% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierStrategyManager.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierStrategyManager.java index 5fa8140a3ee..299fbb34ae7 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierStrategyManager.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierStrategyManager.java @@ -19,12 +19,12 @@ * */ -package org.matsim.contrib.freight.controler; +package org.matsim.freight.carriers.controler; import com.google.inject.Provider; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierPlan; import org.matsim.core.replanning.GenericStrategyManager; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierPlan; /** * The current (jul'22) logic of this is:

    diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierStrategyManagerImpl.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierStrategyManagerImpl.java similarity index 54% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierStrategyManagerImpl.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierStrategyManagerImpl.java index 1d9dbd2694c..bedc43262d6 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierStrategyManagerImpl.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierStrategyManagerImpl.java @@ -1,14 +1,34 @@ -package org.matsim.contrib.freight.controler; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.controler; import org.matsim.api.core.v01.population.HasPlansAndId; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierPlan; -import org.matsim.contrib.freight.controler.CarrierStrategyManager; import org.matsim.core.replanning.GenericPlanStrategy; import org.matsim.core.replanning.GenericStrategyManager; import org.matsim.core.replanning.GenericStrategyManagerImpl; import org.matsim.core.replanning.ReplanningContext; import org.matsim.core.replanning.selectors.PlanSelector; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierPlan; import java.util.List; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierTimeAllocationMutator.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierTimeAllocationMutator.java similarity index 65% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierTimeAllocationMutator.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierTimeAllocationMutator.java index 18fdf8f54c0..54f406baefc 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierTimeAllocationMutator.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierTimeAllocationMutator.java @@ -1,31 +1,33 @@ -/* *********************************************************************** * - * project: org.matsim.* * - * * - * *********************************************************************** * - * * - * copyright : (C) 2008 by the members listed in the COPYING, * - * LICENSE and WARRANTY file. * - * email : info at matsim dot org * - * * - * *********************************************************************** * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * See also COPYING, LICENSE and WARRANTY file * - * * - * *********************************************************************** */ -package org.matsim.contrib.freight.controler; - -import java.util.ArrayList; -import java.util.Collection; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ +package org.matsim.freight.carriers.controler; -import org.matsim.contrib.freight.carrier.CarrierPlan; -import org.matsim.contrib.freight.carrier.ScheduledTour; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.replanning.ReplanningContext; import org.matsim.core.replanning.modules.GenericPlanStrategyModule; +import org.matsim.freight.carriers.carrier.CarrierPlan; +import org.matsim.freight.carriers.carrier.ScheduledTour; + +import java.util.ArrayList; +import java.util.Collection; /** * @author nagel diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierTimeAndSpaceTourRouter.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierTimeAndSpaceTourRouter.java similarity index 94% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierTimeAndSpaceTourRouter.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierTimeAndSpaceTourRouter.java index 1bf53c04623..7d627ffa687 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierTimeAndSpaceTourRouter.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierTimeAndSpaceTourRouter.java @@ -19,31 +19,31 @@ * */ -package org.matsim.contrib.freight.controler; - -import java.util.ArrayList; -import java.util.List; +package org.matsim.freight.carriers.controler; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.network.Network; -import org.matsim.contrib.freight.carrier.CarrierVehicle; -import org.matsim.contrib.freight.carrier.ScheduledTour; -import org.matsim.contrib.freight.carrier.Tour.Leg; -import org.matsim.contrib.freight.carrier.Tour.TourActivity; -import org.matsim.contrib.freight.carrier.Tour.TourElement; import org.matsim.core.population.routes.NetworkRoute; import org.matsim.core.population.routes.RouteUtils; import org.matsim.core.router.util.LeastCostPathCalculator; import org.matsim.core.router.util.LeastCostPathCalculator.Path; import org.matsim.core.router.util.TravelTime; +import org.matsim.freight.carriers.carrier.CarrierVehicle; +import org.matsim.freight.carriers.carrier.ScheduledTour; +import org.matsim.freight.carriers.carrier.Tour.Leg; +import org.matsim.freight.carriers.carrier.Tour.TourActivity; +import org.matsim.freight.carriers.carrier.Tour.TourElement; import org.matsim.utils.objectattributes.attributable.Attributes; import org.matsim.utils.objectattributes.attributable.AttributesImpl; import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.VehicleType; +import java.util.ArrayList; +import java.util.List; + /** * Router routing scheduledTours. * diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierVehicleReRouter.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierVehicleReRouter.java similarity index 95% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierVehicleReRouter.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierVehicleReRouter.java index 6ce15469347..2034e447ac6 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/CarrierVehicleReRouter.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierVehicleReRouter.java @@ -19,9 +19,7 @@ * */ -package org.matsim.contrib.freight.controler; - -import java.util.Collection; +package org.matsim.freight.carriers.controler; import com.graphhopper.jsprit.core.algorithm.VehicleRoutingAlgorithm; import com.graphhopper.jsprit.core.algorithm.state.StateManager; @@ -37,17 +35,18 @@ import com.graphhopper.jsprit.io.algorithm.AlgorithmConfig; import com.graphhopper.jsprit.io.algorithm.AlgorithmConfigXmlReader; import com.graphhopper.jsprit.io.algorithm.VehicleRoutingAlgorithms; - import org.matsim.api.core.v01.network.Network; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierPlan; -import org.matsim.contrib.freight.carrier.CarrierVehicleTypes; -import org.matsim.contrib.freight.jsprit.MatsimJspritFactory; -import org.matsim.contrib.freight.jsprit.NetworkBasedTransportCosts; -import org.matsim.contrib.freight.jsprit.VehicleTypeDependentRoadPricingCalculator; import org.matsim.core.replanning.ReplanningContext; import org.matsim.core.replanning.modules.GenericPlanStrategyModule; import org.matsim.core.router.util.TravelTime; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierPlan; +import org.matsim.freight.carriers.carrier.CarrierVehicleTypes; +import org.matsim.freight.carriers.jsprit.MatsimJspritFactory; +import org.matsim.freight.carriers.jsprit.NetworkBasedTransportCosts; +import org.matsim.freight.carriers.jsprit.VehicleTypeDependentRoadPricingCalculator; + +import java.util.Collection; class CarrierVehicleReRouter implements GenericPlanStrategyModule{ diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/FreightActivity.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/FreightActivity.java similarity index 97% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/controler/FreightActivity.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controler/FreightActivity.java index cabfe8b35e1..8e02571389b 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/FreightActivity.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/FreightActivity.java @@ -19,29 +19,29 @@ * */ -package org.matsim.contrib.freight.controler; +package org.matsim.freight.carriers.controler; import org.matsim.api.core.v01.Coord; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.population.Activity; -import org.matsim.contrib.freight.carrier.TimeWindow; import org.matsim.core.utils.misc.OptionalTime; import org.matsim.facilities.ActivityFacility; +import org.matsim.freight.carriers.carrier.TimeWindow; import org.matsim.utils.objectattributes.attributable.Attributes; public class FreightActivity implements Activity { private final Activity act; - + private final TimeWindow timeWindow; - + public FreightActivity(Activity act, TimeWindow timeWindow) { super(); this.act = act; this.timeWindow = timeWindow; } - + public TimeWindow getTimeWindow(){ return timeWindow; } diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/FreightAgentSource.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/FreightAgentSource.java similarity index 67% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/controler/FreightAgentSource.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controler/FreightAgentSource.java index 18c39f8f2b7..02da4e926b6 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/FreightAgentSource.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/FreightAgentSource.java @@ -1,30 +1,25 @@ /* - * *********************************************************************** * - * * project: org.matsim.* - * * ${file_name} - * * * - * * *********************************************************************** * - * * * - * * copyright : (C) ${year} by the members listed in the COPYING, * - * * LICENSE and WARRANTY file. * - * * email : info at matsim dot org * - * * * - * * *********************************************************************** * - * * * - * * This program is free software; you can redistribute it and/or modify * - * * it under the terms of the GNU General Public License as published by * - * * the Free Software Foundation; either version 2 of the License, or * - * * (at your option) any later version. * - * * See also COPYING, LICENSE and WARRANTY file * - * * * - * * *********************************************************************** + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** * */ -package org.matsim.contrib.freight.controler; - -import java.util.ArrayList; -import java.util.Collection; +package org.matsim.freight.carriers.controler; import com.google.inject.Inject; import org.apache.logging.log4j.LogManager; @@ -38,6 +33,9 @@ import org.matsim.core.mobsim.qsim.qnetsimengine.QVehicleImpl; import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.VehicleUtils; + +import java.util.ArrayList; +import java.util.Collection; /** * Created by IntelliJ IDEA. User: zilske Date: 10/31/11 Time: 5:59 PM To change * this template use File | Settings | File Templates. diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/FreightUtils.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/FreightUtils.java similarity index 93% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/controler/FreightUtils.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controler/FreightUtils.java index c56598c5968..10e0b481547 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/FreightUtils.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/FreightUtils.java @@ -1,22 +1,25 @@ -/* *********************************************************************** * - * project: org.matsim.* - * *********************************************************************** * - * * - * copyright : (C) 2018 by the members listed in the COPYING, * - * LICENSE and WARRANTY file. * - * email : info at matsim dot org * - * * - * *********************************************************************** * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * See also COPYING, LICENSE and WARRANTY file * - * * - * *********************************************************************** */ - -package org.matsim.contrib.freight.controler; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.controler; import com.graphhopper.jsprit.analysis.toolbox.StopWatch; import com.graphhopper.jsprit.core.algorithm.VehicleRoutingAlgorithm; @@ -30,15 +33,15 @@ import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.population.Plan; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.carrier.Tour.ServiceActivity; -import org.matsim.contrib.freight.carrier.Tour.TourElement; -import org.matsim.contrib.freight.jsprit.MatsimJspritFactory; -import org.matsim.contrib.freight.jsprit.NetworkBasedTransportCosts; -import org.matsim.contrib.freight.jsprit.NetworkRouter; import org.matsim.core.config.ConfigUtils; import org.matsim.core.utils.io.IOUtils; +import org.matsim.freight.carriers.FreightConfigGroup; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.carrier.Tour.ServiceActivity; +import org.matsim.freight.carriers.carrier.Tour.TourElement; +import org.matsim.freight.carriers.jsprit.MatsimJspritFactory; +import org.matsim.freight.carriers.jsprit.NetworkBasedTransportCosts; +import org.matsim.freight.carriers.jsprit.NetworkRouter; import org.matsim.utils.objectattributes.attributable.Attributes; import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.VehicleType; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/WithinDayActivityReScheduling.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/WithinDayActivityReScheduling.java similarity index 96% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/controler/WithinDayActivityReScheduling.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controler/WithinDayActivityReScheduling.java index eff76a7613f..eff80d01698 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/controler/WithinDayActivityReScheduling.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/WithinDayActivityReScheduling.java @@ -19,20 +19,15 @@ * */ -package org.matsim.contrib.freight.controler; - -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; +package org.matsim.freight.carriers.controler; +import com.google.inject.Inject; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.population.Activity; import org.matsim.api.core.v01.population.Person; import org.matsim.api.core.v01.population.PlanElement; -import org.matsim.contrib.freight.carrier.Tour.Start; -import org.matsim.contrib.freight.carrier.Tour.TourActivity; import org.matsim.core.mobsim.framework.Mobsim; import org.matsim.core.mobsim.framework.MobsimAgent; import org.matsim.core.mobsim.framework.PlanAgent; @@ -40,8 +35,12 @@ import org.matsim.core.mobsim.framework.listeners.MobsimBeforeSimStepListener; import org.matsim.core.mobsim.framework.listeners.MobsimListener; import org.matsim.core.mobsim.qsim.agents.WithinDayAgentUtils; +import org.matsim.freight.carriers.carrier.Tour.Start; +import org.matsim.freight.carriers.carrier.Tour.TourActivity; -import com.google.inject.Inject; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; /* * Physically enforces beginnings of time windows for freight activities, i.e. freight agents diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/AbstractCarrierEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/AbstractCarrierEvent.java similarity index 54% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/AbstractCarrierEvent.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/AbstractCarrierEvent.java index eade49a4dd5..10e13752f07 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/AbstractCarrierEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/AbstractCarrierEvent.java @@ -1,11 +1,32 @@ -package org.matsim.contrib.freight.events; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.events; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.Event; import org.matsim.api.core.v01.events.HasLinkId; import org.matsim.api.core.v01.events.HasVehicleId; import org.matsim.api.core.v01.network.Link; -import org.matsim.contrib.freight.carrier.Carrier; +import org.matsim.freight.carriers.carrier.Carrier; import org.matsim.vehicles.Vehicle; import java.util.Map; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierEventAttributes.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierEventAttributes.java similarity index 97% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierEventAttributes.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierEventAttributes.java index 2fc71288457..db7fb1a2738 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierEventAttributes.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierEventAttributes.java @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.events; +package org.matsim.freight.carriers.events; /** * Some constants, that are used for the Attributes of different FreightEvents. diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierEventCreator.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierEventCreator.java similarity index 92% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierEventCreator.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierEventCreator.java index 3271eceaa5f..e4d03f78afb 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierEventCreator.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierEventCreator.java @@ -19,13 +19,13 @@ * */ -package org.matsim.contrib.freight.events; +package org.matsim.freight.carriers.events; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.Event; import org.matsim.api.core.v01.population.Activity; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.ScheduledTour; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.ScheduledTour; import org.matsim.vehicles.Vehicle; public interface CarrierEventCreator { diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierEventCreatorUtils.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierEventCreatorUtils.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierEventCreatorUtils.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierEventCreatorUtils.java index d3ce308c6ef..df84c797ac5 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierEventCreatorUtils.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierEventCreatorUtils.java @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.events; +package org.matsim.freight.carriers.events; import java.util.ArrayList; import java.util.Collection; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierEventsReaders.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierEventsReaders.java similarity index 61% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierEventsReaders.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierEventsReaders.java index 20eb9dad5a8..23c9176a0ff 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierEventsReaders.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierEventsReaders.java @@ -1,24 +1,25 @@ /* - * *********************************************************************** * - * project: org.matsim.* - * *********************************************************************** * - * * - * copyright : (C) 2023 by the members listed in the COPYING, * - * LICENSE and WARRANTY file. * - * email : info at matsim dot org * - * * - * *********************************************************************** * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * See also COPYING, LICENSE and WARRANTY file * - * * - * *********************************************************************** * + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * */ -package org.matsim.contrib.freight.events; +package org.matsim.freight.carriers.events; import org.matsim.core.api.experimental.events.EventsManager; import org.matsim.core.events.MatsimEventsReader; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierServiceEndEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceEndEvent.java similarity index 86% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierServiceEndEvent.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceEndEvent.java index 0c4585932a0..50b15c9afc5 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierServiceEndEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceEndEvent.java @@ -19,18 +19,16 @@ * */ -package org.matsim.contrib.freight.events; - -import java.util.Map; +package org.matsim.freight.carriers.events; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.GenericEvent; import org.matsim.api.core.v01.network.Link; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierService; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierService; import org.matsim.vehicles.Vehicle; -import static org.matsim.contrib.freight.events.CarrierEventAttributes.*; +import java.util.Map; /** * An event, that informs that a Freight {@link CarrierService} activity has ended. @@ -65,8 +63,8 @@ public double getServiceDuration() { @Override public Map getAttributes() { Map attr = super.getAttributes(); - attr.put(ATTRIBUTE_SERVICE_ID, serviceId.toString()); - attr.put(ATTRIBUTE_SERVICE_DURATION, String.valueOf(serviceDuration)); + attr.put(CarrierEventAttributes.ATTRIBUTE_SERVICE_ID, serviceId.toString()); + attr.put(CarrierEventAttributes.ATTRIBUTE_SERVICE_DURATION, String.valueOf(serviceDuration)); return attr; } @@ -74,10 +72,10 @@ public static CarrierServiceEndEvent convert(GenericEvent event) { Map attributes = event.getAttributes(); double time = Double.parseDouble(attributes.get(ATTRIBUTE_TIME)); Id carrierId = Id.create(attributes.get(ATTRIBUTE_CARRIER_ID), Carrier.class); - Id carrierServiceId = Id.create(attributes.get(ATTRIBUTE_SERVICE_ID), CarrierService.class); + Id carrierServiceId = Id.create(attributes.get(CarrierEventAttributes.ATTRIBUTE_SERVICE_ID), CarrierService.class); Id locationLinkId = Id.createLinkId(attributes.get(ATTRIBUTE_LINK)); CarrierService service = CarrierService.Builder.newInstance(carrierServiceId, locationLinkId) - .setServiceDuration(Double.parseDouble(attributes.get(ATTRIBUTE_SERVICE_DURATION))) + .setServiceDuration(Double.parseDouble(attributes.get(CarrierEventAttributes.ATTRIBUTE_SERVICE_DURATION))) .build(); Id vehicleId = Id.create(attributes.get(ATTRIBUTE_VEHICLE), Vehicle.class); return new CarrierServiceEndEvent(time, carrierId, service, vehicleId); diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierServiceEndEventCreator.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceEndEventCreator.java similarity index 80% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierServiceEndEventCreator.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceEndEventCreator.java index 6ef0929f021..b2d682ca1e5 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierServiceEndEventCreator.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceEndEventCreator.java @@ -19,17 +19,16 @@ * */ -package org.matsim.contrib.freight.events; +package org.matsim.freight.carriers.events; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.ActivityEndEvent; import org.matsim.api.core.v01.events.Event; import org.matsim.api.core.v01.population.Activity; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierConstants; -import org.matsim.contrib.freight.carrier.ScheduledTour; -import org.matsim.contrib.freight.carrier.Tour.ServiceActivity; -import org.matsim.contrib.freight.carrier.Tour.TourElement; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierConstants; +import org.matsim.freight.carriers.carrier.ScheduledTour; +import org.matsim.freight.carriers.carrier.Tour; import org.matsim.vehicles.Vehicle; /*package-private*/ final class CarrierServiceEndEventCreator implements CarrierEventCreator { @@ -37,8 +36,8 @@ @Override public Event createEvent(Event event, Carrier carrier, Activity activity, ScheduledTour scheduledTour, int activityCounter, Id vehicleId) { if(event instanceof ActivityEndEvent endEvent && CarrierConstants.SERVICE.equals(endEvent.getActType())) { - TourElement element = scheduledTour.getTour().getTourElements().get(activityCounter); - if(element instanceof ServiceActivity serviceActivity) { + Tour.TourElement element = scheduledTour.getTour().getTourElements().get(activityCounter); + if(element instanceof Tour.ServiceActivity serviceActivity) { return new CarrierServiceEndEvent(event.getTime(), carrier.getId(), serviceActivity.getService(), vehicleId); } } diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierServiceStartEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceStartEvent.java similarity index 83% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierServiceStartEvent.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceStartEvent.java index 6c8550df63f..a8b0567ee23 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierServiceStartEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceStartEvent.java @@ -19,19 +19,17 @@ * */ -package org.matsim.contrib.freight.events; +package org.matsim.freight.carriers.events; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.GenericEvent; import org.matsim.api.core.v01.network.Link; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierService; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierService; import org.matsim.vehicles.Vehicle; import java.util.Map; -import static org.matsim.contrib.freight.events.CarrierEventAttributes.*; - /** * An event, that informs that a Freight {@link CarrierService} activity has started. * @@ -74,9 +72,9 @@ public int getCapacityDemand() { @Override public Map getAttributes() { Map attr = super.getAttributes(); - attr.put(ATTRIBUTE_SERVICE_ID, serviceId.toString()); - attr.put(ATTRIBUTE_SERVICE_DURATION, String.valueOf(serviceDuration)); - attr.put(ATTRIBUTE_CAPACITYDEMAND, String.valueOf(capacityDemand)); + attr.put(CarrierEventAttributes.ATTRIBUTE_SERVICE_ID, serviceId.toString()); + attr.put(CarrierEventAttributes.ATTRIBUTE_SERVICE_DURATION, String.valueOf(serviceDuration)); + attr.put(CarrierEventAttributes.ATTRIBUTE_CAPACITYDEMAND, String.valueOf(capacityDemand)); return attr; } @@ -84,11 +82,11 @@ public static CarrierServiceStartEvent convert(GenericEvent event) { Map attributes = event.getAttributes(); double time = Double.parseDouble(attributes.get(ATTRIBUTE_TIME)); Id carrierId = Id.create(attributes.get(ATTRIBUTE_CARRIER_ID), Carrier.class); - Id carrierServiceId = Id.create(attributes.get(ATTRIBUTE_SERVICE_ID), CarrierService.class); + Id carrierServiceId = Id.create(attributes.get(CarrierEventAttributes.ATTRIBUTE_SERVICE_ID), CarrierService.class); Id locationLinkId = Id.createLinkId(attributes.get(ATTRIBUTE_LINK)); CarrierService service = CarrierService.Builder.newInstance(carrierServiceId, locationLinkId) - .setServiceDuration(Double.parseDouble(attributes.get(ATTRIBUTE_SERVICE_DURATION))) - .setCapacityDemand(Integer.parseInt(attributes.get(ATTRIBUTE_CAPACITYDEMAND))) + .setServiceDuration(Double.parseDouble(attributes.get(CarrierEventAttributes.ATTRIBUTE_SERVICE_DURATION))) + .setCapacityDemand(Integer.parseInt(attributes.get(CarrierEventAttributes.ATTRIBUTE_CAPACITYDEMAND))) .build(); Id vehicleId = Id.create(attributes.get(ATTRIBUTE_VEHICLE), Vehicle.class); return new CarrierServiceStartEvent(time, carrierId, service, vehicleId); diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierServiceStartEventCreator.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceStartEventCreator.java similarity index 80% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierServiceStartEventCreator.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceStartEventCreator.java index 370dd7e02c8..7700d1d5e7f 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierServiceStartEventCreator.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceStartEventCreator.java @@ -19,17 +19,16 @@ * */ -package org.matsim.contrib.freight.events; +package org.matsim.freight.carriers.events; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.ActivityStartEvent; import org.matsim.api.core.v01.events.Event; import org.matsim.api.core.v01.population.Activity; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierConstants; -import org.matsim.contrib.freight.carrier.ScheduledTour; -import org.matsim.contrib.freight.carrier.Tour.ServiceActivity; -import org.matsim.contrib.freight.carrier.Tour.TourElement; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierConstants; +import org.matsim.freight.carriers.carrier.ScheduledTour; +import org.matsim.freight.carriers.carrier.Tour; import org.matsim.vehicles.Vehicle; /*package-private*/ final class CarrierServiceStartEventCreator implements CarrierEventCreator { @@ -37,8 +36,8 @@ @Override public Event createEvent(Event event, Carrier carrier, Activity activity, ScheduledTour scheduledTour, int activityCounter, Id vehicleId) { if( event instanceof ActivityStartEvent startEvent && CarrierConstants.SERVICE.equals(startEvent.getActType()) ){ - TourElement element = scheduledTour.getTour().getTourElements().get(activityCounter); - if( element instanceof ServiceActivity serviceActivity ) { + Tour.TourElement element = scheduledTour.getTour().getTourElements().get(activityCounter); + if( element instanceof Tour.ServiceActivity serviceActivity ) { return new CarrierServiceStartEvent(event.getTime(), carrier.getId(), serviceActivity.getService(), vehicleId); } } diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentDeliveryEndEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryEndEvent.java similarity index 80% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentDeliveryEndEvent.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryEndEvent.java index eb462b77a88..971062fe2a1 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentDeliveryEndEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryEndEvent.java @@ -19,19 +19,17 @@ * */ -package org.matsim.contrib.freight.events; +package org.matsim.freight.carriers.events; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.GenericEvent; import org.matsim.api.core.v01.network.Link; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierShipment; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierShipment; import org.matsim.vehicles.Vehicle; import java.util.Map; -import static org.matsim.contrib.freight.events.CarrierEventAttributes.*; - /** * An event, that informs that a Freight {@link CarrierShipment} delivery-activity has ended. * @@ -72,9 +70,9 @@ public int getCapacityDemand() { public Map getAttributes() { Map attr = super.getAttributes(); - attr.put(ATTRIBUTE_SHIPMENT_ID, this.shipmentId.toString()); - attr.put(ATTRIBUTE_DROPOFF_DURATION, String.valueOf(this.deliveryDuration)); - attr.put(ATTRIBUTE_CAPACITYDEMAND, String.valueOf(capacityDemand)); + attr.put(CarrierEventAttributes.ATTRIBUTE_SHIPMENT_ID, this.shipmentId.toString()); + attr.put(CarrierEventAttributes.ATTRIBUTE_DROPOFF_DURATION, String.valueOf(this.deliveryDuration)); + attr.put(CarrierEventAttributes.ATTRIBUTE_CAPACITYDEMAND, String.valueOf(capacityDemand)); return attr; } @@ -82,11 +80,11 @@ public static CarrierShipmentDeliveryEndEvent convert(GenericEvent event) { var attributes = event.getAttributes(); double time = Double.parseDouble(attributes.get(ATTRIBUTE_TIME)); Id carrierId = Id.create(attributes.get(ATTRIBUTE_CARRIER_ID), Carrier.class); - Id shipmentId = Id.create(attributes.get(ATTRIBUTE_SHIPMENT_ID), CarrierShipment.class); + Id shipmentId = Id.create(attributes.get(CarrierEventAttributes.ATTRIBUTE_SHIPMENT_ID), CarrierShipment.class); Id shipmentTo = Id.createLinkId(attributes.get(ATTRIBUTE_LINK)); - int size = Integer.parseInt(attributes.get(ATTRIBUTE_CAPACITYDEMAND)); + int size = Integer.parseInt(attributes.get(CarrierEventAttributes.ATTRIBUTE_CAPACITYDEMAND)); CarrierShipment shipment = CarrierShipment.Builder.newInstance(shipmentId, null, shipmentTo, size) - .setDeliveryServiceTime(Double.parseDouble(attributes.get(ATTRIBUTE_SERVICE_DURATION))) + .setDeliveryServiceTime(Double.parseDouble(attributes.get(CarrierEventAttributes.ATTRIBUTE_SERVICE_DURATION))) .build(); Id vehicleId = Id.createVehicleId(attributes.get(ATTRIBUTE_VEHICLE)); return new CarrierShipmentDeliveryEndEvent(time, carrierId, shipment, vehicleId); diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentDeliveryEndEventCreator.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryEndEventCreator.java similarity index 81% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentDeliveryEndEventCreator.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryEndEventCreator.java index 37e4035e94b..2520b534f14 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentDeliveryEndEventCreator.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryEndEventCreator.java @@ -19,17 +19,16 @@ * */ -package org.matsim.contrib.freight.events; +package org.matsim.freight.carriers.events; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.ActivityEndEvent; import org.matsim.api.core.v01.events.Event; import org.matsim.api.core.v01.population.Activity; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierConstants; -import org.matsim.contrib.freight.carrier.ScheduledTour; -import org.matsim.contrib.freight.carrier.Tour.Delivery; -import org.matsim.contrib.freight.carrier.Tour.TourElement; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierConstants; +import org.matsim.freight.carriers.carrier.ScheduledTour; +import org.matsim.freight.carriers.carrier.Tour; import org.matsim.vehicles.Vehicle; /*package-private*/ final class CarrierShipmentDeliveryEndEventCreator implements CarrierEventCreator { @@ -37,8 +36,8 @@ @Override public Event createEvent(Event event, Carrier carrier, Activity activity, ScheduledTour scheduledTour, int activityCounter, Id vehicleId) { if(event instanceof ActivityEndEvent endEvent && CarrierConstants.DELIVERY.equals(endEvent.getActType()) ) { - TourElement element = scheduledTour.getTour().getTourElements().get(activityCounter); - if (element instanceof Delivery deliveryActivity) { + Tour.TourElement element = scheduledTour.getTour().getTourElements().get(activityCounter); + if (element instanceof Tour.Delivery deliveryActivity) { return new CarrierShipmentDeliveryEndEvent(event.getTime(), carrier.getId(), deliveryActivity.getShipment(), vehicleId ); } } diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentDeliveryStartEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryStartEvent.java similarity index 94% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentDeliveryStartEvent.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryStartEvent.java index 08b77671842..7c1ee95782d 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentDeliveryStartEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryStartEvent.java @@ -19,18 +19,18 @@ * */ -package org.matsim.contrib.freight.events; +package org.matsim.freight.carriers.events; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.GenericEvent; import org.matsim.api.core.v01.network.Link; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierShipment; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierShipment; import org.matsim.vehicles.Vehicle; import java.util.Map; -import static org.matsim.contrib.freight.events.CarrierEventAttributes.*; +import static org.matsim.freight.carriers.events.CarrierEventAttributes.*; /** * An event, that informs that a Freight {@link CarrierShipment} delivery-activity has started. diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentDeliveryStartEventCreator.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryStartEventCreator.java similarity index 81% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentDeliveryStartEventCreator.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryStartEventCreator.java index 8031c885ea4..bb7e650405a 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentDeliveryStartEventCreator.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryStartEventCreator.java @@ -19,17 +19,16 @@ * */ -package org.matsim.contrib.freight.events; +package org.matsim.freight.carriers.events; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.ActivityStartEvent; import org.matsim.api.core.v01.events.Event; import org.matsim.api.core.v01.population.Activity; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierConstants; -import org.matsim.contrib.freight.carrier.ScheduledTour; -import org.matsim.contrib.freight.carrier.Tour.Delivery; -import org.matsim.contrib.freight.carrier.Tour.TourElement; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierConstants; +import org.matsim.freight.carriers.carrier.ScheduledTour; +import org.matsim.freight.carriers.carrier.Tour; import org.matsim.vehicles.Vehicle; /*package-private*/ final class CarrierShipmentDeliveryStartEventCreator implements CarrierEventCreator { @@ -37,8 +36,8 @@ @Override public Event createEvent(Event event, Carrier carrier, Activity activity, ScheduledTour scheduledTour, int activityCounter, Id vehicleId) { if(event instanceof ActivityStartEvent startEvent && CarrierConstants.DELIVERY.equals(startEvent.getActType()) ) { - TourElement element = scheduledTour.getTour().getTourElements().get(activityCounter); - if (element instanceof Delivery deliveryActivity) { + Tour.TourElement element = scheduledTour.getTour().getTourElements().get(activityCounter); + if (element instanceof Tour.Delivery deliveryActivity) { return new CarrierShipmentDeliveryStartEvent(event.getTime(), carrier.getId(), deliveryActivity.getShipment(), vehicleId ); } } diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentPickupEndEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupEndEvent.java similarity index 93% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentPickupEndEvent.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupEndEvent.java index e88ead0cb37..c1a44cd5479 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentPickupEndEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupEndEvent.java @@ -19,18 +19,18 @@ * */ -package org.matsim.contrib.freight.events; +package org.matsim.freight.carriers.events; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.GenericEvent; import org.matsim.api.core.v01.network.Link; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierShipment; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierShipment; import org.matsim.vehicles.Vehicle; import java.util.Map; -import static org.matsim.contrib.freight.events.CarrierEventAttributes.*; +import static org.matsim.freight.carriers.events.CarrierEventAttributes.*; /** * An event, that informs that a Freight {@link CarrierShipment} pickup-activity has ended. diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentPickupEndEventCreator.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupEndEventCreator.java similarity index 81% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentPickupEndEventCreator.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupEndEventCreator.java index 9b3847191db..7c9f2d96c76 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentPickupEndEventCreator.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupEndEventCreator.java @@ -19,17 +19,16 @@ * */ -package org.matsim.contrib.freight.events; +package org.matsim.freight.carriers.events; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.ActivityEndEvent; import org.matsim.api.core.v01.events.Event; import org.matsim.api.core.v01.population.Activity; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierConstants; -import org.matsim.contrib.freight.carrier.ScheduledTour; -import org.matsim.contrib.freight.carrier.Tour.Pickup; -import org.matsim.contrib.freight.carrier.Tour.TourElement; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierConstants; +import org.matsim.freight.carriers.carrier.ScheduledTour; +import org.matsim.freight.carriers.carrier.Tour; import org.matsim.vehicles.Vehicle; /*package-private*/ final class CarrierShipmentPickupEndEventCreator implements CarrierEventCreator { @@ -37,8 +36,8 @@ @Override public Event createEvent(Event event, Carrier carrier, Activity activity, ScheduledTour scheduledTour, int activityCounter, Id vehicleId) { if(event instanceof ActivityEndEvent endEvent && CarrierConstants.PICKUP.equals((endEvent).getActType()) ) { - TourElement element = scheduledTour.getTour().getTourElements().get(activityCounter); - if (element instanceof Pickup pickupActivity) { + Tour.TourElement element = scheduledTour.getTour().getTourElements().get(activityCounter); + if (element instanceof Tour.Pickup pickupActivity) { return new CarrierShipmentPickupEndEvent(event.getTime(), carrier.getId(), pickupActivity.getShipment(), vehicleId ); } } diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentPickupStartEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupStartEvent.java similarity index 80% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentPickupStartEvent.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupStartEvent.java index 4f7725e6ece..534a5750b4c 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentPickupStartEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupStartEvent.java @@ -19,19 +19,17 @@ * */ -package org.matsim.contrib.freight.events; +package org.matsim.freight.carriers.events; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.GenericEvent; import org.matsim.api.core.v01.network.Link; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierShipment; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierShipment; import org.matsim.vehicles.Vehicle; import java.util.Map; -import static org.matsim.contrib.freight.events.CarrierEventAttributes.*; - /** * An event, that informs that a Freight {@link CarrierShipment} pickup-activity has started. * @@ -66,9 +64,9 @@ public Id getShipmentId() { public Map getAttributes() { Map attr = super.getAttributes(); - attr.put(ATTRIBUTE_SHIPMENT_ID, this.shipmentId.toString()); - attr.put(ATTRIBUTE_PICKUP_DURATION, String.valueOf(this.pickupDuration)); - attr.put(ATTRIBUTE_CAPACITYDEMAND, String.valueOf(capacityDemand)); + attr.put(CarrierEventAttributes.ATTRIBUTE_SHIPMENT_ID, this.shipmentId.toString()); + attr.put(CarrierEventAttributes.ATTRIBUTE_PICKUP_DURATION, String.valueOf(this.pickupDuration)); + attr.put(CarrierEventAttributes.ATTRIBUTE_CAPACITYDEMAND, String.valueOf(capacityDemand)); return attr; } @@ -76,11 +74,11 @@ public static CarrierShipmentPickupStartEvent convert(GenericEvent event) { Map attributes = event.getAttributes(); double time = Double.parseDouble(attributes.get(ATTRIBUTE_TIME)); Id carrierId = Id.create(attributes.get(ATTRIBUTE_CARRIER_ID), Carrier.class); - Id shipmentId = Id.create(attributes.get(ATTRIBUTE_SHIPMENT_ID), CarrierShipment.class); + Id shipmentId = Id.create(attributes.get(CarrierEventAttributes.ATTRIBUTE_SHIPMENT_ID), CarrierShipment.class); Id shipmentFrom = Id.createLinkId(attributes.get(ATTRIBUTE_LINK)); - int shipmentSize = Integer.parseInt(attributes.get(ATTRIBUTE_CAPACITYDEMAND)); + int shipmentSize = Integer.parseInt(attributes.get(CarrierEventAttributes.ATTRIBUTE_CAPACITYDEMAND)); CarrierShipment shipment = CarrierShipment.Builder.newInstance(shipmentId, shipmentFrom, null, shipmentSize) - .setPickupServiceTime(Double.parseDouble(attributes.get(ATTRIBUTE_PICKUP_DURATION))) + .setPickupServiceTime(Double.parseDouble(attributes.get(CarrierEventAttributes.ATTRIBUTE_PICKUP_DURATION))) .build(); Id vehicleId = Id.createVehicleId(attributes.get(ATTRIBUTE_VEHICLE)); return new CarrierShipmentPickupStartEvent(time, carrierId, shipment, vehicleId); diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentPickupStartEventCreator.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupStartEventCreator.java similarity index 81% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentPickupStartEventCreator.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupStartEventCreator.java index 63ef107b14f..10f8aaddab0 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierShipmentPickupStartEventCreator.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupStartEventCreator.java @@ -19,17 +19,16 @@ * */ -package org.matsim.contrib.freight.events; +package org.matsim.freight.carriers.events; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.ActivityStartEvent; import org.matsim.api.core.v01.events.Event; import org.matsim.api.core.v01.population.Activity; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierConstants; -import org.matsim.contrib.freight.carrier.ScheduledTour; -import org.matsim.contrib.freight.carrier.Tour.Pickup; -import org.matsim.contrib.freight.carrier.Tour.TourElement; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierConstants; +import org.matsim.freight.carriers.carrier.ScheduledTour; +import org.matsim.freight.carriers.carrier.Tour; import org.matsim.vehicles.Vehicle; /*package-private*/ final class CarrierShipmentPickupStartEventCreator implements CarrierEventCreator { @@ -37,8 +36,8 @@ @Override public Event createEvent(Event event, Carrier carrier, Activity activity, ScheduledTour scheduledTour, int activityCounter, Id vehicleId) { if(event instanceof ActivityStartEvent startEvent && CarrierConstants.PICKUP.equals((startEvent).getActType()) ) { - TourElement element = scheduledTour.getTour().getTourElements().get(activityCounter); - if (element instanceof Pickup pickupActivity) { + Tour.TourElement element = scheduledTour.getTour().getTourElements().get(activityCounter); + if (element instanceof Tour.Pickup pickupActivity) { return new CarrierShipmentPickupStartEvent(event.getTime(), carrier.getId(), pickupActivity.getShipment(), vehicleId ); } } diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierTourEndEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourEndEvent.java similarity index 89% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierTourEndEvent.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourEndEvent.java index b382e09e908..5c2218ab802 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierTourEndEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourEndEvent.java @@ -19,18 +19,16 @@ * */ -package org.matsim.contrib.freight.events; - -import java.util.Map; +package org.matsim.freight.carriers.events; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.GenericEvent; import org.matsim.api.core.v01.network.Link; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.Tour; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.Tour; import org.matsim.vehicles.Vehicle; -import static org.matsim.contrib.freight.events.CarrierEventAttributes.ATTRIBUTE_TOUR_ID; +import java.util.Map; /** * An event, that informs when a Freight {@link Tour} has ended. @@ -62,7 +60,7 @@ public Id getTourId() { @Override public Map getAttributes() { Map attr = super.getAttributes(); - attr.put(ATTRIBUTE_TOUR_ID, this.tourId.toString()); + attr.put(CarrierEventAttributes.ATTRIBUTE_TOUR_ID, this.tourId.toString()); return attr; } @@ -72,7 +70,7 @@ public static CarrierTourEndEvent convert(GenericEvent event) { Id carrierId = Id.create(attributes.get(ATTRIBUTE_CARRIER_ID), Carrier.class); Id vehicleId = Id.create(attributes.get(ATTRIBUTE_VEHICLE), Vehicle.class); Id linkId = Id.createLinkId(attributes.get(ATTRIBUTE_LINK)); - Id tourId = Id.create(attributes.get(ATTRIBUTE_TOUR_ID), Tour.class); + Id tourId = Id.create(attributes.get(CarrierEventAttributes.ATTRIBUTE_TOUR_ID), Tour.class); return new CarrierTourEndEvent(time, carrierId, linkId, vehicleId, tourId); } } diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierTourEndEventCreator.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourEndEventCreator.java similarity index 90% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierTourEndEventCreator.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourEndEventCreator.java index dce286a5259..9c27b86033a 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierTourEndEventCreator.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourEndEventCreator.java @@ -19,15 +19,15 @@ * */ -package org.matsim.contrib.freight.events; +package org.matsim.freight.carriers.events; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.ActivityStartEvent; import org.matsim.api.core.v01.events.Event; import org.matsim.api.core.v01.population.Activity; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierConstants; -import org.matsim.contrib.freight.carrier.ScheduledTour; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierConstants; +import org.matsim.freight.carriers.carrier.ScheduledTour; import org.matsim.vehicles.Vehicle; /*package-private*/ final class CarrierTourEndEventCreator implements CarrierEventCreator { diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierTourStartEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourStartEvent.java similarity index 93% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierTourStartEvent.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourStartEvent.java index b3313c39a5b..2c6d5c42b33 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierTourStartEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourStartEvent.java @@ -19,18 +19,18 @@ * */ -package org.matsim.contrib.freight.events; +package org.matsim.freight.carriers.events; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.GenericEvent; import org.matsim.api.core.v01.network.Link; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.Tour; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.Tour; import org.matsim.vehicles.Vehicle; import java.util.Map; -import static org.matsim.contrib.freight.events.CarrierEventAttributes.ATTRIBUTE_TOUR_ID; +import static org.matsim.freight.carriers.events.CarrierEventAttributes.ATTRIBUTE_TOUR_ID; /** * An event, that informs when a Freight {@link Tour} has started. diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierTourStartEventCreator.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourStartEventCreator.java similarity index 95% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierTourStartEventCreator.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourStartEventCreator.java index a9cf3ad5fe3..368755ab0d2 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/CarrierTourStartEventCreator.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourStartEventCreator.java @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.events; +package org.matsim.freight.carriers.events; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.ActivityEndEvent; @@ -27,9 +27,9 @@ import org.matsim.api.core.v01.events.PersonEntersVehicleEvent; import org.matsim.api.core.v01.population.Activity; import org.matsim.api.core.v01.population.Person; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierConstants; -import org.matsim.contrib.freight.carrier.ScheduledTour; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierConstants; +import org.matsim.freight.carriers.carrier.ScheduledTour; import org.matsim.vehicles.Vehicle; import java.util.TreeMap; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/HasCarrierId.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/HasCarrierId.java new file mode 100644 index 00000000000..1b680fd34c4 --- /dev/null +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/HasCarrierId.java @@ -0,0 +1,34 @@ +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.events; + +import org.matsim.api.core.v01.Id; +import org.matsim.freight.carriers.carrier.Carrier; + +/** + * @author Kai Martins-Turner (kturner) + */ +public interface HasCarrierId { + String ATTRIBUTE_CARRIER_ID = "carrierId"; + + Id getCarrierId(); +} diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/eventhandler/FreightServiceEndEventHandler.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/FreightServiceEndEventHandler.java similarity index 92% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/eventhandler/FreightServiceEndEventHandler.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/FreightServiceEndEventHandler.java index 48cf81c212e..65db8298b92 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/eventhandler/FreightServiceEndEventHandler.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/FreightServiceEndEventHandler.java @@ -19,11 +19,11 @@ * */ -package org.matsim.contrib.freight.events.eventhandler; +package org.matsim.freight.carriers.events.eventhandler; -import org.matsim.contrib.freight.events.CarrierServiceEndEvent; import org.matsim.core.events.handler.EventHandler; +import org.matsim.freight.carriers.events.CarrierServiceEndEvent; public interface FreightServiceEndEventHandler extends EventHandler{ diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/eventhandler/FreightServiceStartEventHandler.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/FreightServiceStartEventHandler.java similarity index 92% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/eventhandler/FreightServiceStartEventHandler.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/FreightServiceStartEventHandler.java index 2e2b609e68c..78534b0337e 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/eventhandler/FreightServiceStartEventHandler.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/FreightServiceStartEventHandler.java @@ -19,10 +19,10 @@ * */ -package org.matsim.contrib.freight.events.eventhandler; +package org.matsim.freight.carriers.events.eventhandler; -import org.matsim.contrib.freight.events.CarrierServiceStartEvent; import org.matsim.core.events.handler.EventHandler; +import org.matsim.freight.carriers.events.CarrierServiceStartEvent; public interface FreightServiceStartEventHandler extends EventHandler { diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/eventhandler/FreightShipmentDeliveryEventHandler.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/FreightShipmentDeliveryEventHandler.java similarity index 92% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/eventhandler/FreightShipmentDeliveryEventHandler.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/FreightShipmentDeliveryEventHandler.java index c3560daf9c5..858a91fdca5 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/eventhandler/FreightShipmentDeliveryEventHandler.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/FreightShipmentDeliveryEventHandler.java @@ -19,10 +19,10 @@ * */ -package org.matsim.contrib.freight.events.eventhandler; +package org.matsim.freight.carriers.events.eventhandler; -import org.matsim.contrib.freight.events.CarrierShipmentDeliveryEndEvent; import org.matsim.core.events.handler.EventHandler; +import org.matsim.freight.carriers.events.CarrierShipmentDeliveryEndEvent; /** * Interface to listen to shipmentDeliveredEvents. diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/eventhandler/FreightShipmentPickupEventHandler.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/FreightShipmentPickupEventHandler.java similarity index 92% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/eventhandler/FreightShipmentPickupEventHandler.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/FreightShipmentPickupEventHandler.java index 43f0671150e..126942b432f 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/eventhandler/FreightShipmentPickupEventHandler.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/FreightShipmentPickupEventHandler.java @@ -19,10 +19,10 @@ * */ -package org.matsim.contrib.freight.events.eventhandler; +package org.matsim.freight.carriers.events.eventhandler; -import org.matsim.contrib.freight.events.CarrierShipmentPickupEndEvent; import org.matsim.core.events.handler.EventHandler; +import org.matsim.freight.carriers.events.CarrierShipmentPickupEndEvent; /** * Interface to listen to shipmentPickedUpEvents. diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/eventhandler/FreightTourEndEventHandler.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/FreightTourEndEventHandler.java similarity index 92% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/eventhandler/FreightTourEndEventHandler.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/FreightTourEndEventHandler.java index 68f84017089..7a91f767c4d 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/eventhandler/FreightTourEndEventHandler.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/FreightTourEndEventHandler.java @@ -19,10 +19,10 @@ * */ -package org.matsim.contrib.freight.events.eventhandler; +package org.matsim.freight.carriers.events.eventhandler; -import org.matsim.contrib.freight.events.CarrierTourEndEvent; import org.matsim.core.events.handler.EventHandler; +import org.matsim.freight.carriers.events.CarrierTourEndEvent; public interface FreightTourEndEventHandler extends EventHandler { diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/eventhandler/FreightTourStartEventHandler.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/FreightTourStartEventHandler.java similarity index 92% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/events/eventhandler/FreightTourStartEventHandler.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/FreightTourStartEventHandler.java index 7be16fe69eb..21b14f86ce0 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/events/eventhandler/FreightTourStartEventHandler.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/FreightTourStartEventHandler.java @@ -19,10 +19,10 @@ * */ -package org.matsim.contrib.freight.events.eventhandler; +package org.matsim.freight.carriers.events.eventhandler; -import org.matsim.contrib.freight.events.CarrierTourStartEvent; import org.matsim.core.events.handler.EventHandler; +import org.matsim.freight.carriers.events.CarrierTourStartEvent; public interface FreightTourStartEventHandler extends EventHandler { diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/Vehicle2CarrierEventHandler.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/Vehicle2CarrierEventHandler.java new file mode 100644 index 00000000000..f0a06daecf9 --- /dev/null +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/Vehicle2CarrierEventHandler.java @@ -0,0 +1,70 @@ +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ +package org.matsim.freight.carriers.events.eventhandler; + +import org.matsim.api.core.v01.Id; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.events.CarrierTourEndEvent; +import org.matsim.freight.carriers.events.CarrierTourStartEvent; +import org.matsim.vehicles.Vehicle; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Basic event handler that collects the relation between vehicles and carrier. + * Necessary since link enter and leave events do not contain any information of the carrier. + * For the connection between driver and Vehicle the {@link Vehicle2CarrierEventHandler} can be used. + * + * @author kturner + */ +public final class Vehicle2CarrierEventHandler implements FreightTourStartEventHandler, FreightTourEndEventHandler { + + + // Comment from Janek (in https://github.com/matsim-org/matsim-libs/pull/2128) + // Is this handler ever going to be called concurrently? If not a normal HashMap is probably sufficient + // At least the default events manager guarantees single threaded invocation of your handler. + // --> we can check this. Currently, it was made only analogous to Vehicle2DriverEventHandler kmt sep'22 + private final Map, Id> carrierVehicles = new ConcurrentHashMap<>(); + + @Override + public void reset(int iteration) { + carrierVehicles.clear(); + } + + @Override + public void handleEvent(CarrierTourStartEvent event) { + carrierVehicles.put(event.getVehicleId(), event.getCarrierId()); + } + + @Override + public void handleEvent(CarrierTourEndEvent event) { + carrierVehicles.remove(event.getVehicleId()); + } + + /** + * @param vehicleId the unique vehicle identifier. + * @return person id of the driver + */ + public Id getCarrierOfVehicle(Id vehicleId){ + return carrierVehicles.get(vehicleId); + } +} diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/DistanceConstraint.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/DistanceConstraint.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/DistanceConstraint.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/DistanceConstraint.java index 44e2fea63df..da418a3e9d9 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/DistanceConstraint.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/DistanceConstraint.java @@ -3,7 +3,7 @@ * project: org.matsim.* * *********************************************************************** * * * - * copyright : (C) 2020 by the members listed in the COPYING, * + * copyright : (C) by the members listed in the COPYING, * * LICENSE and WARRANTY file. * * email : info at matsim dot org * * * @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.jsprit; +package org.matsim.freight.carriers.jsprit; import com.graphhopper.jsprit.core.problem.constraint.HardActivityConstraint; import com.graphhopper.jsprit.core.problem.misc.JobInsertionContext; @@ -31,7 +31,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; -import org.matsim.contrib.freight.carrier.CarrierVehicleTypes; +import org.matsim.freight.carriers.carrier.CarrierVehicleTypes; import org.matsim.vehicles.VehicleType; import org.matsim.vehicles.VehicleUtils; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/DistanceUpdater.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/DistanceUpdater.java similarity index 96% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/DistanceUpdater.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/DistanceUpdater.java index 16ce48e5635..241202e1cb4 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/DistanceUpdater.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/DistanceUpdater.java @@ -3,7 +3,7 @@ * project: org.matsim.* * *********************************************************************** * * * - * copyright : (C) 2020 by the members listed in the COPYING, * + * copyright : (C) by the members listed in the COPYING, * * LICENSE and WARRANTY file. * * email : info at matsim dot org * * * @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.jsprit; +package org.matsim.freight.carriers.jsprit; import com.graphhopper.jsprit.core.algorithm.state.StateId; import com.graphhopper.jsprit.core.algorithm.state.StateManager; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/FiFoTravelTime.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/FiFoTravelTime.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/FiFoTravelTime.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/FiFoTravelTime.java index f7e93cdedb7..e526819617f 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/FiFoTravelTime.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/FiFoTravelTime.java @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.jsprit; +package org.matsim.freight.carriers.jsprit; import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.population.Person; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/MatsimJspritFactory.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/MatsimJspritFactory.java similarity index 92% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/MatsimJspritFactory.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/MatsimJspritFactory.java index 3fe6af08455..62e9e395601 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/MatsimJspritFactory.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/MatsimJspritFactory.java @@ -1,16 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2011 Stefan Schroeder. - * eMail: stefan.schroeder@kit.edu - *

    - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Public License v2.0 - * which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - *

    - * Contributors: - * Stefan Schroeder - initial API and implementation - ******************************************************************************/ -package org.matsim.contrib.freight.jsprit; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ +package org.matsim.freight.carriers.jsprit; import com.graphhopper.jsprit.core.algorithm.VehicleRoutingAlgorithm; import com.graphhopper.jsprit.core.algorithm.box.Jsprit; @@ -43,13 +51,10 @@ import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.network.Network; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.carrier.TimeWindow; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.carrier.Tour.Leg; -import org.matsim.contrib.freight.carrier.Tour.TourElement; -import org.matsim.contrib.freight.controler.FreightUtils; import org.matsim.core.utils.io.IOUtils; +import org.matsim.freight.carriers.FreightConfigGroup; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.vehicles.VehicleType; import org.matsim.vehicles.VehicleUtils; @@ -78,7 +83,7 @@ public final class MatsimJspritFactory { * * @param jspritShipment to be transformed to MATSim * @return CarrierShipment - * @see CarrierShipment, Shipment + * @see CarrierShipment , Shipment */ static CarrierShipment createCarrierShipment(Shipment jspritShipment) { CarrierShipment carrierShipment = CarrierShipment.Builder @@ -86,10 +91,10 @@ static CarrierShipment createCarrierShipment(Shipment jspritShipment) { Id.createLinkId(jspritShipment.getPickupLocation().getId()), Id.createLinkId(jspritShipment.getDeliveryLocation().getId()), jspritShipment.getSize().get(0)) .setDeliveryServiceTime(jspritShipment.getDeliveryServiceTime()) - .setDeliveryTimeWindow(TimeWindow.newInstance(jspritShipment.getDeliveryTimeWindow().getStart(), + .setDeliveryTimeWindow(org.matsim.freight.carriers.carrier.TimeWindow.newInstance(jspritShipment.getDeliveryTimeWindow().getStart(), jspritShipment.getDeliveryTimeWindow().getEnd())) .setPickupServiceTime(jspritShipment.getPickupServiceTime()) - .setPickupTimeWindow(TimeWindow.newInstance(jspritShipment.getPickupTimeWindow().getStart(), + .setPickupTimeWindow(org.matsim.freight.carriers.carrier.TimeWindow.newInstance(jspritShipment.getPickupTimeWindow().getStart(), jspritShipment.getPickupTimeWindow().getEnd())) .build(); FreightUtils.setSkills(carrierShipment, jspritShipment.getRequiredSkills().values()); @@ -101,7 +106,7 @@ static CarrierShipment createCarrierShipment(Shipment jspritShipment) { * * @param carrierShipment to be transformed to jsprit * @return Shipment - * @see CarrierShipment, Shipment + * @see CarrierShipment , Shipment */ static Shipment createJspritShipment(CarrierShipment carrierShipment) { Shipment.Builder shipmentBuilder = Shipment.Builder.newInstance(carrierShipment.getId().toString()) @@ -184,7 +189,7 @@ static CarrierService createCarrierService(Service jspritService) { serviceBuilder.setCapacityDemand(jspritService.getSize().get(0)); serviceBuilder.setServiceDuration(jspritService.getServiceDuration()); serviceBuilder.setServiceStartTimeWindow( - TimeWindow.newInstance(jspritService.getTimeWindow().getStart(), jspritService.getTimeWindow().getEnd())); + org.matsim.freight.carriers.carrier.TimeWindow.newInstance(jspritService.getTimeWindow().getStart(), jspritService.getTimeWindow().getEnd())); CarrierService carrierService = serviceBuilder.build(); FreightUtils.setSkills(carrierService, jspritService.getRequiredSkills().values()); return carrierService; @@ -231,7 +236,7 @@ static com.graphhopper.jsprit.core.problem.vehicle.Vehicle createJspritVehicle(C * * @param jspritVehicle to be transformed to CarrierVehicle * @return carrierVehicle - * @see CarrierVehicle, Vehicle + * @see CarrierVehicle , Vehicle */ static CarrierVehicle createCarrierVehicle(com.graphhopper.jsprit.core.problem.vehicle.Vehicle jspritVehicle) { VehicleType matsimVehicleType; @@ -370,28 +375,28 @@ static ScheduledTour createScheduledTour(VehicleRoute jspritRoute, Id tour + act.getLocation().getId() + " : " + act.getLocation().getCoordinate()); Service job = (Service) ((JobActivity) act).getJob(); CarrierService carrierService = createCarrierService(job); - matsimFreightTourBuilder.addLeg(new Leg()); + matsimFreightTourBuilder.addLeg(new Tour.Leg()); matsimFreightTourBuilder.scheduleService(carrierService); } else if (act instanceof DeliverShipment) { log.debug("Found DeliveryShipment: " + act.getName() + " at location " + act.getLocation().getId() + " : " + act.getLocation().getCoordinate()); Shipment job = (Shipment) ((JobActivity) act).getJob(); CarrierShipment carrierShipment = createCarrierShipment(job); - matsimFreightTourBuilder.addLeg(new Leg()); + matsimFreightTourBuilder.addLeg(new Tour.Leg()); matsimFreightTourBuilder.scheduleDelivery(carrierShipment); } else if (act instanceof PickupShipment) { log.debug("Found PickupShipment: " + act.getName() + " at location " + act.getLocation().getId() + " : " + act.getLocation().getCoordinate()); Shipment job = (Shipment) ((JobActivity) act).getJob(); CarrierShipment carrierShipment = createCarrierShipment(job); - matsimFreightTourBuilder.addLeg(new Leg()); + matsimFreightTourBuilder.addLeg(new Tour.Leg()); matsimFreightTourBuilder.schedulePickup(carrierShipment); } else throw new IllegalStateException("unknown tourActivity occurred. this cannot be"); } - matsimFreightTourBuilder.addLeg(new Leg()); + matsimFreightTourBuilder.addLeg(new Tour.Leg()); matsimFreightTourBuilder.scheduleEnd(Id.create(jspritRoute.getEnd().getLocation().getId(), Link.class)); - org.matsim.contrib.freight.carrier.Tour matsimVehicleTour = matsimFreightTourBuilder.build(); + Tour matsimVehicleTour = matsimFreightTourBuilder.build(); ScheduledTour sTour = ScheduledTour.newInstance(matsimVehicleTour, carrierVehicle, depTime); if (jspritRoute.getDepartureTime() != sTour.getDeparture()) @@ -429,10 +434,10 @@ public static VehicleRoute createRoute(ScheduledTour scheduledTour, VehicleRouti jspritRouteBuilder.setJobActivityFactory(vehicleRoutingProblem.getJobActivityFactory()); jspritRouteBuilder.setDepartureTime(depTime); - for (TourElement e : tour.getTourElements()) { - if (e instanceof org.matsim.contrib.freight.carrier.Tour.TourActivity) { - if (e instanceof org.matsim.contrib.freight.carrier.Tour.ServiceActivity) { - CarrierService carrierService = ((org.matsim.contrib.freight.carrier.Tour.ServiceActivity) e) + for (Tour.TourElement e : tour.getTourElements()) { + if (e instanceof Tour.TourActivity) { + if (e instanceof Tour.ServiceActivity) { + CarrierService carrierService = ((Tour.ServiceActivity) e) .getService(); Service service = (Service) vehicleRoutingProblem.getJobs().get(carrierService.getId().toString()); if (service == null) @@ -483,7 +488,7 @@ public static VehicleRoutingProblem createRoutingProblem(Carrier carrier, Networ FleetSize fleetSize; CarrierCapabilities carrierCapabilities = carrier.getCarrierCapabilities(); if (carrierCapabilities.getFleetSize() - .equals(org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize.INFINITE)) { + .equals(CarrierCapabilities.FleetSize.INFINITE)) { fleetSize = FleetSize.INFINITE; vrpBuilder.setFleetSize(fleetSize); } else { @@ -587,7 +592,7 @@ public static VehicleRoutingProblem.Builder createRoutingProblemBuilder(Carrier FleetSize fleetSize; CarrierCapabilities carrierCapabilities = carrier.getCarrierCapabilities(); if (carrierCapabilities.getFleetSize() - .equals(org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize.INFINITE)) { + .equals(CarrierCapabilities.FleetSize.INFINITE)) { fleetSize = FleetSize.INFINITE; vrpBuilder.setFleetSize(fleetSize); } else { @@ -683,9 +688,9 @@ public static Carrier createCarrier(String carrierId, VehicleRoutingProblem vrp) // fleet and vehicles if (vrp.getFleetSize().equals(FleetSize.FINITE)) { - capabilityBuilder.setFleetSize(org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize.FINITE); + capabilityBuilder.setFleetSize(CarrierCapabilities.FleetSize.FINITE); } else - capabilityBuilder.setFleetSize(org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize.INFINITE); + capabilityBuilder.setFleetSize(CarrierCapabilities.FleetSize.INFINITE); for (com.graphhopper.jsprit.core.problem.vehicle.VehicleType type : vrp.getTypes()) { capabilityBuilder.addType(createMatsimVehicleType(type)); } diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/NetworkBasedTransportCosts.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/NetworkBasedTransportCosts.java similarity index 95% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/NetworkBasedTransportCosts.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/NetworkBasedTransportCosts.java index 01f79137571..d30ec1fb616 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/NetworkBasedTransportCosts.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/NetworkBasedTransportCosts.java @@ -1,16 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2011 Stefan Schroeder. - * eMail: stefan.schroeder@kit.edu - *

    - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Public License v2.0 - * which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - *

    - * Contributors: - * Stefan Schroeder - initial API and implementation - ******************************************************************************/ -package org.matsim.contrib.freight.jsprit; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ +package org.matsim.freight.carriers.jsprit; import com.graphhopper.jsprit.core.problem.Location; import com.graphhopper.jsprit.core.problem.VehicleRoutingProblem; @@ -22,7 +30,6 @@ import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.network.Network; import org.matsim.api.core.v01.population.Person; -import org.matsim.contrib.freight.carrier.CarrierVehicle; import org.matsim.core.router.speedy.SpeedyALTFactory; import org.matsim.core.router.util.LeastCostPathCalculator; import org.matsim.core.router.util.LeastCostPathCalculator.Path; @@ -30,6 +37,7 @@ import org.matsim.core.router.util.TravelDisutility; import org.matsim.core.router.util.TravelTime; import org.matsim.core.utils.misc.Counter; +import org.matsim.freight.carriers.carrier.CarrierVehicle; import org.matsim.utils.objectattributes.attributable.Attributes; import org.matsim.utils.objectattributes.attributable.AttributesImpl; import org.matsim.vehicles.VehicleType; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/NetworkBasedTransportCostsFactory.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/NetworkBasedTransportCostsFactory.java similarity index 95% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/NetworkBasedTransportCostsFactory.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/NetworkBasedTransportCostsFactory.java index 66cac6f5633..3cb414f29d6 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/NetworkBasedTransportCostsFactory.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/NetworkBasedTransportCostsFactory.java @@ -19,15 +19,15 @@ * */ -package org.matsim.contrib.freight.jsprit; +package org.matsim.freight.carriers.jsprit; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.carrier.Carriers; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.router.util.TravelTime; +import org.matsim.freight.carriers.FreightConfigGroup; +import org.matsim.freight.carriers.carrier.Carriers; import org.matsim.vehicles.VehicleType; import java.util.HashSet; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/NetworkRouter.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/NetworkRouter.java new file mode 100644 index 00000000000..26debecd9b4 --- /dev/null +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/NetworkRouter.java @@ -0,0 +1,50 @@ +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ +package org.matsim.freight.carriers.jsprit; + +import org.matsim.freight.carriers.carrier.CarrierPlan; +import org.matsim.freight.carriers.carrier.ScheduledTour; +import org.matsim.freight.carriers.controler.CarrierTimeAndSpaceTourRouter; + +/** + * Router that routes {@link CarrierPlan}. + * + * @author stefan schröder + * + */ +public class NetworkRouter { + + /** + * Routes the {@link CarrierPlan} with the router defined in {@link NetworkBasedTransportCosts}. + * + *

    Note that this changes the plan, i.e. it adds routes to the input-plan. + * + * @param {@link CarrierPlan} + * @param {@link NetworkBasedTransportCosts} + */ + public static void routePlan(CarrierPlan plan, VRPTransportCosts freightTransportCosts){ + if( plan == null) throw new IllegalStateException("plan is missing."); + for( ScheduledTour tour : plan.getScheduledTours()){ + new CarrierTimeAndSpaceTourRouter( freightTransportCosts.getRouter(), freightTransportCosts.getNetwork(), freightTransportCosts.getTravelTime()).route(tour ); + } + } + +} diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/VRPTransportCosts.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/VRPTransportCosts.java similarity index 97% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/VRPTransportCosts.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/VRPTransportCosts.java index 260bf10bba4..d831d329fc9 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/VRPTransportCosts.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/VRPTransportCosts.java @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.jsprit; +package org.matsim.freight.carriers.jsprit; import com.graphhopper.jsprit.core.problem.cost.VehicleRoutingTransportCosts; import org.matsim.api.core.v01.network.Network; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/VRPTransportCostsFactory.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/VRPTransportCostsFactory.java similarity index 97% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/VRPTransportCostsFactory.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/VRPTransportCostsFactory.java index 5c7e36b58f5..bb6efbdd9ec 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/VRPTransportCostsFactory.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/VRPTransportCostsFactory.java @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.jsprit; +package org.matsim.freight.carriers.jsprit; /** * @author steffenaxer diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/VehicleTypeDependentRoadPricingCalculator.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/VehicleTypeDependentRoadPricingCalculator.java similarity index 79% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/VehicleTypeDependentRoadPricingCalculator.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/VehicleTypeDependentRoadPricingCalculator.java index 84adb4539a4..ed5d3694720 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/jsprit/VehicleTypeDependentRoadPricingCalculator.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/VehicleTypeDependentRoadPricingCalculator.java @@ -1,26 +1,33 @@ -/******************************************************************************* - * Copyright (c) 2011 Stefan Schroeder. - * eMail: stefan.schroeder@kit.edu - *

    - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Public License v2.0 - * which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - *

    - * Contributors: - * Stefan Schroeder - initial API and implementation - ******************************************************************************/ -package org.matsim.contrib.freight.jsprit; - -import java.util.*; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ +package org.matsim.freight.carriers.jsprit; import com.graphhopper.jsprit.core.problem.vehicle.VehicleType; - import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Link; import org.matsim.contrib.roadpricing.RoadPricingScheme; import org.matsim.contrib.roadpricing.RoadPricingSchemeImpl.Cost; +import java.util.*; + /** * Calculator that manages and calculates vehicle type dependent road pricing schemas. diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/package-info.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/package-info.java similarity index 95% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/package-info.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/package-info.java index ea043d9c4b6..e5d676fe61b 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/package-info.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/package-info.java @@ -21,11 +21,10 @@ /** * Package that plugs freight algorithms (programmed in external package jsprit) into matsim. - * A good starting point for jsprit is + * A good starting point for jsprit is * https://github.com/graphhopper/jsprit. - * + * * @author (of documentation) nagel */ -package org.matsim.contrib.freight; +package org.matsim.freight.carriers; - \ No newline at end of file diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/analysis/CarrierScoreStats.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/analysis/CarrierScoreStats.java similarity index 85% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/analysis/CarrierScoreStats.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/analysis/CarrierScoreStats.java index 4f046a93987..5ea7fd329c9 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/analysis/CarrierScoreStats.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/analysis/CarrierScoreStats.java @@ -1,30 +1,28 @@ -/* *********************************************************************** * - * project: org.matsim.* - * ScoreStats.java - * * - * *********************************************************************** * - * * - * copyright : (C) 2007 by the members listed in the COPYING, * - * LICENSE and WARRANTY file. * - * email : info at matsim dot org * - * * - * *********************************************************************** * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * See also COPYING, LICENSE and WARRANTY file * - * * - * *********************************************************************** */ - -package org.matsim.contrib.freight.usecases.analysis; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.usecases.analysis; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierPlan; -import org.matsim.contrib.freight.carrier.Carriers; import org.matsim.core.controler.events.IterationEndsEvent; import org.matsim.core.controler.events.ShutdownEvent; import org.matsim.core.controler.events.StartupEvent; @@ -34,6 +32,9 @@ import org.matsim.core.utils.charts.XYLineChart; import org.matsim.core.utils.io.IOUtils; import org.matsim.core.utils.io.UncheckedIOException; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierPlan; +import org.matsim.freight.carriers.carrier.Carriers; import java.io.BufferedWriter; import java.io.IOException; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/analysis/LegHistogram.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/analysis/LegHistogram.java similarity index 90% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/analysis/LegHistogram.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/analysis/LegHistogram.java index b1c022cbb27..1db193121ec 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/analysis/LegHistogram.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/analysis/LegHistogram.java @@ -1,36 +1,27 @@ -/* *********************************************************************** * - * project: org.matsim.* - * LegHistogram.java - * * - * *********************************************************************** * - * * - * copyright : (C) 2007 by the members listed in the COPYING, * - * LICENSE and WARRANTY file. * - * email : info at matsim dot org * - * * - * *********************************************************************** * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * See also COPYING, LICENSE and WARRANTY file * - * * - * *********************************************************************** */ - -package org.matsim.contrib.freight.usecases.analysis; - -import java.awt.BasicStroke; -import java.awt.Color; -import java.awt.Font; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.PrintStream; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.usecases.analysis; +import jakarta.inject.Inject; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartUtils; import org.jfree.chart.JFreeChart; @@ -51,7 +42,14 @@ import org.matsim.api.core.v01.population.Population; import org.matsim.core.utils.misc.Time; -import jakarta.inject.Inject; +import java.awt.*; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.PrintStream; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; /** * It is a copy of {@link org.matsim.analysis.LegHistogram}. It is modified to include or exclude persons. diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/CarrierScoringFunctionFactoryImpl.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/CarrierScoringFunctionFactoryImpl.java similarity index 96% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/CarrierScoringFunctionFactoryImpl.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/CarrierScoringFunctionFactoryImpl.java index 7cc71f79006..bc208538d56 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/CarrierScoringFunctionFactoryImpl.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/CarrierScoringFunctionFactoryImpl.java @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.usecases.chessboard; +package org.matsim.freight.carriers.usecases.chessboard; import com.google.inject.Inject; import org.apache.logging.log4j.LogManager; @@ -31,14 +31,14 @@ import org.matsim.api.core.v01.network.Network; import org.matsim.api.core.v01.population.Activity; import org.matsim.api.core.v01.population.Leg; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.controler.CarrierScoringFunctionFactory; -import org.matsim.contrib.freight.controler.FreightActivity; -import org.matsim.contrib.freight.jsprit.VehicleTypeDependentRoadPricingCalculator; import org.matsim.core.gbl.Gbl; import org.matsim.core.population.routes.NetworkRoute; import org.matsim.core.scoring.ScoringFunction; import org.matsim.core.scoring.SumScoringFunction; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controler.FreightActivity; +import org.matsim.freight.carriers.jsprit.VehicleTypeDependentRoadPricingCalculator; import org.matsim.vehicles.Vehicle; import java.util.HashSet; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/CarrierTravelDisutilities.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/CarrierTravelDisutilities.java similarity index 94% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/CarrierTravelDisutilities.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/CarrierTravelDisutilities.java index 37c45b7e8a8..059b8ec326f 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/CarrierTravelDisutilities.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/CarrierTravelDisutilities.java @@ -19,20 +19,20 @@ * */ -package org.matsim.contrib.freight.usecases.chessboard; +package org.matsim.freight.carriers.usecases.chessboard; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.population.Person; -import org.matsim.contrib.freight.carrier.CarrierVehicleTypes; -import org.matsim.contrib.freight.jsprit.VehicleTypeDependentRoadPricingCalculator; import org.matsim.core.router.util.TravelDisutility; import org.matsim.core.router.util.TravelTime; +import org.matsim.freight.carriers.carrier.CarrierVehicleTypes; +import org.matsim.freight.carriers.jsprit.VehicleTypeDependentRoadPricingCalculator; import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.VehicleType; public final class CarrierTravelDisutilities{ - + public static TravelDisutility createBaseDisutility(final CarrierVehicleTypes vehicleTypes, final TravelTime travelTime){ return new TravelDisutility() { @@ -79,7 +79,7 @@ public double getLinkMinimumTravelDisutility(Link link) { }; } - + } diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/FreightScenarioCreator.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/FreightScenarioCreator.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/FreightScenarioCreator.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/FreightScenarioCreator.java index 80c5ac16f39..59b4347aff0 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/FreightScenarioCreator.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/FreightScenarioCreator.java @@ -19,17 +19,17 @@ * */ -package org.matsim.contrib.freight.usecases.chessboard; +package org.matsim.freight.carriers.usecases.chessboard; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.network.Network; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize; import org.matsim.core.config.Config; import org.matsim.core.network.io.MatsimNetworkReader; import org.matsim.core.scenario.ScenarioUtils; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.carrier.CarrierCapabilities.FleetSize; import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.VehicleType; import org.matsim.vehicles.VehicleUtils; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/InitialCarrierPlanCreator.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/InitialCarrierPlanCreator.java similarity index 96% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/InitialCarrierPlanCreator.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/InitialCarrierPlanCreator.java index 609aa8586b1..997f5b02c7c 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/InitialCarrierPlanCreator.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/InitialCarrierPlanCreator.java @@ -19,9 +19,7 @@ * */ -package org.matsim.contrib.freight.usecases.chessboard; - -import java.util.Collection; +package org.matsim.freight.carriers.usecases.chessboard; import com.graphhopper.jsprit.core.algorithm.VehicleRoutingAlgorithm; import com.graphhopper.jsprit.core.algorithm.state.StateManager; @@ -36,16 +34,17 @@ import com.graphhopper.jsprit.io.algorithm.AlgorithmConfig; import com.graphhopper.jsprit.io.algorithm.AlgorithmConfigXmlReader; import com.graphhopper.jsprit.io.algorithm.VehicleRoutingAlgorithms; - import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.network.Network; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.jsprit.MatsimJspritFactory; -import org.matsim.contrib.freight.jsprit.NetworkBasedTransportCosts; -import org.matsim.contrib.freight.jsprit.NetworkRouter; import org.matsim.core.config.Config; import org.matsim.core.network.io.MatsimNetworkReader; import org.matsim.core.scenario.ScenarioUtils; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.jsprit.MatsimJspritFactory; +import org.matsim.freight.carriers.jsprit.NetworkBasedTransportCosts; +import org.matsim.freight.carriers.jsprit.NetworkRouter; + +import java.util.Collection; final class InitialCarrierPlanCreator { diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/InnerOuterCityScenarioCreator.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/InnerOuterCityScenarioCreator.java similarity index 97% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/InnerOuterCityScenarioCreator.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/InnerOuterCityScenarioCreator.java index ffe602c1368..d5b48f1df69 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/InnerOuterCityScenarioCreator.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/InnerOuterCityScenarioCreator.java @@ -19,15 +19,15 @@ * */ -package org.matsim.contrib.freight.usecases.chessboard; +package org.matsim.freight.carriers.usecases.chessboard; + +import org.matsim.api.core.v01.Id; +import org.matsim.api.core.v01.network.Link; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.matsim.api.core.v01.Id; -import org.matsim.api.core.v01.network.Link; - final class InnerOuterCityScenarioCreator { diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/PassengerScenarioCreator.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/PassengerScenarioCreator.java similarity index 93% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/PassengerScenarioCreator.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/PassengerScenarioCreator.java index dc77dd1f8ef..e19d4b506bb 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/PassengerScenarioCreator.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/PassengerScenarioCreator.java @@ -19,22 +19,13 @@ * */ -package org.matsim.contrib.freight.usecases.chessboard; - -import java.util.ArrayList; -import java.util.List; +package org.matsim.freight.carriers.usecases.chessboard; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; import org.matsim.api.core.v01.network.Link; -import org.matsim.api.core.v01.population.Activity; -import org.matsim.api.core.v01.population.Leg; -import org.matsim.api.core.v01.population.Person; -import org.matsim.api.core.v01.population.Plan; -import org.matsim.api.core.v01.population.Population; -import org.matsim.api.core.v01.population.PopulationFactory; -import org.matsim.api.core.v01.population.PopulationWriter; +import org.matsim.api.core.v01.population.*; import org.matsim.core.config.Config; import org.matsim.core.network.io.MatsimNetworkReader; import org.matsim.core.population.routes.NetworkRoute; @@ -45,6 +36,9 @@ import org.matsim.core.router.util.LeastCostPathCalculator.Path; import org.matsim.core.scenario.ScenarioUtils; +import java.util.ArrayList; +import java.util.List; + final class PassengerScenarioCreator { static int agentCounter = 1; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/PlotPlans.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/PlotPlans.java similarity index 86% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/PlotPlans.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/PlotPlans.java index dbbe3ca8804..104519cfbfe 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/PlotPlans.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/PlotPlans.java @@ -19,24 +19,18 @@ * */ -package org.matsim.contrib.freight.usecases.chessboard; +package org.matsim.freight.carriers.usecases.chessboard; import com.graphhopper.jsprit.analysis.toolbox.Plotter; import com.graphhopper.jsprit.core.problem.VehicleRoutingProblem; import com.graphhopper.jsprit.core.problem.solution.VehicleRoutingProblemSolution; - import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierPlanXmlReader; -import org.matsim.contrib.freight.carrier.CarrierVehicleTypeLoader; -import org.matsim.contrib.freight.carrier.CarrierVehicleTypeReader; -import org.matsim.contrib.freight.carrier.CarrierVehicleTypes; -import org.matsim.contrib.freight.carrier.Carriers; -import org.matsim.contrib.freight.jsprit.MatsimJspritFactory; import org.matsim.core.config.Config; import org.matsim.core.network.io.MatsimNetworkReader; import org.matsim.core.scenario.ScenarioUtils; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.jsprit.MatsimJspritFactory; final class PlotPlans { diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/RunChessboard.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunChessboard.java similarity index 93% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/RunChessboard.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunChessboard.java index bf3d2682ef1..9409ebfea27 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/RunChessboard.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunChessboard.java @@ -19,18 +19,13 @@ * */ -package org.matsim.contrib.freight.usecases.chessboard; +package org.matsim.freight.carriers.usecases.chessboard; import com.google.inject.Provider; +import jakarta.inject.Inject; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; import org.matsim.api.core.v01.network.Network; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.controler.*; -import org.matsim.contrib.freight.usecases.analysis.CarrierScoreStats; -import org.matsim.contrib.freight.usecases.analysis.LegHistogram; -import org.matsim.contrib.freight.usecases.chessboard.CarrierScoringFunctionFactoryImpl.SimpleVehicleEmploymentScoring; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.controler.AbstractModule; @@ -50,8 +45,12 @@ import org.matsim.core.scoring.SumScoringFunction; import org.matsim.core.utils.io.IOUtils; import org.matsim.examples.ExamplesUtils; +import org.matsim.freight.carriers.FreightConfigGroup; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.controler.*; +import org.matsim.freight.carriers.usecases.analysis.CarrierScoreStats; +import org.matsim.freight.carriers.usecases.analysis.LegHistogram; -import jakarta.inject.Inject; import java.util.Map; public final class RunChessboard { @@ -124,7 +123,7 @@ private static class MyCarrierScoringFunctionFactory implements CarrierScoringFu @Override public ScoringFunction createScoringFunction(Carrier carrier) { SumScoringFunction sf = new SumScoringFunction(); sf.addScoringFunction( new CarrierScoringFunctionFactoryImpl.SimpleDriversLegScoring(carrier, network) ); - sf.addScoringFunction( new SimpleVehicleEmploymentScoring(carrier) ); + sf.addScoringFunction( new CarrierScoringFunctionFactoryImpl.SimpleVehicleEmploymentScoring(carrier) ); sf.addScoringFunction( new CarrierScoringFunctionFactoryImpl.SimpleDriversActivityScoring() ); return sf; } diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/RunPassengerAlongWithCarriers.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunPassengerAlongWithCarriers.java similarity index 89% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/RunPassengerAlongWithCarriers.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunPassengerAlongWithCarriers.java index 542c3add849..1ef48e6fed1 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/RunPassengerAlongWithCarriers.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunPassengerAlongWithCarriers.java @@ -19,19 +19,13 @@ * */ -package org.matsim.contrib.freight.usecases.chessboard; +package org.matsim.freight.carriers.usecases.chessboard; import com.google.inject.Provider; +import jakarta.inject.Inject; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; import org.matsim.api.core.v01.network.Network; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.controler.*; -import org.matsim.contrib.freight.usecases.analysis.CarrierScoreStats; -import org.matsim.contrib.freight.usecases.analysis.LegHistogram; -import org.matsim.contrib.freight.usecases.chessboard.CarrierScoringFunctionFactoryImpl.SimpleDriversActivityScoring; -import org.matsim.contrib.freight.usecases.chessboard.CarrierScoringFunctionFactoryImpl.SimpleDriversLegScoring; -import org.matsim.contrib.freight.usecases.chessboard.CarrierScoringFunctionFactoryImpl.SimpleVehicleEmploymentScoring; import org.matsim.core.api.experimental.events.EventsManager; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; @@ -52,8 +46,11 @@ import org.matsim.core.scoring.SumScoringFunction; import org.matsim.core.utils.io.IOUtils; import org.matsim.examples.ExamplesUtils; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.controler.*; +import org.matsim.freight.carriers.usecases.analysis.CarrierScoreStats; +import org.matsim.freight.carriers.usecases.analysis.LegHistogram; -import jakarta.inject.Inject; import java.net.URL; import java.util.Map; @@ -83,11 +80,11 @@ public void run() { controler.addOverridingModule( new AbstractModule(){ @Override public void install(){ this.bind( CarrierStrategyManager.class ).toProvider( new MyCarrierPlanStrategyManagerFactory(types) ); - this.bind( CarrierScoringFunctionFactory.class ).toInstance( carrier -> { + this.bind( CarrierScoringFunctionFactory.class ).toInstance(carrier -> { SumScoringFunction sf = new SumScoringFunction(); - sf.addScoringFunction( new SimpleDriversLegScoring( carrier, scenario.getNetwork() ) ); - sf.addScoringFunction( new SimpleVehicleEmploymentScoring( carrier ) ); - sf.addScoringFunction( new SimpleDriversActivityScoring() ); + sf.addScoringFunction( new CarrierScoringFunctionFactoryImpl.SimpleDriversLegScoring( carrier, scenario.getNetwork() ) ); + sf.addScoringFunction( new CarrierScoringFunctionFactoryImpl.SimpleVehicleEmploymentScoring( carrier ) ); + sf.addScoringFunction( new CarrierScoringFunctionFactoryImpl.SimpleDriversActivityScoring() ); return sf; } ); } diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/RunPassengerPlansFromConfig.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunPassengerPlansFromConfig.java similarity index 96% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/RunPassengerPlansFromConfig.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunPassengerPlansFromConfig.java index a8f38ac7adc..e2541d937bb 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/RunPassengerPlansFromConfig.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunPassengerPlansFromConfig.java @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.usecases.chessboard; +package org.matsim.freight.carriers.usecases.chessboard; import org.matsim.core.controler.Controler; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/RunPassengerPlansFromScratch.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunPassengerPlansFromScratch.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/RunPassengerPlansFromScratch.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunPassengerPlansFromScratch.java index 33b0e6d89d0..4e376f29d57 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/RunPassengerPlansFromScratch.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunPassengerPlansFromScratch.java @@ -19,11 +19,11 @@ * */ -package org.matsim.contrib.freight.usecases.chessboard; +package org.matsim.freight.carriers.usecases.chessboard; import org.matsim.core.config.Config; -import org.matsim.core.config.groups.ScoringConfigGroup.ActivityParams; import org.matsim.core.config.groups.ReplanningConfigGroup.StrategySettings; +import org.matsim.core.config.groups.ScoringConfigGroup.ActivityParams; import org.matsim.core.controler.Controler; import org.matsim.core.controler.OutputDirectoryHierarchy; diff --git a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/SelectBestPlanAndOptimizeItsVehicleRouteFactory.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/SelectBestPlanAndOptimizeItsVehicleRouteFactory.java similarity index 94% rename from contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/SelectBestPlanAndOptimizeItsVehicleRouteFactory.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/SelectBestPlanAndOptimizeItsVehicleRouteFactory.java index b04a3d526a2..fb1c8addc31 100644 --- a/contribs/freight/src/main/java/org/matsim/contrib/freight/usecases/chessboard/SelectBestPlanAndOptimizeItsVehicleRouteFactory.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/SelectBestPlanAndOptimizeItsVehicleRouteFactory.java @@ -19,10 +19,7 @@ * */ -package org.matsim.contrib.freight.usecases.chessboard; - -import java.net.URL; -import java.util.Collection; +package org.matsim.freight.carriers.usecases.chessboard; import com.graphhopper.jsprit.core.algorithm.VehicleRoutingAlgorithm; import com.graphhopper.jsprit.core.problem.VehicleRoutingProblem; @@ -33,14 +30,7 @@ import com.graphhopper.jsprit.core.problem.vehicle.Vehicle; import com.graphhopper.jsprit.core.util.Solutions; import com.graphhopper.jsprit.io.algorithm.VehicleRoutingAlgorithms; - import org.matsim.api.core.v01.network.Network; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierPlan; -import org.matsim.contrib.freight.carrier.CarrierVehicleTypes; -import org.matsim.contrib.freight.jsprit.MatsimJspritFactory; -import org.matsim.contrib.freight.jsprit.NetworkBasedTransportCosts; -import org.matsim.contrib.freight.jsprit.NetworkRouter; import org.matsim.core.replanning.GenericPlanStrategy; import org.matsim.core.replanning.GenericPlanStrategyImpl; import org.matsim.core.replanning.ReplanningContext; @@ -49,6 +39,15 @@ import org.matsim.core.router.util.TravelTime; import org.matsim.core.utils.io.IOUtils; import org.matsim.examples.ExamplesUtils; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierPlan; +import org.matsim.freight.carriers.carrier.CarrierVehicleTypes; +import org.matsim.freight.carriers.jsprit.MatsimJspritFactory; +import org.matsim.freight.carriers.jsprit.NetworkBasedTransportCosts; +import org.matsim.freight.carriers.jsprit.NetworkRouter; + +import java.net.URL; +import java.util.Collection; final class SelectBestPlanAndOptimizeItsVehicleRouteFactory { diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlWriterV1Test.java b/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlWriterV1Test.java deleted file mode 100644 index 10d1d752c7d..00000000000 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlWriterV1Test.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * *********************************************************************** * - * * project: org.matsim.* - * * ${file_name} - * * * - * * *********************************************************************** * - * * * - * * copyright : (C) ${year} by the members listed in the COPYING, * - * * LICENSE and WARRANTY file. * - * * email : info at matsim dot org * - * * * - * * *********************************************************************** * - * * * - * * This program is free software; you can redistribute it and/or modify * - * * it under the terms of the GNU General Public License as published by * - * * the Free Software Foundation; either version 2 of the License, or * - * * (at your option) any later version. * - * * See also COPYING, LICENSE and WARRANTY file * - * * * - * * *********************************************************************** - * - * ${filecomment} - * ${package_declaration} - * - * ${typecomment} - * ${type_declaration} - */ - -package org.matsim.contrib.freight.carrier; - -import org.junit.Rule; -import org.junit.Test; -import org.matsim.api.core.v01.Id; -import org.matsim.testcases.MatsimTestUtils; -import org.matsim.vehicles.VehicleType; -import org.matsim.vehicles.VehicleUtils; - -/** - */ -public class CarrierPlanXmlWriterV1Test { - - @Rule - public MatsimTestUtils testUtils = new MatsimTestUtils(); - - @Test - public void testCarrierPlanWriterWrites() { - - CarrierVehicleTypes carrierVehicleTypes = new CarrierVehicleTypes(); - new CarrierVehicleTypeReader( carrierVehicleTypes ).readFile( testUtils.getPackageInputDirectory() + "vehicleTypes_v2.xml" ); - VehicleType defaultVehicleType = VehicleUtils.getFactory().createVehicleType( Id.create("default", VehicleType.class ) ); - carrierVehicleTypes.getVehicleTypes().put( defaultVehicleType.getId(), defaultVehicleType ); - - Carriers carriers = new Carriers(); - CarrierPlanReaderV1 carrierPlanReaderV1 = new CarrierPlanReaderV1(carriers, carrierVehicleTypes ); - carrierPlanReaderV1.readFile(testUtils.getClassInputDirectory() + "carrierPlansEquils.xml"); - CarrierPlanXmlWriterV1 planWriter = new CarrierPlanXmlWriterV1(carriers.getCarriers().values()); - planWriter.write(testUtils.getOutputDirectory() + "carrierPlansEquilsWritten.xml"); - } - - -} diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeWriterTest.java b/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeWriterTest.java deleted file mode 100644 index 32e53807caf..00000000000 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeWriterTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.matsim.contrib.freight.carrier; - -import org.junit.Rule; -import org.junit.Test; -import org.matsim.testcases.MatsimTestUtils; - -public class CarrierVehicleTypeWriterTest { - - @Rule - public MatsimTestUtils utils = new MatsimTestUtils() ; - - @Test - public void testTypeWriter(){ - CarrierVehicleTypes types = new CarrierVehicleTypes(); - new CarrierVehicleTypeReader(types).readFile(utils.getClassInputDirectory()+ "vehicleTypes.xml"); - final String outputVehTypeFile = utils.getOutputDirectory()+ "vehicleTypesWritten.xml"; - new CarrierVehicleTypeWriter(types).write(outputVehTypeFile); - types.getVehicleTypes().clear(); - new CarrierVehicleTypeReader(types).readFile(outputVehTypeFile); - } -} diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/usecases/chessboard/RunPassengerAlongWithCarriersIT.java b/contribs/freight/src/test/java/org/matsim/contrib/freight/usecases/chessboard/RunPassengerAlongWithCarriersIT.java deleted file mode 100644 index 062ceb5a5d4..00000000000 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/usecases/chessboard/RunPassengerAlongWithCarriersIT.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.matsim.contrib.freight.usecases.chessboard; - -import org.junit.Assert; -import org.junit.Rule; -import org.junit.Test; -import org.matsim.core.config.Config; -import org.matsim.testcases.MatsimTestUtils; - -public class RunPassengerAlongWithCarriersIT { - - @Rule - public MatsimTestUtils utils = new MatsimTestUtils() ; - - @Test - public void runChessboard() { - try{ - RunPassengerAlongWithCarriers abc = new RunPassengerAlongWithCarriers(); - // --- - Config config = abc.prepareConfig(); - config.controller().setLastIteration( 1 ); - config.controller().setOutputDirectory( utils.getOutputDirectory() ); - // --- - abc.run(); - } catch (Exception ee ) { - ee.printStackTrace(); - Assert.fail("something went wrong: " + ee.getMessage()); - } - } - -} diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/FreightConfigGroupTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/FreightConfigGroupTest.java similarity index 63% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/FreightConfigGroupTest.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/FreightConfigGroupTest.java index 6dccd19f6b3..f6207d38b87 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/FreightConfigGroupTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/FreightConfigGroupTest.java @@ -1,11 +1,32 @@ -package org.matsim.contrib.freight; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers; import org.junit.Assert; import org.junit.Test; -import org.matsim.contrib.freight.FreightConfigGroup.UseDistanceConstraintForTourPlanning; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigReader; import org.matsim.core.config.ConfigUtils; +import org.matsim.freight.carriers.FreightConfigGroup.UseDistanceConstraintForTourPlanning; import java.io.ByteArrayInputStream; import java.io.InputStream; @@ -57,4 +78,4 @@ public void test_configXmlCanBeParsed() { Assert.assertEquals(UseDistanceConstraintForTourPlanning.basedOnEnergyConsumption, freight.getUseDistanceConstraintForTourPlanning()); } -} \ No newline at end of file +} diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierModuleTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierModuleTest.java similarity index 73% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierModuleTest.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierModuleTest.java index 0602fa8d545..8060ab9d81f 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierModuleTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierModuleTest.java @@ -1,34 +1,30 @@ -/* *********************************************************************** * - * project: org.matsim.* - * *********************************************************************** * - * * - * copyright : (C) 2007 by the members listed in the COPYING, * - * LICENSE and WARRANTY file. * - * email : info at matsim dot org * - * * - * *********************************************************************** * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * See also COPYING, LICENSE and WARRANTY file * - * * - * *********************************************************************** */ +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ -package org.matsim.contrib.freight.carrier; +package org.matsim.freight.carriers.carrier; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.matsim.api.core.v01.Scenario; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.controler.CarrierModule; -import org.matsim.contrib.freight.controler.CarrierStrategyManager; -import org.matsim.contrib.freight.mobsim.DistanceScoringFunctionFactoryForTests; -import org.matsim.contrib.freight.mobsim.StrategyManagerFactoryForTests; -import org.matsim.contrib.freight.controler.CarrierScoringFunctionFactory; -import org.matsim.contrib.freight.controler.FreightUtils; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.ScoringConfigGroup; @@ -36,6 +32,13 @@ import org.matsim.core.controler.Controler; import org.matsim.core.controler.OutputDirectoryHierarchy; import org.matsim.core.scenario.ScenarioUtils; +import org.matsim.freight.carriers.FreightConfigGroup; +import org.matsim.freight.carriers.controler.CarrierModule; +import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controler.FreightUtils; +import org.matsim.freight.carriers.mobsim.DistanceScoringFunctionFactoryForTests; +import org.matsim.freight.carriers.mobsim.StrategyManagerFactoryForTests; import org.matsim.testcases.MatsimTestUtils; public class CarrierModuleTest { diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierPlanReaderV1Test.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierPlanReaderV1Test.java similarity index 75% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierPlanReaderV1Test.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierPlanReaderV1Test.java index 43b8b89c8a3..4c6e9eeb70e 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierPlanReaderV1Test.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierPlanReaderV1Test.java @@ -1,34 +1,32 @@ /* - * *********************************************************************** * - * * project: org.matsim.* - * * CarrierPlanReaderV1Test.java - * * * - * * *********************************************************************** * - * * * - * * copyright : (C) ${year} by the members listed in the COPYING, * - * * LICENSE and WARRANTY file. * - * * email : info at matsim dot org * - * * * - * * *********************************************************************** * - * * * - * * This program is free software; you can redistribute it and/or modify * - * * it under the terms of the GNU General Public License as published by * - * * the Free Software Foundation; either version 2 of the License, or * - * * (at your option) any later version. * - * * See also COPYING, LICENSE and WARRANTY file * - * * * - * * *********************************************************************** + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** * */ -package org.matsim.contrib.freight.carrier; +package org.matsim.freight.carriers.carrier; import org.junit.Assert; import org.junit.Rule; import org.junit.Test; import org.matsim.api.core.v01.Id; -import org.matsim.contrib.freight.carrier.Tour.Leg; import org.matsim.core.population.routes.NetworkRoute; +import org.matsim.freight.carriers.carrier.Tour.Leg; import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.VehicleType; import org.matsim.vehicles.VehicleUtils; diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlReaderV2Test.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlReaderV2Test.java similarity index 82% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlReaderV2Test.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlReaderV2Test.java index 6b2a8192004..85a69c33fb6 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlReaderV2Test.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlReaderV2Test.java @@ -1,23 +1,47 @@ -package org.matsim.contrib.freight.carrier; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.nio.charset.StandardCharsets; -import java.util.*; - -import org.junit.*; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.carrier; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; -import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize; -import org.matsim.contrib.freight.controler.FreightUtils; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.gbl.Gbl; import org.matsim.core.scenario.ScenarioUtils; +import org.matsim.freight.carriers.carrier.CarrierCapabilities.FleetSize; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.Vehicle; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.util.*; + public class CarrierPlanXmlReaderV2Test { @Rule diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlReaderV2WithDtdTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlReaderV2WithDtdTest.java similarity index 78% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlReaderV2WithDtdTest.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlReaderV2WithDtdTest.java index 1df7bfc15a0..642f81238a4 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlReaderV2WithDtdTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlReaderV2WithDtdTest.java @@ -1,13 +1,30 @@ -package org.matsim.contrib.freight.carrier; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.carrier; + +import org.junit.*; import org.matsim.api.core.v01.Id; -import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize; import org.matsim.core.gbl.Gbl; +import org.matsim.freight.carriers.carrier.CarrierCapabilities.FleetSize; import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.Vehicle; diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlWriterV1Test.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlWriterV1Test.java new file mode 100644 index 00000000000..9c6124dc0bf --- /dev/null +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlWriterV1Test.java @@ -0,0 +1,54 @@ +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.carrier; + +import org.junit.Rule; +import org.junit.Test; +import org.matsim.api.core.v01.Id; +import org.matsim.testcases.MatsimTestUtils; +import org.matsim.vehicles.VehicleType; +import org.matsim.vehicles.VehicleUtils; + +/** + */ +public class CarrierPlanXmlWriterV1Test { + + @Rule + public MatsimTestUtils testUtils = new MatsimTestUtils(); + + @Test + public void testCarrierPlanWriterWrites() { + + CarrierVehicleTypes carrierVehicleTypes = new CarrierVehicleTypes(); + new CarrierVehicleTypeReader( carrierVehicleTypes ).readFile( testUtils.getPackageInputDirectory() + "vehicleTypes_v2.xml" ); + VehicleType defaultVehicleType = VehicleUtils.getFactory().createVehicleType( Id.create("default", VehicleType.class ) ); + carrierVehicleTypes.getVehicleTypes().put( defaultVehicleType.getId(), defaultVehicleType ); + + Carriers carriers = new Carriers(); + CarrierPlanReaderV1 carrierPlanReaderV1 = new CarrierPlanReaderV1(carriers, carrierVehicleTypes ); + carrierPlanReaderV1.readFile(testUtils.getClassInputDirectory() + "carrierPlansEquils.xml"); + CarrierPlanXmlWriterV1 planWriter = new CarrierPlanXmlWriterV1(carriers.getCarriers().values()); + planWriter.write(testUtils.getOutputDirectory() + "carrierPlansEquilsWritten.xml"); + } + + +} diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlWriterV2Test.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlWriterV2Test.java similarity index 79% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlWriterV2Test.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlWriterV2Test.java index 34bb84d4b0d..71e055eb503 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlWriterV2Test.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlWriterV2Test.java @@ -1,11 +1,32 @@ -package org.matsim.contrib.freight.carrier; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.carrier; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.TransportMode; -import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize; +import org.matsim.freight.carriers.carrier.CarrierCapabilities.FleetSize; import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.Vehicle; diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlWriterV2_1Test.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlWriterV2_1Test.java similarity index 81% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlWriterV2_1Test.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlWriterV2_1Test.java index ca23da29f27..b6912413ae2 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierPlanXmlWriterV2_1Test.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierPlanXmlWriterV2_1Test.java @@ -1,12 +1,33 @@ -package org.matsim.contrib.freight.carrier; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.carrier; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.TransportMode; -import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize; -import org.matsim.contrib.freight.controler.FreightUtils; +import org.matsim.freight.carriers.carrier.CarrierCapabilities.FleetSize; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.Vehicle; diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierReadWriteV2_1Test.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierReadWriteV2_1Test.java similarity index 63% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierReadWriteV2_1Test.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierReadWriteV2_1Test.java index 6e2d521fc40..af53fe2c683 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierReadWriteV2_1Test.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierReadWriteV2_1Test.java @@ -1,4 +1,25 @@ -package org.matsim.contrib.freight.carrier; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.carrier; import org.junit.Rule; import org.junit.Test; diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierUtilsTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierUtilsTest.java similarity index 72% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierUtilsTest.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierUtilsTest.java index fa847124348..1aa8faf75ad 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierUtilsTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierUtilsTest.java @@ -1,32 +1,25 @@ /* - * *********************************************************************** * - * * project: org.matsim.* - * * ${file_name} - * * * - * * *********************************************************************** * - * * * - * * copyright : (C) ${year} by the members listed in the COPYING, * - * * LICENSE and WARRANTY file. * - * * email : info at matsim dot org * - * * * - * * *********************************************************************** * - * * * - * * This program is free software; you can redistribute it and/or modify * - * * it under the terms of the GNU General Public License as published by * - * * the Free Software Foundation; either version 2 of the License, or * - * * (at your option) any later version. * - * * See also COPYING, LICENSE and WARRANTY file * - * * * - * * *********************************************************************** + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** * - * ${filecomment} - * ${package_declaration} - * - * ${typecomment} - * ${type_declaration} */ -package org.matsim.contrib.freight.carrier; +package org.matsim.freight.carriers.carrier; import org.junit.Assert; import org.junit.Rule; @@ -118,5 +111,5 @@ public void testGetSetJspritIteration(){ CarrierUtils.setJspritIterations(carrier, 125); Assert.assertEquals(125, CarrierUtils.getJspritIterations(carrier) ); } - + } diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeLoaderTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeLoaderTest.java similarity index 69% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeLoaderTest.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeLoaderTest.java index cc2866cb29f..2801321b3a7 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeLoaderTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeLoaderTest.java @@ -1,4 +1,25 @@ -package org.matsim.contrib.freight.carrier; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.carrier; import org.junit.Assert; import org.junit.Before; diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeReaderTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeReaderTest.java similarity index 73% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeReaderTest.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeReaderTest.java index 6de7487a28f..c48994ce0e3 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeReaderTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeReaderTest.java @@ -1,4 +1,25 @@ -package org.matsim.contrib.freight.carrier; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.carrier; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeTest.java similarity index 85% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeTest.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeTest.java index fd016cb0331..5eaa67786b3 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/carrier/CarrierVehicleTypeTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeTest.java @@ -1,4 +1,25 @@ -package org.matsim.contrib.freight.carrier; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.carrier; import org.junit.Assert; import org.junit.Before; diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeWriterTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeWriterTest.java new file mode 100644 index 00000000000..0f2101b31c8 --- /dev/null +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/carrier/CarrierVehicleTypeWriterTest.java @@ -0,0 +1,42 @@ +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.carrier; + +import org.junit.Rule; +import org.junit.Test; +import org.matsim.testcases.MatsimTestUtils; + +public class CarrierVehicleTypeWriterTest { + + @Rule + public MatsimTestUtils utils = new MatsimTestUtils() ; + + @Test + public void testTypeWriter(){ + CarrierVehicleTypes types = new CarrierVehicleTypes(); + new CarrierVehicleTypeReader(types).readFile(utils.getClassInputDirectory()+ "vehicleTypes.xml"); + final String outputVehTypeFile = utils.getOutputDirectory()+ "vehicleTypesWritten.xml"; + new CarrierVehicleTypeWriter(types).write(outputVehTypeFile); + types.getVehicleTypes().clear(); + new CarrierVehicleTypeReader(types).readFile(outputVehTypeFile); + } +} diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/controler/EquilWithCarrierWithPersonsIT.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/controler/EquilWithCarrierWithPersonsIT.java similarity index 72% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/controler/EquilWithCarrierWithPersonsIT.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/controler/EquilWithCarrierWithPersonsIT.java index 4741b7de8fa..8b76445b96c 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/controler/EquilWithCarrierWithPersonsIT.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/controler/EquilWithCarrierWithPersonsIT.java @@ -1,24 +1,25 @@ -/* *********************************************************************** * - * project: org.matsim.* - * EquilWithCarrierTest.java - * * - * *********************************************************************** * - * * - * copyright : (C) 2011 by the members listed in the COPYING, * - * LICENSE and WARRANTY file. * - * email : info at matsim dot org * - * * - * *********************************************************************** * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * See also COPYING, LICENSE and WARRANTY file * - * * - * *********************************************************************** */ - -package org.matsim.contrib.freight.controler; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.controler; import org.junit.Assert; import org.junit.Before; @@ -26,16 +27,16 @@ import org.junit.Test; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.mobsim.DistanceScoringFunctionFactoryForTests; -import org.matsim.contrib.freight.mobsim.StrategyManagerFactoryForTests; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; -import org.matsim.core.config.groups.ScoringConfigGroup.ActivityParams; import org.matsim.core.config.groups.ReplanningConfigGroup.StrategySettings; +import org.matsim.core.config.groups.ScoringConfigGroup.ActivityParams; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; import org.matsim.core.scenario.ScenarioUtils; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.mobsim.DistanceScoringFunctionFactoryForTests; +import org.matsim.freight.carriers.mobsim.StrategyManagerFactoryForTests; import org.matsim.testcases.MatsimTestUtils; public class EquilWithCarrierWithPersonsIT { diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/controler/EquilWithCarrierWithoutPersonsIT.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/controler/EquilWithCarrierWithoutPersonsIT.java similarity index 83% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/controler/EquilWithCarrierWithoutPersonsIT.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/controler/EquilWithCarrierWithoutPersonsIT.java index b14d8a8b9df..b3c9d4ba29e 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/controler/EquilWithCarrierWithoutPersonsIT.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/controler/EquilWithCarrierWithoutPersonsIT.java @@ -1,41 +1,42 @@ -/* *********************************************************************** * - * project: org.matsim.* - * EquilWithCarrierTest.java - * * - * *********************************************************************** * - * * - * copyright : (C) 2011 by the members listed in the COPYING, * - * LICENSE and WARRANTY file. * - * email : info at matsim dot org * - * * - * *********************************************************************** * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * See also COPYING, LICENSE and WARRANTY file * - * * - * *********************************************************************** */ - -package org.matsim.contrib.freight.controler; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.controler; import org.junit.Assert; import org.junit.Rule; import org.junit.Test; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.ScheduledTour; -import org.matsim.contrib.freight.carrier.Tour; -import org.matsim.contrib.freight.mobsim.DistanceScoringFunctionFactoryForTests; -import org.matsim.contrib.freight.mobsim.StrategyManagerFactoryForTests; -import org.matsim.contrib.freight.mobsim.TimeScoringFunctionFactoryForTests; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.freight.carriers.FreightConfigGroup; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.ScheduledTour; +import org.matsim.freight.carriers.carrier.Tour; +import org.matsim.freight.carriers.mobsim.DistanceScoringFunctionFactoryForTests; +import org.matsim.freight.carriers.mobsim.StrategyManagerFactoryForTests; +import org.matsim.freight.carriers.mobsim.TimeScoringFunctionFactoryForTests; import org.matsim.testcases.MatsimTestUtils; public class EquilWithCarrierWithoutPersonsIT { diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/jsprit/DistanceConstraintFromVehiclesFileTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/DistanceConstraintFromVehiclesFileTest.java similarity index 97% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/jsprit/DistanceConstraintFromVehiclesFileTest.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/DistanceConstraintFromVehiclesFileTest.java index acd6613d0c4..f5023a03fc6 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/jsprit/DistanceConstraintFromVehiclesFileTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/DistanceConstraintFromVehiclesFileTest.java @@ -3,7 +3,7 @@ * project: org.matsim.* * *********************************************************************** * * * - * copyright : (C) 2020 by the members listed in the COPYING, * + * copyright : (C) by the members listed in the COPYING, * * LICENSE and WARRANTY file. * * email : info at matsim dot org * * * @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.jsprit; +package org.matsim.freight.carriers.jsprit; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -28,11 +28,6 @@ import org.junit.Test; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.FreightConfigGroup.UseDistanceConstraintForTourPlanning; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize; -import org.matsim.contrib.freight.controler.FreightUtils; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.ControllerConfigGroup.CompressionType; @@ -43,6 +38,11 @@ import org.matsim.core.scenario.ScenarioUtils; import org.matsim.core.utils.io.IOUtils; import org.matsim.examples.ExamplesUtils; +import org.matsim.freight.carriers.FreightConfigGroup; +import org.matsim.freight.carriers.FreightConfigGroup.UseDistanceConstraintForTourPlanning; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.carrier.CarrierCapabilities.FleetSize; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.VehicleType; diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/jsprit/DistanceConstraintTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/DistanceConstraintTest.java similarity index 98% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/jsprit/DistanceConstraintTest.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/DistanceConstraintTest.java index fd47350bfb5..af8ed931927 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/jsprit/DistanceConstraintTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/DistanceConstraintTest.java @@ -3,7 +3,7 @@ * project: org.matsim.* * *********************************************************************** * * * - * copyright : (C) 2020 by the members listed in the COPYING, * + * copyright : (C) by the members listed in the COPYING, * * LICENSE and WARRANTY file. * * email : info at matsim dot org * * * @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.jsprit; +package org.matsim.freight.carriers.jsprit; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -28,11 +28,6 @@ import org.junit.Test; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.FreightConfigGroup.UseDistanceConstraintForTourPlanning; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize; -import org.matsim.contrib.freight.controler.FreightUtils; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.ControllerConfigGroup.CompressionType; @@ -43,6 +38,11 @@ import org.matsim.core.scenario.ScenarioUtils; import org.matsim.core.utils.io.IOUtils; import org.matsim.examples.ExamplesUtils; +import org.matsim.freight.carriers.FreightConfigGroup; +import org.matsim.freight.carriers.FreightConfigGroup.UseDistanceConstraintForTourPlanning; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.carrier.CarrierCapabilities.FleetSize; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.VehicleType; diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/jsprit/FixedCostsTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/FixedCostsTest.java similarity index 87% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/jsprit/FixedCostsTest.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/FixedCostsTest.java index ddb57fda7bf..fced3431ab7 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/jsprit/FixedCostsTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/FixedCostsTest.java @@ -1,30 +1,34 @@ -/* *********************************************************************** * - * project: org.matsim.* - * *********************************************************************** * - * * - * copyright : (C) 2019 by the members listed in the COPYING, * - * LICENSE and WARRANTY file. * - * email : info at matsim dot org * - * * - * *********************************************************************** * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * See also COPYING, LICENSE and WARRANTY file * - * * - * *********************************************************************** */ - - -package org.matsim.contrib.freight.jsprit; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + + +package org.matsim.freight.carriers.jsprit; import com.graphhopper.jsprit.core.algorithm.VehicleRoutingAlgorithm; import com.graphhopper.jsprit.core.algorithm.box.SchrimpfFactory; import com.graphhopper.jsprit.core.problem.VehicleRoutingProblem; import com.graphhopper.jsprit.core.problem.solution.VehicleRoutingProblemSolution; import com.graphhopper.jsprit.core.util.Solutions; - +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.junit.Assert; import org.junit.Before; import org.junit.Rule; @@ -32,17 +36,18 @@ import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.network.Network; -import org.matsim.contrib.freight.carrier.*; import org.matsim.core.network.NetworkUtils; import org.matsim.core.network.io.MatsimNetworkReader; import org.matsim.core.utils.io.IOUtils; +import org.matsim.freight.carriers.carrier.*; import org.matsim.testcases.MatsimTestUtils; -import org.matsim.vehicles.*; +import org.matsim.vehicles.EngineInformation; +import org.matsim.vehicles.Vehicle; +import org.matsim.vehicles.VehicleType; +import org.matsim.vehicles.VehicleUtils; import java.net.URL; import java.util.Collection; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; /** diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/jsprit/IntegrationIT.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/IntegrationIT.java similarity index 72% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/jsprit/IntegrationIT.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/IntegrationIT.java index 63f9a6a3bdf..2ba76434464 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/jsprit/IntegrationIT.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/IntegrationIT.java @@ -1,4 +1,25 @@ -package org.matsim.contrib.freight.jsprit; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.jsprit; import com.graphhopper.jsprit.core.algorithm.VehicleRoutingAlgorithm; import com.graphhopper.jsprit.core.algorithm.box.SchrimpfFactory; @@ -11,14 +32,14 @@ import org.junit.Test; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.network.Network; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.jsprit.NetworkBasedTransportCosts.Builder; -import org.matsim.contrib.freight.controler.FreightUtils; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.network.io.MatsimNetworkReader; import org.matsim.core.scenario.ScenarioUtils; +import org.matsim.freight.carriers.FreightConfigGroup; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.controler.FreightUtils; +import org.matsim.freight.carriers.jsprit.NetworkBasedTransportCosts.Builder; import org.matsim.testcases.MatsimTestUtils; import java.util.concurrent.ExecutionException; diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/jsprit/MatsimTransformerTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/MatsimTransformerTest.java similarity index 93% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/jsprit/MatsimTransformerTest.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/MatsimTransformerTest.java index c552a2af778..3b1d20bc402 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/jsprit/MatsimTransformerTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/MatsimTransformerTest.java @@ -1,15 +1,25 @@ -package org.matsim.contrib.freight.jsprit; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.not; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.jsprit; import com.graphhopper.jsprit.core.problem.Location; import com.graphhopper.jsprit.core.problem.VehicleRoutingProblem; @@ -21,18 +31,26 @@ import com.graphhopper.jsprit.core.problem.vehicle.Vehicle; import com.graphhopper.jsprit.core.problem.vehicle.VehicleImpl; import com.graphhopper.jsprit.core.problem.vehicle.VehicleTypeImpl; - import org.junit.Rule; import org.junit.Test; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.network.Network; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize; import org.matsim.core.network.NetworkUtils; import org.matsim.core.network.io.MatsimNetworkReader; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.carrier.CarrierCapabilities.FleetSize; import org.matsim.testcases.MatsimTestUtils; -import org.matsim.vehicles.*; +import org.matsim.vehicles.VehicleType; +import org.matsim.vehicles.VehicleUtils; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.junit.Assert.*; public class MatsimTransformerTest { @@ -214,9 +232,9 @@ private VehicleRoutingProblem getVehicleRoutingProblem(ScheduledTour sTour) { private Collection getJobsFrom(ScheduledTour sTour) { Collection services = new ArrayList(); for (Tour.TourElement e : sTour.getTour().getTourElements()) { - if (e instanceof org.matsim.contrib.freight.carrier.Tour.TourActivity) { - if (e instanceof org.matsim.contrib.freight.carrier.Tour.ServiceActivity) { - CarrierService carrierService = ((org.matsim.contrib.freight.carrier.Tour.ServiceActivity) e) + if (e instanceof Tour.TourActivity) { + if (e instanceof Tour.ServiceActivity) { + CarrierService carrierService = ((Tour.ServiceActivity) e) .getService(); Service service = Service.Builder.newInstance(carrierService.getId().toString()) .setLocation(Location.newInstance(carrierService.getLocationLinkId().toString())).build(); diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/jsprit/NetworkBasedTransportCostsTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/NetworkBasedTransportCostsTest.java similarity index 83% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/jsprit/NetworkBasedTransportCostsTest.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/NetworkBasedTransportCostsTest.java index 89766d95521..e85cb3ce9a1 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/jsprit/NetworkBasedTransportCostsTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/NetworkBasedTransportCostsTest.java @@ -1,14 +1,29 @@ -package org.matsim.contrib.freight.jsprit; - -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -import java.util.Arrays; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.jsprit; import com.graphhopper.jsprit.core.problem.Location; import com.graphhopper.jsprit.core.problem.driver.Driver; import com.graphhopper.jsprit.core.problem.vehicle.Vehicle; - import org.junit.Assert; import org.junit.Rule; import org.junit.Test; @@ -23,6 +38,11 @@ import org.matsim.vehicles.VehicleType; import org.matsim.vehicles.VehicleUtils; +import java.util.Arrays; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + public class NetworkBasedTransportCostsTest { diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/jsprit/SkillsIT.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/SkillsIT.java similarity index 88% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/jsprit/SkillsIT.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/SkillsIT.java index a0fe40c3b50..f1204001698 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/jsprit/SkillsIT.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/SkillsIT.java @@ -1,21 +1,24 @@ -/* *********************************************************************** * - * project: org.matsim.* - * *********************************************************************** * - * * - * copyright : (C) 2019 by the members listed in the COPYING, * - * LICENSE and WARRANTY file. * - * email : info at matsim dot org * - * * - * *********************************************************************** * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * See also COPYING, LICENSE and WARRANTY file * - * * - * *********************************************************************** */ -package org.matsim.contrib.freight.jsprit; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ +package org.matsim.freight.carriers.jsprit; import com.graphhopper.jsprit.core.algorithm.VehicleRoutingAlgorithm; import com.graphhopper.jsprit.core.algorithm.box.SchrimpfFactory; @@ -29,12 +32,12 @@ import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.network.Link; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.controler.FreightUtils; import org.matsim.core.config.ConfigUtils; import org.matsim.core.network.io.MatsimNetworkReader; import org.matsim.core.scenario.ScenarioUtils; import org.matsim.core.utils.misc.Time; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.VehicleType; diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/mobsim/DistanceScoringFunctionFactoryForTests.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/DistanceScoringFunctionFactoryForTests.java similarity index 76% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/mobsim/DistanceScoringFunctionFactoryForTests.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/DistanceScoringFunctionFactoryForTests.java index 1aa2c0765aa..2afebf0bbf7 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/mobsim/DistanceScoringFunctionFactoryForTests.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/DistanceScoringFunctionFactoryForTests.java @@ -1,8 +1,27 @@ -package org.matsim.contrib.freight.mobsim; - -import java.util.HashSet; -import java.util.Set; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.mobsim; +import jakarta.inject.Inject; import org.junit.Ignore; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Link; @@ -10,11 +29,6 @@ import org.matsim.api.core.v01.population.Activity; import org.matsim.api.core.v01.population.Leg; import org.matsim.api.core.v01.population.Person; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierUtils; -import org.matsim.contrib.freight.carrier.CarrierVehicle; -import org.matsim.contrib.freight.carrier.CarrierConstants; -import org.matsim.contrib.freight.controler.CarrierScoringFunctionFactory; import org.matsim.core.gbl.Gbl; import org.matsim.core.population.routes.NetworkRoute; import org.matsim.core.scoring.ScoringFunction; @@ -22,9 +36,15 @@ import org.matsim.deprecated.scoring.ScoringFunctionAccumulator.ActivityScoring; import org.matsim.deprecated.scoring.ScoringFunctionAccumulator.BasicScoring; import org.matsim.deprecated.scoring.ScoringFunctionAccumulator.LegScoring; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierConstants; +import org.matsim.freight.carriers.carrier.CarrierUtils; +import org.matsim.freight.carriers.carrier.CarrierVehicle; +import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; import org.matsim.vehicles.Vehicle; -import jakarta.inject.Inject; +import java.util.HashSet; +import java.util.Set; @Ignore public class DistanceScoringFunctionFactoryForTests implements CarrierScoringFunctionFactory{ diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/mobsim/ScoringFunctionFactoryForTests.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/ScoringFunctionFactoryForTests.java similarity index 74% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/mobsim/ScoringFunctionFactoryForTests.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/ScoringFunctionFactoryForTests.java index 50e4779092b..2280388ccc4 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/mobsim/ScoringFunctionFactoryForTests.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/ScoringFunctionFactoryForTests.java @@ -1,7 +1,25 @@ -package org.matsim.contrib.freight.mobsim; - -import java.util.HashSet; -import java.util.Set; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.mobsim; import org.junit.Ignore; import org.matsim.api.core.v01.Id; @@ -10,11 +28,6 @@ import org.matsim.api.core.v01.population.Activity; import org.matsim.api.core.v01.population.Leg; import org.matsim.api.core.v01.population.Person; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierUtils; -import org.matsim.contrib.freight.carrier.CarrierVehicle; -import org.matsim.contrib.freight.carrier.CarrierConstants; -import org.matsim.contrib.freight.controler.CarrierScoringFunctionFactory; import org.matsim.core.gbl.Gbl; import org.matsim.core.population.routes.NetworkRoute; import org.matsim.core.scoring.ScoringFunction; @@ -22,8 +35,16 @@ import org.matsim.deprecated.scoring.ScoringFunctionAccumulator.ActivityScoring; import org.matsim.deprecated.scoring.ScoringFunctionAccumulator.BasicScoring; import org.matsim.deprecated.scoring.ScoringFunctionAccumulator.LegScoring; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierConstants; +import org.matsim.freight.carriers.carrier.CarrierUtils; +import org.matsim.freight.carriers.carrier.CarrierVehicle; +import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; import org.matsim.vehicles.Vehicle; +import java.util.HashSet; +import java.util.Set; + @Ignore public class ScoringFunctionFactoryForTests implements CarrierScoringFunctionFactory{ diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/mobsim/StrategyManagerFactoryForTests.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/StrategyManagerFactoryForTests.java similarity index 60% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/mobsim/StrategyManagerFactoryForTests.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/StrategyManagerFactoryForTests.java index e7c4e9c88ee..0f5cb34fedd 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/mobsim/StrategyManagerFactoryForTests.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/StrategyManagerFactoryForTests.java @@ -1,25 +1,46 @@ -package org.matsim.contrib.freight.mobsim; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.mobsim; import com.google.inject.Provider; +import jakarta.inject.Inject; import org.junit.Ignore; import org.matsim.api.core.v01.TransportMode; import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.network.Network; import org.matsim.api.core.v01.population.Person; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierPlan; -import org.matsim.contrib.freight.controler.CarrierReRouteVehicles; -import org.matsim.contrib.freight.controler.CarrierStrategyManager; -import org.matsim.contrib.freight.controler.FreightUtils; import org.matsim.core.replanning.GenericPlanStrategyImpl; import org.matsim.core.replanning.selectors.BestPlanSelector; import org.matsim.core.router.speedy.SpeedyALTFactory; import org.matsim.core.router.util.LeastCostPathCalculator; import org.matsim.core.router.util.TravelDisutility; import org.matsim.core.router.util.TravelTime; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierPlan; +import org.matsim.freight.carriers.controler.CarrierReRouteVehicles; +import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.vehicles.Vehicle; -import jakarta.inject.Inject; import java.util.Map; @Ignore diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/mobsim/TimeScoringFunctionFactoryForTests.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/TimeScoringFunctionFactoryForTests.java similarity index 77% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/mobsim/TimeScoringFunctionFactoryForTests.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/TimeScoringFunctionFactoryForTests.java index a7ec4c15612..d4bc990052d 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/mobsim/TimeScoringFunctionFactoryForTests.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/TimeScoringFunctionFactoryForTests.java @@ -1,10 +1,27 @@ -package org.matsim.contrib.freight.mobsim; - -import java.util.HashSet; -import java.util.Set; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.mobsim; import jakarta.inject.Inject; - import org.junit.Ignore; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Link; @@ -12,11 +29,6 @@ import org.matsim.api.core.v01.population.Activity; import org.matsim.api.core.v01.population.Leg; import org.matsim.api.core.v01.population.Person; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierUtils; -import org.matsim.contrib.freight.carrier.CarrierVehicle; -import org.matsim.contrib.freight.carrier.CarrierConstants; -import org.matsim.contrib.freight.controler.CarrierScoringFunctionFactory; import org.matsim.core.population.routes.NetworkRoute; import org.matsim.core.scoring.ScoringFunction; import org.matsim.core.utils.misc.Time; @@ -24,8 +36,16 @@ import org.matsim.deprecated.scoring.ScoringFunctionAccumulator.ActivityScoring; import org.matsim.deprecated.scoring.ScoringFunctionAccumulator.BasicScoring; import org.matsim.deprecated.scoring.ScoringFunctionAccumulator.LegScoring; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierConstants; +import org.matsim.freight.carriers.carrier.CarrierUtils; +import org.matsim.freight.carriers.carrier.CarrierVehicle; +import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; import org.matsim.vehicles.Vehicle; +import java.util.HashSet; +import java.util.Set; + @Ignore public class TimeScoringFunctionFactoryForTests implements CarrierScoringFunctionFactory{ diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/usecases/chessboard/RunChessboardIT.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/usecases/chessboard/RunChessboardIT.java similarity index 58% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/usecases/chessboard/RunChessboardIT.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/usecases/chessboard/RunChessboardIT.java index 6bc1155ae7f..593b7786a62 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/usecases/chessboard/RunChessboardIT.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/usecases/chessboard/RunChessboardIT.java @@ -1,4 +1,25 @@ -package org.matsim.contrib.freight.usecases.chessboard; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.usecases.chessboard; import org.junit.Assert; import org.junit.Rule; diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/usecases/chessboard/RunPassengerAlongWithCarriersIT.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/usecases/chessboard/RunPassengerAlongWithCarriersIT.java new file mode 100644 index 00000000000..0749341e978 --- /dev/null +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/usecases/chessboard/RunPassengerAlongWithCarriersIT.java @@ -0,0 +1,51 @@ +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.usecases.chessboard; + +import org.junit.Assert; +import org.junit.Rule; +import org.junit.Test; +import org.matsim.core.config.Config; +import org.matsim.testcases.MatsimTestUtils; + +public class RunPassengerAlongWithCarriersIT { + + @Rule + public MatsimTestUtils utils = new MatsimTestUtils() ; + + @Test + public void runChessboard() { + try{ + RunPassengerAlongWithCarriers abc = new RunPassengerAlongWithCarriers(); + // --- + Config config = abc.prepareConfig(); + config.controller().setLastIteration( 1 ); + config.controller().setOutputDirectory( utils.getOutputDirectory() ); + // --- + abc.run(); + } catch (Exception ee ) { + ee.printStackTrace(); + Assert.fail("something went wrong: " + ee.getMessage()); + } + } + +} diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/utils/FreightUtilsIT.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/utils/FreightUtilsIT.java similarity index 89% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/utils/FreightUtilsIT.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/utils/FreightUtilsIT.java index 6f9c44c6258..5bcf8fdf72c 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/utils/FreightUtilsIT.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/utils/FreightUtilsIT.java @@ -1,51 +1,52 @@ -/* *********************************************************************** * - * project: org.matsim.* - * *********************************************************************** * - * * - * copyright : (C) 2018 by the members listed in the COPYING, * - * LICENSE and WARRANTY file. * - * email : info at matsim dot org * - * * - * *********************************************************************** * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * See also COPYING, LICENSE and WARRANTY file * - * * - * *********************************************************************** */ - -package org.matsim.contrib.freight.utils; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ -import java.util.Collection; +package org.matsim.freight.carriers.utils; +import com.graphhopper.jsprit.core.algorithm.VehicleRoutingAlgorithm; +import com.graphhopper.jsprit.core.algorithm.box.SchrimpfFactory; +import com.graphhopper.jsprit.core.problem.VehicleRoutingProblem; +import com.graphhopper.jsprit.core.problem.solution.VehicleRoutingProblemSolution; +import com.graphhopper.jsprit.core.util.Solutions; +import org.junit.Assert; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.network.Network; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize; -import org.matsim.contrib.freight.controler.FreightUtils; -import org.matsim.contrib.freight.jsprit.MatsimJspritFactory; -import org.matsim.contrib.freight.jsprit.NetworkBasedTransportCosts; -import org.matsim.contrib.freight.jsprit.NetworkRouter; -import org.matsim.contrib.freight.jsprit.NetworkBasedTransportCosts.Builder; import org.matsim.core.network.NetworkUtils; import org.matsim.core.network.io.MatsimNetworkReader; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.carrier.CarrierCapabilities.FleetSize; +import org.matsim.freight.carriers.controler.FreightUtils; +import org.matsim.freight.carriers.jsprit.MatsimJspritFactory; +import org.matsim.freight.carriers.jsprit.NetworkBasedTransportCosts; +import org.matsim.freight.carriers.jsprit.NetworkBasedTransportCosts.Builder; +import org.matsim.freight.carriers.jsprit.NetworkRouter; import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.*; import org.matsim.vehicles.EngineInformation.FuelType; -import com.graphhopper.jsprit.core.algorithm.VehicleRoutingAlgorithm; -import com.graphhopper.jsprit.core.algorithm.box.SchrimpfFactory; -import com.graphhopper.jsprit.core.problem.VehicleRoutingProblem; -import com.graphhopper.jsprit.core.problem.solution.VehicleRoutingProblemSolution; -import com.graphhopper.jsprit.core.util.Solutions; - -import org.junit.Assert; +import java.util.Collection; //TODO: length of routes (legs) AND end time of route are missing. diff --git a/contribs/freight/src/test/java/org/matsim/contrib/freight/utils/FreightUtilsTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/utils/FreightUtilsTest.java similarity index 93% rename from contribs/freight/src/test/java/org/matsim/contrib/freight/utils/FreightUtilsTest.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/utils/FreightUtilsTest.java index fd09806762e..2f697f4a754 100644 --- a/contribs/freight/src/test/java/org/matsim/contrib/freight/utils/FreightUtilsTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/utils/FreightUtilsTest.java @@ -1,29 +1,34 @@ -/* *********************************************************************** * - * project: org.matsim.* - * *********************************************************************** * - * * - * copyright : (C) 2018 by the members listed in the COPYING, * - * LICENSE and WARRANTY file. * - * email : info at matsim dot org * - * * - * *********************************************************************** * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * See also COPYING, LICENSE and WARRANTY file * - * * - * *********************************************************************** */ - -package org.matsim.contrib.freight.utils; - -import java.net.URL; -import java.util.Collection; -import java.util.concurrent.ExecutionException; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.utils; +import com.graphhopper.jsprit.core.algorithm.VehicleRoutingAlgorithm; +import com.graphhopper.jsprit.core.algorithm.box.SchrimpfFactory; +import com.graphhopper.jsprit.core.problem.VehicleRoutingProblem; +import com.graphhopper.jsprit.core.problem.solution.VehicleRoutingProblemSolution; +import com.graphhopper.jsprit.core.util.Solutions; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.junit.Assert; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -31,14 +36,6 @@ import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.network.Network; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize; -import org.matsim.contrib.freight.controler.FreightUtils; -import org.matsim.contrib.freight.jsprit.MatsimJspritFactory; -import org.matsim.contrib.freight.jsprit.NetworkBasedTransportCosts; -import org.matsim.contrib.freight.jsprit.NetworkBasedTransportCosts.Builder; -import org.matsim.contrib.freight.jsprit.NetworkRouter; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.PlansConfigGroup; @@ -48,15 +45,20 @@ import org.matsim.core.scenario.ScenarioUtils; import org.matsim.core.utils.io.IOUtils; import org.matsim.examples.ExamplesUtils; +import org.matsim.freight.carriers.FreightConfigGroup; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.carrier.CarrierCapabilities.FleetSize; +import org.matsim.freight.carriers.controler.FreightUtils; +import org.matsim.freight.carriers.jsprit.MatsimJspritFactory; +import org.matsim.freight.carriers.jsprit.NetworkBasedTransportCosts; +import org.matsim.freight.carriers.jsprit.NetworkBasedTransportCosts.Builder; +import org.matsim.freight.carriers.jsprit.NetworkRouter; import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.*; -import com.graphhopper.jsprit.core.algorithm.VehicleRoutingAlgorithm; -import com.graphhopper.jsprit.core.algorithm.box.SchrimpfFactory; -import com.graphhopper.jsprit.core.problem.VehicleRoutingProblem; -import com.graphhopper.jsprit.core.problem.solution.VehicleRoutingProblemSolution; -import com.graphhopper.jsprit.core.util.Solutions; -import org.junit.Assert; +import java.net.URL; +import java.util.Collection; +import java.util.concurrent.ExecutionException; public class FreightUtilsTest { diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/algorithms/SetupSimpleFreightScenarioTest/testSetupScenario/grid10.xml b/contribs/freight/test/input/org/matsim/freight/carriers/algorithms/SetupSimpleFreightScenarioTest/testSetupScenario/grid10.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/algorithms/SetupSimpleFreightScenarioTest/testSetupScenario/grid10.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/algorithms/SetupSimpleFreightScenarioTest/testSetupScenario/grid10.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierModuleTest/carrierPlansEquils.xml b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierModuleTest/carrierPlansEquils.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierModuleTest/carrierPlansEquils.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierModuleTest/carrierPlansEquils.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierModuleTest/network.xml b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierModuleTest/network.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierModuleTest/network.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierModuleTest/network.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierModuleTest/plans100.xml b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierModuleTest/plans100.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierModuleTest/plans100.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierModuleTest/plans100.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierModuleTest/vehicleTypes.xml b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierModuleTest/vehicleTypes.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierModuleTest/vehicleTypes.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierModuleTest/vehicleTypes.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierPlanReaderV1Test/carrierPlansEquils.xml b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierPlanReaderV1Test/carrierPlansEquils.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierPlanReaderV1Test/carrierPlansEquils.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierPlanReaderV1Test/carrierPlansEquils.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierPlanReaderV1Test/carrierPlansEquils_unscored_unselected.xml b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierPlanReaderV1Test/carrierPlansEquils_unscored_unselected.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierPlanReaderV1Test/carrierPlansEquils_unscored_unselected.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierPlanReaderV1Test/carrierPlansEquils_unscored_unselected.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierPlanXmlReaderV2Test/carrierPlansEquils.xml b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierPlanXmlReaderV2Test/carrierPlansEquils.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierPlanXmlReaderV2Test/carrierPlansEquils.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierPlanXmlReaderV2Test/carrierPlansEquils.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierPlanXmlReaderV2Test/carrierPlansEquilsFiniteFleet.xml b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierPlanXmlReaderV2Test/carrierPlansEquilsFiniteFleet.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierPlanXmlReaderV2Test/carrierPlansEquilsFiniteFleet.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierPlanXmlReaderV2Test/carrierPlansEquilsFiniteFleet.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierPlanXmlReaderV2WithDtdTest/carrierPlansEquilsFiniteFleetWithDtd.xml b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierPlanXmlReaderV2WithDtdTest/carrierPlansEquilsFiniteFleetWithDtd.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierPlanXmlReaderV2WithDtdTest/carrierPlansEquilsFiniteFleetWithDtd.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierPlanXmlReaderV2WithDtdTest/carrierPlansEquilsFiniteFleetWithDtd.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierPlanXmlReaderV2WithDtdTest/carrierPlansEquilsWithDtd.xml b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierPlanXmlReaderV2WithDtdTest/carrierPlansEquilsWithDtd.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierPlanXmlReaderV2WithDtdTest/carrierPlansEquilsWithDtd.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierPlanXmlReaderV2WithDtdTest/carrierPlansEquilsWithDtd.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierPlanXmlWriterV1Test/carrierPlansEquils.xml b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierPlanXmlWriterV1Test/carrierPlansEquils.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierPlanXmlWriterV1Test/carrierPlansEquils.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierPlanXmlWriterV1Test/carrierPlansEquils.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierPlanXmlWriterV2Test/carrierPlansEquils.xml b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierPlanXmlWriterV2Test/carrierPlansEquils.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierPlanXmlWriterV2Test/carrierPlansEquils.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierPlanXmlWriterV2Test/carrierPlansEquils.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierPlanXmlWriterV2Test/carrierPlansEquilsWritten.xml b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierPlanXmlWriterV2Test/carrierPlansEquilsWritten.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierPlanXmlWriterV2Test/carrierPlansEquilsWritten.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierPlanXmlWriterV2Test/carrierPlansEquilsWritten.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierPlanXmlWriterV2_1Test/carrierPlansEquils.xml b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierPlanXmlWriterV2_1Test/carrierPlansEquils.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierPlanXmlWriterV2_1Test/carrierPlansEquils.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierPlanXmlWriterV2_1Test/carrierPlansEquils.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierReadWriteV2_1Test/carriers.xml b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierReadWriteV2_1Test/carriers.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierReadWriteV2_1Test/carriers.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierReadWriteV2_1Test/carriers.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierReadWriteV2_1Test/vehicles.xml b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierReadWriteV2_1Test/vehicles.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierReadWriteV2_1Test/vehicles.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierReadWriteV2_1Test/vehicles.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierVehicleTypeLoaderTest/carrierPlansEquils.xml b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierVehicleTypeLoaderTest/carrierPlansEquils.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierVehicleTypeLoaderTest/carrierPlansEquils.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierVehicleTypeLoaderTest/carrierPlansEquils.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierVehicleTypeLoaderTest/vehicleTypes.xml b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierVehicleTypeLoaderTest/vehicleTypes.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierVehicleTypeLoaderTest/vehicleTypes.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierVehicleTypeLoaderTest/vehicleTypes.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierVehicleTypeReaderTest/vehicleTypes.xml b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierVehicleTypeReaderTest/vehicleTypes.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierVehicleTypeReaderTest/vehicleTypes.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierVehicleTypeReaderTest/vehicleTypes.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierVehicleTypeReaderTest/vehicleTypes_v2.xml b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierVehicleTypeReaderTest/vehicleTypes_v2.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierVehicleTypeReaderTest/vehicleTypes_v2.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierVehicleTypeReaderTest/vehicleTypes_v2.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierVehicleTypeReaderWithDtdV1Test/carrierVehicleTypes_v1.xsd b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierVehicleTypeReaderWithDtdV1Test/carrierVehicleTypes_v1.xsd similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierVehicleTypeReaderWithDtdV1Test/carrierVehicleTypes_v1.xsd rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierVehicleTypeReaderWithDtdV1Test/carrierVehicleTypes_v1.xsd diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierVehicleTypeReaderWithDtdV1Test/carrierVehicleTypes_v2.xsd b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierVehicleTypeReaderWithDtdV1Test/carrierVehicleTypes_v2.xsd similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierVehicleTypeReaderWithDtdV1Test/carrierVehicleTypes_v2.xsd rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierVehicleTypeReaderWithDtdV1Test/carrierVehicleTypes_v2.xsd diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierVehicleTypeWriterTest/vehicleTypes.xml b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierVehicleTypeWriterTest/vehicleTypes.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/CarrierVehicleTypeWriterTest/vehicleTypes.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/CarrierVehicleTypeWriterTest/vehicleTypes.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/carrier/vehicleTypes_v2.xml b/contribs/freight/test/input/org/matsim/freight/carriers/carrier/vehicleTypes_v2.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/carrier/vehicleTypes_v2.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/carrier/vehicleTypes_v2.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/controler/EquilWithCarrierWithPersonsIT/carrierPlansEquils.xml b/contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithPersonsIT/carrierPlansEquils.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/controler/EquilWithCarrierWithPersonsIT/carrierPlansEquils.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithPersonsIT/carrierPlansEquils.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/controler/EquilWithCarrierWithPersonsIT/network.xml b/contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithPersonsIT/network.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/controler/EquilWithCarrierWithPersonsIT/network.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithPersonsIT/network.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/controler/EquilWithCarrierWithPersonsIT/plans100.xml b/contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithPersonsIT/plans100.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/controler/EquilWithCarrierWithPersonsIT/plans100.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithPersonsIT/plans100.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/controler/EquilWithCarrierWithoutPersonsIT/carrierPlansEquils.xml b/contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithoutPersonsIT/carrierPlansEquils.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/controler/EquilWithCarrierWithoutPersonsIT/carrierPlansEquils.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithoutPersonsIT/carrierPlansEquils.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/controler/EquilWithCarrierWithoutPersonsIT/network.xml b/contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithoutPersonsIT/network.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/controler/EquilWithCarrierWithoutPersonsIT/network.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithoutPersonsIT/network.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/controler/EquilWithCarrierWithoutPersonsIT/output_events.xml.gz b/contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithoutPersonsIT/output_events.xml.gz similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/controler/EquilWithCarrierWithoutPersonsIT/output_events.xml.gz rename to contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithoutPersonsIT/output_events.xml.gz diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/controler/vehicleTypes_v2.xml b/contribs/freight/test/input/org/matsim/freight/carriers/controler/vehicleTypes_v2.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/controler/vehicleTypes_v2.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/controler/vehicleTypes_v2.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/jsprit/IntegrationIT/carrier.xml b/contribs/freight/test/input/org/matsim/freight/carriers/jsprit/IntegrationIT/carrier.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/jsprit/IntegrationIT/carrier.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/jsprit/IntegrationIT/carrier.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/jsprit/IntegrationIT/merged-network-simplified.xml.gz b/contribs/freight/test/input/org/matsim/freight/carriers/jsprit/IntegrationIT/merged-network-simplified.xml.gz similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/jsprit/IntegrationIT/merged-network-simplified.xml.gz rename to contribs/freight/test/input/org/matsim/freight/carriers/jsprit/IntegrationIT/merged-network-simplified.xml.gz diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/jsprit/IntegrationIT/vehicleTypes.xml b/contribs/freight/test/input/org/matsim/freight/carriers/jsprit/IntegrationIT/vehicleTypes.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/jsprit/IntegrationIT/vehicleTypes.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/jsprit/IntegrationIT/vehicleTypes.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/jsprit/MatsimTransformerTest/grid-network.xml b/contribs/freight/test/input/org/matsim/freight/carriers/jsprit/MatsimTransformerTest/grid-network.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/jsprit/MatsimTransformerTest/grid-network.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/jsprit/MatsimTransformerTest/grid-network.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/jsprit/NetworkBasedTransportCostsTest/network.xml b/contribs/freight/test/input/org/matsim/freight/carriers/jsprit/NetworkBasedTransportCostsTest/network.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/jsprit/NetworkBasedTransportCostsTest/network.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/jsprit/NetworkBasedTransportCostsTest/network.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/jsprit/SkillsIT/grid-network.xml b/contribs/freight/test/input/org/matsim/freight/carriers/jsprit/SkillsIT/grid-network.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/jsprit/SkillsIT/grid-network.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/jsprit/SkillsIT/grid-network.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/jsprit/vehicleTypesForDCTest.xml b/contribs/freight/test/input/org/matsim/freight/carriers/jsprit/vehicleTypesForDCTest.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/jsprit/vehicleTypesForDCTest.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/jsprit/vehicleTypesForDCTest.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/mobsim/CarrierAgentTest/carrierPlansEquils.xml b/contribs/freight/test/input/org/matsim/freight/carriers/mobsim/CarrierAgentTest/carrierPlansEquils.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/mobsim/CarrierAgentTest/carrierPlansEquils.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/mobsim/CarrierAgentTest/carrierPlansEquils.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/mobsim/CarrierAgentTest/network.xml b/contribs/freight/test/input/org/matsim/freight/carriers/mobsim/CarrierAgentTest/network.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/mobsim/CarrierAgentTest/network.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/mobsim/CarrierAgentTest/network.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/usecases/chessboard/RunChessboardIT/runChessboard/output_events.xml.gz b/contribs/freight/test/input/org/matsim/freight/carriers/usecases/chessboard/RunChessboardIT/runChessboard/output_events.xml.gz similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/usecases/chessboard/RunChessboardIT/runChessboard/output_events.xml.gz rename to contribs/freight/test/input/org/matsim/freight/carriers/usecases/chessboard/RunChessboardIT/runChessboard/output_events.xml.gz diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/usecases/chessboard/RunChessboardIT/runChessboard/output_plans.xml.gz b/contribs/freight/test/input/org/matsim/freight/carriers/usecases/chessboard/RunChessboardIT/runChessboard/output_plans.xml.gz similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/usecases/chessboard/RunChessboardIT/runChessboard/output_plans.xml.gz rename to contribs/freight/test/input/org/matsim/freight/carriers/usecases/chessboard/RunChessboardIT/runChessboard/output_plans.xml.gz diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/utils/grid-network.xml b/contribs/freight/test/input/org/matsim/freight/carriers/utils/grid-network.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/utils/grid-network.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/utils/grid-network.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/vrp/Matsim2VrpUtilsTest/testCreateTours/carrierPlansEquils.xml b/contribs/freight/test/input/org/matsim/freight/carriers/vrp/Matsim2VrpUtilsTest/testCreateTours/carrierPlansEquils.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/vrp/Matsim2VrpUtilsTest/testCreateTours/carrierPlansEquils.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/vrp/Matsim2VrpUtilsTest/testCreateTours/carrierPlansEquils.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/vrp/Matsim2VrpUtilsTest/testCreateVehicleRoutes/carrierPlansEquils.xml b/contribs/freight/test/input/org/matsim/freight/carriers/vrp/Matsim2VrpUtilsTest/testCreateVehicleRoutes/carrierPlansEquils.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/vrp/Matsim2VrpUtilsTest/testCreateVehicleRoutes/carrierPlansEquils.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/vrp/Matsim2VrpUtilsTest/testCreateVehicleRoutes/carrierPlansEquils.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/vrp/MatsimVrpSolverImplTest/testSelectedPlanIsInitialSolution/carrierPlansEquils.xml b/contribs/freight/test/input/org/matsim/freight/carriers/vrp/MatsimVrpSolverImplTest/testSelectedPlanIsInitialSolution/carrierPlansEquils.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/vrp/MatsimVrpSolverImplTest/testSelectedPlanIsInitialSolution/carrierPlansEquils.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/vrp/MatsimVrpSolverImplTest/testSelectedPlanIsInitialSolution/carrierPlansEquils.xml diff --git a/contribs/freight/test/input/org/matsim/contrib/freight/vrp/MatsimVrpSolverImplTest/testSelectedPlanIsInitialSolution/network.xml b/contribs/freight/test/input/org/matsim/freight/carriers/vrp/MatsimVrpSolverImplTest/testSelectedPlanIsInitialSolution/network.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/contrib/freight/vrp/MatsimVrpSolverImplTest/testSelectedPlanIsInitialSolution/network.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/vrp/MatsimVrpSolverImplTest/testSelectedPlanIsInitialSolution/network.xml diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverAgent.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverAgent.java index cf9fc8839dd..da260ed005d 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverAgent.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverAgent.java @@ -22,9 +22,9 @@ import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.Carriers; -import org.matsim.contrib.freight.controler.FreightUtils; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.Carriers; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.core.scoring.ScoringFunction; import java.util.ArrayList; diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverControlerListener.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverControlerListener.java index dc3d95d4a82..ec7a6b95cb3 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverControlerListener.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverControlerListener.java @@ -25,10 +25,10 @@ import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.population.HasPlansAndId; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.ScheduledTour; -import org.matsim.contrib.freight.carrier.Tour; -import org.matsim.contrib.freight.controler.FreightUtils; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.ScheduledTour; +import org.matsim.freight.carriers.carrier.Tour; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.contrib.freightreceiver.collaboration.CollaborationUtils; import org.matsim.contrib.freightreceiver.replanning.ReceiverStrategyManager; import org.matsim.core.config.ConfigUtils; diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverCostAllocation.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverCostAllocation.java index c7b7ae3e141..4fd8d03c841 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverCostAllocation.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverCostAllocation.java @@ -20,7 +20,7 @@ package org.matsim.contrib.freightreceiver; -import org.matsim.contrib.freight.carrier.Carrier; +import org.matsim.freight.carriers.carrier.Carrier; public interface ReceiverCostAllocation { double getScore(Carrier carrier, Receiver receiver); diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverCostAllocationEqualProportion.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverCostAllocationEqualProportion.java index a2905150735..f59248e8d46 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverCostAllocationEqualProportion.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverCostAllocationEqualProportion.java @@ -23,7 +23,7 @@ import com.google.inject.Inject; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; -import org.matsim.contrib.freight.carrier.Carrier; +import org.matsim.freight.carriers.carrier.Carrier; import java.util.*; diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverCostAllocationFixed.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverCostAllocationFixed.java index 2e12e2cc4f5..b719aeed717 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverCostAllocationFixed.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverCostAllocationFixed.java @@ -20,7 +20,7 @@ package org.matsim.contrib.freightreceiver; import org.apache.logging.log4j.LogManager; -import org.matsim.contrib.freight.carrier.Carrier; +import org.matsim.freight.carriers.carrier.Carrier; /** * A simple implementation where the cost allocated by the {@link Carrier} to diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverModule.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverModule.java index eadce5c1518..3681654b8f4 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverModule.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverModule.java @@ -20,7 +20,7 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; -import org.matsim.contrib.freight.carrier.Carrier; +import org.matsim.freight.carriers.carrier.Carrier; import org.matsim.contrib.freightreceiver.replanning.*; import org.matsim.core.config.ConfigUtils; import org.matsim.core.controler.AbstractModule; diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverOrder.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverOrder.java index 0ce8984c076..e56c34ed9dc 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverOrder.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverOrder.java @@ -22,7 +22,7 @@ import org.apache.logging.log4j.LogManager; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.population.BasicPlan; -import org.matsim.contrib.freight.carrier.Carrier; +import org.matsim.freight.carriers.carrier.Carrier; import java.util.ArrayList; import java.util.Collection; diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverPlan.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverPlan.java index abbb8821a25..ed8f9bc257e 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverPlan.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverPlan.java @@ -23,8 +23,8 @@ import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.population.BasicPlan; import org.matsim.api.core.v01.population.Person; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.TimeWindow; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.TimeWindow; import org.matsim.contrib.freightreceiver.collaboration.CollaborationUtils; import org.matsim.utils.objectattributes.attributable.Attributable; import org.matsim.utils.objectattributes.attributable.Attributes; diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverScoreStats.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverScoreStats.java index d6e806c3f24..4ecd92b3c14 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverScoreStats.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverScoreStats.java @@ -4,7 +4,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Scenario; -import org.matsim.contrib.freight.controler.FreightUtils; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.contrib.freightreceiver.collaboration.CollaborationUtils; import org.matsim.core.config.ConfigUtils; import org.matsim.core.controler.events.IterationEndsEvent; diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverTriggersCarrierReplanningListener.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverTriggersCarrierReplanningListener.java index ada89ad47ed..87c24304e4e 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverTriggersCarrierReplanningListener.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverTriggersCarrierReplanningListener.java @@ -25,11 +25,14 @@ import org.apache.logging.log4j.LogManager; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.controler.FreightUtils; -import org.matsim.contrib.freight.jsprit.MatsimJspritFactory; -import org.matsim.contrib.freight.jsprit.NetworkBasedTransportCosts; -import org.matsim.contrib.freight.jsprit.NetworkRouter; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierPlan; +import org.matsim.freight.carriers.carrier.CarrierPlanWriter; +import org.matsim.freight.carriers.carrier.CarrierShipment; +import org.matsim.freight.carriers.controler.FreightUtils; +import org.matsim.freight.carriers.jsprit.MatsimJspritFactory; +import org.matsim.freight.carriers.jsprit.NetworkBasedTransportCosts; +import org.matsim.freight.carriers.jsprit.NetworkRouter; import org.matsim.contrib.freightreceiver.collaboration.CollaborationUtils; import org.matsim.core.config.ConfigUtils; import org.matsim.core.controler.events.IterationStartsEvent; diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverUtils.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverUtils.java index 47bad03c44c..7ad0b6796e0 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverUtils.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiverUtils.java @@ -5,7 +5,7 @@ import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.network.Link; -import org.matsim.contrib.freight.carrier.Carrier; +import org.matsim.freight.carriers.carrier.Carrier; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiversReaderV2.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiversReaderV2.java index b0c5de62e52..976ec89ffe5 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiversReaderV2.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiversReaderV2.java @@ -22,8 +22,8 @@ import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Link; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.TimeWindow; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.TimeWindow; import org.matsim.contrib.freightreceiver.collaboration.CollaborationUtils; import org.matsim.core.api.internal.MatsimReader; import org.matsim.core.utils.io.MatsimXmlParser; diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiversWriter.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiversWriter.java index e8573765c22..aa1f45de263 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiversWriter.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiversWriter.java @@ -22,7 +22,7 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; -import org.matsim.contrib.freight.carrier.TimeWindow; +import org.matsim.freight.carriers.carrier.TimeWindow; import org.matsim.core.api.internal.MatsimWriter; import org.matsim.core.utils.io.MatsimXmlWriter; import org.matsim.core.utils.io.UncheckedIOException; diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiversWriterHandler.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiversWriterHandler.java index 40e036b6775..bfdc735236d 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiversWriterHandler.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiversWriterHandler.java @@ -20,7 +20,7 @@ package org.matsim.contrib.freightreceiver; -import org.matsim.contrib.freight.carrier.TimeWindow; +import org.matsim.freight.carriers.carrier.TimeWindow; import java.io.BufferedWriter; import java.io.IOException; diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiversWriterHandlerImplV1.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiversWriterHandlerImplV1.java index cdf7ee41b7a..470edc810b4 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiversWriterHandlerImplV1.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiversWriterHandlerImplV1.java @@ -20,7 +20,7 @@ package org.matsim.contrib.freightreceiver; -import org.matsim.contrib.freight.carrier.TimeWindow; +import org.matsim.freight.carriers.carrier.TimeWindow; import org.matsim.core.utils.misc.Time; import org.matsim.utils.objectattributes.attributable.Attributes; import org.matsim.utils.objectattributes.attributable.AttributesXmlWriterDelegate; diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiversWriterHandlerImplV2.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiversWriterHandlerImplV2.java index c2f4e8f55db..5fb7c0addd5 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiversWriterHandlerImplV2.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/ReceiversWriterHandlerImplV2.java @@ -20,7 +20,7 @@ package org.matsim.contrib.freightreceiver; -import org.matsim.contrib.freight.carrier.TimeWindow; +import org.matsim.freight.carriers.carrier.TimeWindow; import org.matsim.core.utils.misc.Time; import org.matsim.utils.objectattributes.attributable.Attributes; import org.matsim.utils.objectattributes.attributable.AttributesXmlWriterDelegate; diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/UsecasesCarrierScoringFunctionFactory.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/UsecasesCarrierScoringFunctionFactory.java index 7ef7064e495..4fca3ed3a9b 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/UsecasesCarrierScoringFunctionFactory.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/UsecasesCarrierScoringFunctionFactory.java @@ -7,9 +7,9 @@ import org.matsim.api.core.v01.network.Network; import org.matsim.api.core.v01.population.Activity; import org.matsim.api.core.v01.population.Leg; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.controler.CarrierScoringFunctionFactory; -import org.matsim.contrib.freight.controler.FreightActivity; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controler.FreightActivity; import org.matsim.core.population.routes.NetworkRoute; import org.matsim.core.scoring.ScoringFunction; import org.matsim.core.scoring.SumScoringFunction; diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/collaboration/Coalition.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/collaboration/Coalition.java index e267baa3b3b..5a7666ed6a0 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/collaboration/Coalition.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/collaboration/Coalition.java @@ -1,6 +1,6 @@ package org.matsim.contrib.freightreceiver.collaboration; -import org.matsim.contrib.freight.carrier.Carrier; +import org.matsim.freight.carriers.carrier.Carrier; import org.matsim.contrib.freightreceiver.Receiver; import org.matsim.utils.objectattributes.attributable.Attributable; diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/collaboration/CollaborationUtils.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/collaboration/CollaborationUtils.java index 1142c4ea589..939993439e6 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/collaboration/CollaborationUtils.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/collaboration/CollaborationUtils.java @@ -4,9 +4,9 @@ import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.Carriers; -import org.matsim.contrib.freight.controler.FreightUtils; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.Carriers; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.contrib.freightreceiver.*; public class CollaborationUtils{ diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/collaboration/CollaborationUtilsNew.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/collaboration/CollaborationUtilsNew.java index 12a273d7f61..e0f3e180802 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/collaboration/CollaborationUtilsNew.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/collaboration/CollaborationUtilsNew.java @@ -1,6 +1,6 @@ package org.matsim.contrib.freightreceiver.collaboration; -import org.matsim.contrib.freight.carrier.Carriers; +import org.matsim.freight.carriers.carrier.Carriers; import org.matsim.contrib.freightreceiver.*; /** diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/collaboration/MutableCoalition.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/collaboration/MutableCoalition.java index 7e797b57341..99e7792e8fe 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/collaboration/MutableCoalition.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/collaboration/MutableCoalition.java @@ -1,7 +1,7 @@ package org.matsim.contrib.freightreceiver.collaboration; -import org.matsim.contrib.freight.carrier.Carrier; +import org.matsim.freight.carriers.carrier.Carrier; import org.matsim.contrib.freightreceiver.Receiver; import org.matsim.utils.objectattributes.attributable.Attributes; import org.matsim.utils.objectattributes.attributable.AttributesImpl; diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/collaboration/TimeWindowMutator.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/collaboration/TimeWindowMutator.java index fa92790ba3f..9ac36f526bf 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/collaboration/TimeWindowMutator.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/collaboration/TimeWindowMutator.java @@ -21,7 +21,7 @@ */ package org.matsim.contrib.freightreceiver.collaboration; -import org.matsim.contrib.freight.carrier.TimeWindow; +import org.matsim.freight.carriers.carrier.TimeWindow; import org.matsim.contrib.freightreceiver.ReceiverPlan; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.replanning.ReplanningContext; diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/replanning/ReceiverStrategyManager.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/replanning/ReceiverStrategyManager.java index db66d80f006..0ef128e441a 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/replanning/ReceiverStrategyManager.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/replanning/ReceiverStrategyManager.java @@ -20,7 +20,7 @@ package org.matsim.contrib.freightreceiver.replanning; -import org.matsim.contrib.freight.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controler.CarrierStrategyManager; import org.matsim.contrib.freightreceiver.Receiver; import org.matsim.contrib.freightreceiver.ReceiverPlan; import org.matsim.core.replanning.GenericStrategyManager; diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/replanning/TimeWindowUpperBoundMutator.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/replanning/TimeWindowUpperBoundMutator.java index 681a00c0524..6b5689046fd 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/replanning/TimeWindowUpperBoundMutator.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/replanning/TimeWindowUpperBoundMutator.java @@ -18,7 +18,7 @@ package org.matsim.contrib.freightreceiver.replanning; -import org.matsim.contrib.freight.carrier.TimeWindow; +import org.matsim.freight.carriers.carrier.TimeWindow; import org.matsim.contrib.freightreceiver.ReceiverPlan; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.replanning.ReplanningContext; diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/run/chessboard/ReceiverChessboardScenario.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/run/chessboard/ReceiverChessboardScenario.java index 11b083243b1..1e2b914d10a 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/run/chessboard/ReceiverChessboardScenario.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/run/chessboard/ReceiverChessboardScenario.java @@ -27,9 +27,9 @@ import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.network.Network; import org.matsim.api.core.v01.network.NetworkWriter; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize; -import org.matsim.contrib.freight.controler.FreightUtils; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.carrier.CarrierCapabilities.FleetSize; +import org.matsim.freight.carriers.controler.FreightUtils; import org.matsim.contrib.freightreceiver.*; import org.matsim.contrib.freightreceiver.collaboration.CollaborationUtils; import org.matsim.core.config.Config; diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/run/chessboard/RunReceiverChessboardWithEqualProportionCost.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/run/chessboard/RunReceiverChessboardWithEqualProportionCost.java index cc1baca9beb..8645015d8b9 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/run/chessboard/RunReceiverChessboardWithEqualProportionCost.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/run/chessboard/RunReceiverChessboardWithEqualProportionCost.java @@ -23,9 +23,9 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Scenario; -import org.matsim.contrib.freight.carrier.Carriers; -import org.matsim.contrib.freight.controler.FreightUtils; -import org.matsim.contrib.freight.usecases.analysis.CarrierScoreStats; +import org.matsim.freight.carriers.carrier.Carriers; +import org.matsim.freight.carriers.controler.FreightUtils; +import org.matsim.freight.carriers.usecases.analysis.CarrierScoreStats; import org.matsim.contrib.freightreceiver.ReceiverModule; import org.matsim.contrib.freightreceiver.ReceiverReplanningType; import org.matsim.contrib.freightreceiver.ReceiverUtils; diff --git a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/run/chessboard/RunReceiverChessboardWithFixedCarrierCost.java b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/run/chessboard/RunReceiverChessboardWithFixedCarrierCost.java index 1b2098b2c29..d799e337355 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/run/chessboard/RunReceiverChessboardWithFixedCarrierCost.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/contrib/freightreceiver/run/chessboard/RunReceiverChessboardWithFixedCarrierCost.java @@ -23,9 +23,9 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Scenario; -import org.matsim.contrib.freight.carrier.Carriers; -import org.matsim.contrib.freight.controler.FreightUtils; -import org.matsim.contrib.freight.usecases.analysis.CarrierScoreStats; +import org.matsim.freight.carriers.carrier.Carriers; +import org.matsim.freight.carriers.controler.FreightUtils; +import org.matsim.freight.carriers.usecases.analysis.CarrierScoreStats; import org.matsim.contrib.freightreceiver.ReceiverModule; import org.matsim.contrib.freightreceiver.ReceiverReplanningType; import org.matsim.contrib.freightreceiver.ReceiverUtils; diff --git a/contribs/freightreceiver/src/test/java/org/matsim/contrib/freightreceiver/ReceiversReaderTest.java b/contribs/freightreceiver/src/test/java/org/matsim/contrib/freightreceiver/ReceiversReaderTest.java index 77e2ab92753..71c15dac476 100644 --- a/contribs/freightreceiver/src/test/java/org/matsim/contrib/freightreceiver/ReceiversReaderTest.java +++ b/contribs/freightreceiver/src/test/java/org/matsim/contrib/freightreceiver/ReceiversReaderTest.java @@ -24,8 +24,8 @@ import org.junit.Rule; import org.junit.Test; import org.matsim.api.core.v01.Id; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.TimeWindow; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.TimeWindow; import org.matsim.contrib.freightreceiver.collaboration.CollaborationUtils; import org.matsim.core.utils.misc.Time; import org.matsim.testcases.MatsimTestUtils; diff --git a/contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/CarrierLoadAnalysis.java b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/CarrierLoadAnalysis.java similarity index 64% rename from contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/CarrierLoadAnalysis.java rename to contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/CarrierLoadAnalysis.java index 7a4d89cdfb3..6b5de62f91a 100644 --- a/contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/CarrierLoadAnalysis.java +++ b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/CarrierLoadAnalysis.java @@ -1,13 +1,34 @@ -package org.matsim.contrib.freight.analysis; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.analysis.analysis; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.events.Event; -import org.matsim.contrib.freight.carrier.Carriers; -import org.matsim.contrib.freight.events.CarrierShipmentDeliveryStartEvent; -import org.matsim.contrib.freight.events.CarrierShipmentPickupStartEvent; +import org.matsim.freight.carriers.carrier.Carriers; +import org.matsim.freight.carriers.events.CarrierShipmentDeliveryStartEvent; +import org.matsim.freight.carriers.events.CarrierShipmentPickupStartEvent; import org.matsim.core.events.handler.BasicEventHandler; import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.VehicleType; @@ -21,7 +42,7 @@ import java.util.LinkedList; import java.util.Map; -import static org.matsim.contrib.freight.events.CarrierEventAttributes.ATTRIBUTE_CAPACITYDEMAND; +import static org.matsim.freight.carriers.events.CarrierEventAttributes.ATTRIBUTE_CAPACITYDEMAND; /** * @author Kai Martins-Turner (kturner) diff --git a/contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/CarrierPlanAnalysis.java b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/CarrierPlanAnalysis.java similarity index 56% rename from contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/CarrierPlanAnalysis.java rename to contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/CarrierPlanAnalysis.java index 8de996a9bf0..7921f693095 100644 --- a/contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/CarrierPlanAnalysis.java +++ b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/CarrierPlanAnalysis.java @@ -1,10 +1,31 @@ -package org.matsim.contrib.freight.analysis; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.analysis.analysis; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.Carriers; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.Carriers; import java.io.BufferedWriter; import java.io.FileWriter; diff --git a/contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/FreightAnalysisEventHandler.java b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/FreightAnalysisEventHandler.java similarity index 95% rename from contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/FreightAnalysisEventHandler.java rename to contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/FreightAnalysisEventHandler.java index 15a0dd00702..a3652d63944 100644 --- a/contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/FreightAnalysisEventHandler.java +++ b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/FreightAnalysisEventHandler.java @@ -3,7 +3,7 @@ * project: org.matsim.* * *********************************************************************** * * * - * copyright : (C) 2021 by the members listed in the COPYING, * + * copyright : (C) by the members listed in the COPYING, * * LICENSE and WARRANTY file. * * email : info at matsim dot org * * * @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.analysis; +package org.matsim.freight.carriers.analysis.analysis; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -28,18 +28,18 @@ import org.matsim.api.core.v01.events.handler.*; import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.network.Network; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierService; -import org.matsim.contrib.freight.carrier.CarrierShipment; -import org.matsim.contrib.freight.carrier.Carriers; -import org.matsim.contrib.freight.events.CarrierServiceEndEvent; -import org.matsim.contrib.freight.events.CarrierServiceStartEvent; -import org.matsim.contrib.freight.events.CarrierShipmentDeliveryEndEvent; -import org.matsim.contrib.freight.events.CarrierShipmentPickupEndEvent; -import org.matsim.contrib.freight.events.eventhandler.FreightServiceEndEventHandler; -import org.matsim.contrib.freight.events.eventhandler.FreightServiceStartEventHandler; -import org.matsim.contrib.freight.events.eventhandler.FreightShipmentDeliveryEventHandler; -import org.matsim.contrib.freight.events.eventhandler.FreightShipmentPickupEventHandler; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierService; +import org.matsim.freight.carriers.carrier.CarrierShipment; +import org.matsim.freight.carriers.carrier.Carriers; +import org.matsim.freight.carriers.events.CarrierServiceEndEvent; +import org.matsim.freight.carriers.events.CarrierServiceStartEvent; +import org.matsim.freight.carriers.events.CarrierShipmentDeliveryEndEvent; +import org.matsim.freight.carriers.events.CarrierShipmentPickupEndEvent; +import org.matsim.freight.carriers.events.eventhandler.FreightServiceEndEventHandler; +import org.matsim.freight.carriers.events.eventhandler.FreightServiceStartEventHandler; +import org.matsim.freight.carriers.events.eventhandler.FreightShipmentDeliveryEventHandler; +import org.matsim.freight.carriers.events.eventhandler.FreightShipmentPickupEventHandler; import org.matsim.core.network.NetworkUtils; import org.matsim.core.utils.io.UncheckedIOException; import org.matsim.vehicles.Vehicle; diff --git a/contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/FreightAnalysisServiceTracking.java b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/FreightAnalysisServiceTracking.java similarity index 96% rename from contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/FreightAnalysisServiceTracking.java rename to contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/FreightAnalysisServiceTracking.java index 1c0edb4d814..a34e4ed83af 100644 --- a/contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/FreightAnalysisServiceTracking.java +++ b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/FreightAnalysisServiceTracking.java @@ -3,7 +3,7 @@ * project: org.matsim.* * *********************************************************************** * * * - * copyright : (C) 2021 by the members listed in the COPYING, * + * copyright : (C) by the members listed in the COPYING, * * LICENSE and WARRANTY file. * * email : info at matsim dot org * * * @@ -19,13 +19,13 @@ * */ -package org.matsim.contrib.freight.analysis; +package org.matsim.freight.carriers.analysis.analysis; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.ActivityStartEvent; import org.matsim.api.core.v01.population.Person; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.events.CarrierServiceEndEvent; -import org.matsim.contrib.freight.events.CarrierServiceStartEvent; +import org.matsim.freight.carriers.carrier.*; +import org.matsim.freight.carriers.events.CarrierServiceEndEvent; +import org.matsim.freight.carriers.events.CarrierServiceStartEvent; import java.util.LinkedHashMap; diff --git a/contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/FreightAnalysisShipmentTracking.java b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/FreightAnalysisShipmentTracking.java similarity index 93% rename from contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/FreightAnalysisShipmentTracking.java rename to contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/FreightAnalysisShipmentTracking.java index beb8d66f846..6153a897169 100644 --- a/contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/FreightAnalysisShipmentTracking.java +++ b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/FreightAnalysisShipmentTracking.java @@ -3,7 +3,7 @@ * project: org.matsim.* * *********************************************************************** * * * - * copyright : (C) 2021 by the members listed in the COPYING, * + * copyright : (C) by the members listed in the COPYING, * * LICENSE and WARRANTY file. * * email : info at matsim dot org * * * @@ -19,15 +19,15 @@ * */ -package org.matsim.contrib.freight.analysis; +package org.matsim.freight.carriers.analysis.analysis; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.ActivityStartEvent; import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.population.Person; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierShipment; -import org.matsim.contrib.freight.events.CarrierShipmentDeliveryEndEvent; -import org.matsim.contrib.freight.events.CarrierShipmentPickupEndEvent; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierShipment; +import org.matsim.freight.carriers.events.CarrierShipmentDeliveryEndEvent; +import org.matsim.freight.carriers.events.CarrierShipmentPickupEndEvent; import java.util.LinkedHashMap; import java.util.LinkedHashSet; diff --git a/contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/FreightAnalysisVehicleTracking.java b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/FreightAnalysisVehicleTracking.java similarity index 97% rename from contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/FreightAnalysisVehicleTracking.java rename to contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/FreightAnalysisVehicleTracking.java index 8130eaa4ffb..69075e0203d 100644 --- a/contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/FreightAnalysisVehicleTracking.java +++ b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/FreightAnalysisVehicleTracking.java @@ -3,7 +3,7 @@ * project: org.matsim.* * *********************************************************************** * * * - * copyright : (C) 2021 by the members listed in the COPYING, * + * copyright : (C) by the members listed in the COPYING, * * LICENSE and WARRANTY file. * * email : info at matsim dot org * * * @@ -19,7 +19,7 @@ * */ -package org.matsim.contrib.freight.analysis; +package org.matsim.freight.carriers.analysis.analysis; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -28,7 +28,7 @@ import org.matsim.api.core.v01.events.LinkLeaveEvent; import org.matsim.api.core.v01.events.PersonLeavesVehicleEvent; import org.matsim.api.core.v01.population.Person; -import org.matsim.contrib.freight.carrier.Carrier; +import org.matsim.freight.carriers.carrier.Carrier; import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.VehicleType; diff --git a/contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/FreightTimeAndDistanceAnalysisEventsHandler.java b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/FreightTimeAndDistanceAnalysisEventsHandler.java similarity index 83% rename from contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/FreightTimeAndDistanceAnalysisEventsHandler.java rename to contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/FreightTimeAndDistanceAnalysisEventsHandler.java index bfd229df7ed..21d160d7a32 100644 --- a/contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/FreightTimeAndDistanceAnalysisEventsHandler.java +++ b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/FreightTimeAndDistanceAnalysisEventsHandler.java @@ -1,4 +1,25 @@ -package org.matsim.contrib.freight.analysis; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.analysis.analysis; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -6,11 +27,11 @@ import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.events.Event; import org.matsim.api.core.v01.events.LinkEnterEvent; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.Tour; -import org.matsim.contrib.freight.controler.FreightUtils; -import org.matsim.contrib.freight.events.CarrierTourEndEvent; -import org.matsim.contrib.freight.events.CarrierTourStartEvent; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.Tour; +import org.matsim.freight.carriers.controler.FreightUtils; +import org.matsim.freight.carriers.events.CarrierTourEndEvent; +import org.matsim.freight.carriers.events.CarrierTourStartEvent; import org.matsim.core.events.handler.BasicEventHandler; import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.VehicleType; diff --git a/contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/Readme.md b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/Readme.md similarity index 100% rename from contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/Readme.md rename to contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/Readme.md diff --git a/contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/RunFreightAnalysis.java b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/RunFreightAnalysis.java similarity index 92% rename from contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/RunFreightAnalysis.java rename to contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/RunFreightAnalysis.java index 709511ad323..1938d02ac85 100644 --- a/contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/RunFreightAnalysis.java +++ b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/RunFreightAnalysis.java @@ -3,7 +3,7 @@ * project: org.matsim.* * *********************************************************************** * * * - * copyright : (C) 2021 by the members listed in the COPYING, * + * copyright : (C) by the members listed in the COPYING, * * LICENSE and WARRANTY file. * * email : info at matsim dot org * * * @@ -19,12 +19,12 @@ * */ -package org.matsim.contrib.freight.analysis; +package org.matsim.freight.carriers.analysis.analysis; import org.matsim.api.core.v01.network.Network; -import org.matsim.contrib.freight.carrier.CarrierPlanXmlReader; -import org.matsim.contrib.freight.carrier.CarrierVehicleTypes; -import org.matsim.contrib.freight.carrier.Carriers; +import org.matsim.freight.carriers.carrier.CarrierPlanXmlReader; +import org.matsim.freight.carriers.carrier.CarrierVehicleTypes; +import org.matsim.freight.carriers.carrier.Carriers; import org.matsim.core.api.experimental.events.EventsManager; import org.matsim.core.events.EventsUtils; import org.matsim.core.events.MatsimEventsReader; diff --git a/contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/RunFreightAnalysisEventBased.java b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/RunFreightAnalysisEventBased.java similarity index 94% rename from contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/RunFreightAnalysisEventBased.java rename to contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/RunFreightAnalysisEventBased.java index f63240e6e7d..c390f466f9a 100644 --- a/contribs/vsp/src/main/java/org/matsim/contrib/freight/analysis/RunFreightAnalysisEventBased.java +++ b/contribs/vsp/src/main/java/org/matsim/freight/carriers/analysis/analysis/RunFreightAnalysisEventBased.java @@ -3,7 +3,7 @@ * project: org.matsim.* * *********************************************************************** * * * - * copyright : (C) 2021 by the members listed in the COPYING, * + * copyright : (C) by the members listed in the COPYING, * * LICENSE and WARRANTY file. * * email : info at matsim dot org * * * @@ -19,14 +19,14 @@ * */ -package org.matsim.contrib.freight.analysis; +package org.matsim.freight.carriers.analysis.analysis; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Scenario; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.controler.FreightUtils; -import org.matsim.contrib.freight.events.CarrierEventsReaders; +import org.matsim.freight.carriers.FreightConfigGroup; +import org.matsim.freight.carriers.controler.FreightUtils; +import org.matsim.freight.carriers.events.CarrierEventsReaders; import org.matsim.core.api.experimental.events.EventsManager; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; diff --git a/contribs/vsp/src/test/java/org/matsim/contrib/freight/analysis/FreightAnalysisEventBasedTest.java b/contribs/vsp/src/test/java/org/matsim/contrib/freight/analysis/FreightAnalysisEventBasedTest.java deleted file mode 100644 index 4974a90d130..00000000000 --- a/contribs/vsp/src/test/java/org/matsim/contrib/freight/analysis/FreightAnalysisEventBasedTest.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.matsim.contrib.freight.analysis; - -import org.junit.Rule; -import org.junit.Test; -import org.matsim.testcases.MatsimTestUtils; - -import java.io.IOException; - -public class FreightAnalysisEventBasedTest { - - @Rule - public MatsimTestUtils testUtils = new MatsimTestUtils(); - - @Test - public void runFreightAnalysisEventBasedTest() throws IOException { - - RunFreightAnalysisEventBased analysisEventBased = new RunFreightAnalysisEventBased(testUtils.getClassInputDirectory(), testUtils.getOutputDirectory(),null); - analysisEventBased.runAnalysis(); - - MatsimTestUtils.assertEqualFilesLineByLine(testUtils.getInputDirectory() + "Carrier_stats.tsv", testUtils.getOutputDirectory() + "Carrier_stats.tsv"); - MatsimTestUtils.assertEqualFilesLineByLine(testUtils.getInputDirectory() + "Load_perVehicle.tsv", testUtils.getOutputDirectory() + "Load_perVehicle.tsv"); - MatsimTestUtils.assertEqualFilesLineByLine(testUtils.getInputDirectory() + "TimeDistance_perVehicle.tsv", testUtils.getOutputDirectory() + "TimeDistance_perVehicle.tsv"); - MatsimTestUtils.assertEqualFilesLineByLine(testUtils.getInputDirectory() + "TimeDistance_perVehicleType.tsv", testUtils.getOutputDirectory() + "TimeDistance_perVehicleType.tsv"); - } -} diff --git a/contribs/vsp/src/test/java/org/matsim/contrib/freight/analysis/MyServiceTrackerEventHandler.java b/contribs/vsp/src/test/java/org/matsim/contrib/freight/analysis/MyServiceTrackerEventHandler.java deleted file mode 100644 index ed20e653f1f..00000000000 --- a/contribs/vsp/src/test/java/org/matsim/contrib/freight/analysis/MyServiceTrackerEventHandler.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.matsim.contrib.freight.analysis; - -import org.matsim.api.core.v01.events.ActivityStartEvent; -import org.matsim.api.core.v01.events.handler.ActivityStartEventHandler; -import org.matsim.api.core.v01.network.Network; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierService; -import org.matsim.contrib.freight.carrier.Carriers; -import org.matsim.contrib.freight.events.CarrierServiceEndEvent; -import org.matsim.contrib.freight.events.CarrierServiceStartEvent; -import org.matsim.contrib.freight.events.eventhandler.FreightServiceEndEventHandler; -import org.matsim.contrib.freight.events.eventhandler.FreightServiceStartEventHandler; -import org.matsim.vehicles.Vehicles; - - class MyServiceTrackerEventHandler implements ActivityStartEventHandler, FreightServiceStartEventHandler, FreightServiceEndEventHandler { - private final Vehicles vehicles; - private final Network network; - private final Carriers carriers; - - private FreightAnalysisServiceTracking serviceTracking = new FreightAnalysisServiceTracking(); - - MyServiceTrackerEventHandler(Vehicles vehicles, Network network, Carriers carriers) { - this.network = network; - this.carriers = carriers; - this.vehicles = vehicles; - this.init(); - } - - private void init() { - for (Carrier carrier : carriers.getCarriers().values()) { - - for (CarrierService service : carrier.getServices().values()) { - serviceTracking.addTracker(service, carrier.getId()); - } - } - serviceTracking.estimateArrivalTimes(carriers); - } - - @Override - public void handleEvent(CarrierServiceEndEvent event) { - serviceTracking.handleEndEvent(event); - } - - @Override - public void handleEvent(CarrierServiceStartEvent event) { - serviceTracking.handleStartEvent(event); - } - - @Override - public void handleEvent(ActivityStartEvent activityStartEvent) { - if (activityStartEvent.getActType().equals("service")) { - serviceTracking.trackServiceActivityStart(activityStartEvent); - } - } - - public FreightAnalysisServiceTracking getServiceTracking() { - return serviceTracking; - } -} diff --git a/contribs/vsp/src/test/java/org/matsim/freight/carriers/analysis/analysis/FreightAnalysisEventBasedTest.java b/contribs/vsp/src/test/java/org/matsim/freight/carriers/analysis/analysis/FreightAnalysisEventBasedTest.java new file mode 100644 index 00000000000..4c7ef6d5678 --- /dev/null +++ b/contribs/vsp/src/test/java/org/matsim/freight/carriers/analysis/analysis/FreightAnalysisEventBasedTest.java @@ -0,0 +1,47 @@ +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.analysis.analysis; + +import org.junit.Rule; +import org.junit.Test; +import org.matsim.freight.carriers.analysis.analysis.RunFreightAnalysisEventBased; +import org.matsim.testcases.MatsimTestUtils; + +import java.io.IOException; + +public class FreightAnalysisEventBasedTest { + + @Rule + public MatsimTestUtils testUtils = new MatsimTestUtils(); + + @Test + public void runFreightAnalysisEventBasedTest() throws IOException { + + RunFreightAnalysisEventBased analysisEventBased = new RunFreightAnalysisEventBased(testUtils.getClassInputDirectory(), testUtils.getOutputDirectory(),null); + analysisEventBased.runAnalysis(); + + MatsimTestUtils.assertEqualFilesLineByLine(testUtils.getInputDirectory() + "Carrier_stats.tsv", testUtils.getOutputDirectory() + "Carrier_stats.tsv"); + MatsimTestUtils.assertEqualFilesLineByLine(testUtils.getInputDirectory() + "Load_perVehicle.tsv", testUtils.getOutputDirectory() + "Load_perVehicle.tsv"); + MatsimTestUtils.assertEqualFilesLineByLine(testUtils.getInputDirectory() + "TimeDistance_perVehicle.tsv", testUtils.getOutputDirectory() + "TimeDistance_perVehicle.tsv"); + MatsimTestUtils.assertEqualFilesLineByLine(testUtils.getInputDirectory() + "TimeDistance_perVehicleType.tsv", testUtils.getOutputDirectory() + "TimeDistance_perVehicleType.tsv"); + } +} diff --git a/contribs/vsp/src/test/java/org/matsim/contrib/freight/analysis/MyFreightVehicleTrackerEventHandler.java b/contribs/vsp/src/test/java/org/matsim/freight/carriers/analysis/analysis/MyFreightVehicleTrackerEventHandler.java similarity index 92% rename from contribs/vsp/src/test/java/org/matsim/contrib/freight/analysis/MyFreightVehicleTrackerEventHandler.java rename to contribs/vsp/src/test/java/org/matsim/freight/carriers/analysis/analysis/MyFreightVehicleTrackerEventHandler.java index 3f28c73967d..8634a6a15f9 100644 --- a/contribs/vsp/src/test/java/org/matsim/contrib/freight/analysis/MyFreightVehicleTrackerEventHandler.java +++ b/contribs/vsp/src/test/java/org/matsim/freight/carriers/analysis/analysis/MyFreightVehicleTrackerEventHandler.java @@ -3,7 +3,7 @@ * project: org.matsim.* * *********************************************************************** * * * - * copyright : (C) 2021 by the members listed in the COPYING, * + * copyright : (C) by the members listed in the COPYING, * * LICENSE and WARRANTY file. * * email : info at matsim dot org * * * @@ -19,12 +19,13 @@ * */ -package org.matsim.contrib.freight.analysis; +package org.matsim.freight.carriers.analysis.analysis; import org.matsim.api.core.v01.events.*; import org.matsim.api.core.v01.events.handler.*; import org.matsim.api.core.v01.network.Network; -import org.matsim.contrib.freight.carrier.Carriers; +import org.matsim.freight.carriers.analysis.analysis.FreightAnalysisVehicleTracking; +import org.matsim.freight.carriers.carrier.Carriers; import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.Vehicles; diff --git a/contribs/vsp/src/test/java/org/matsim/freight/carriers/analysis/analysis/MyServiceTrackerEventHandler.java b/contribs/vsp/src/test/java/org/matsim/freight/carriers/analysis/analysis/MyServiceTrackerEventHandler.java new file mode 100644 index 00000000000..c23d9a18cd9 --- /dev/null +++ b/contribs/vsp/src/test/java/org/matsim/freight/carriers/analysis/analysis/MyServiceTrackerEventHandler.java @@ -0,0 +1,81 @@ +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.analysis.analysis; + +import org.matsim.api.core.v01.events.ActivityStartEvent; +import org.matsim.api.core.v01.events.handler.ActivityStartEventHandler; +import org.matsim.api.core.v01.network.Network; +import org.matsim.freight.carriers.analysis.analysis.FreightAnalysisServiceTracking; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierService; +import org.matsim.freight.carriers.carrier.Carriers; +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.vehicles.Vehicles; + + class MyServiceTrackerEventHandler implements ActivityStartEventHandler, FreightServiceStartEventHandler, FreightServiceEndEventHandler { + private final Vehicles vehicles; + private final Network network; + private final Carriers carriers; + + private FreightAnalysisServiceTracking serviceTracking = new FreightAnalysisServiceTracking(); + + MyServiceTrackerEventHandler(Vehicles vehicles, Network network, Carriers carriers) { + this.network = network; + this.carriers = carriers; + this.vehicles = vehicles; + this.init(); + } + + private void init() { + for (Carrier carrier : carriers.getCarriers().values()) { + + for (CarrierService service : carrier.getServices().values()) { + serviceTracking.addTracker(service, carrier.getId()); + } + } + serviceTracking.estimateArrivalTimes(carriers); + } + + @Override + public void handleEvent(CarrierServiceEndEvent event) { + serviceTracking.handleEndEvent(event); + } + + @Override + public void handleEvent(CarrierServiceStartEvent event) { + serviceTracking.handleStartEvent(event); + } + + @Override + public void handleEvent(ActivityStartEvent activityStartEvent) { + if (activityStartEvent.getActType().equals("service")) { + serviceTracking.trackServiceActivityStart(activityStartEvent); + } + } + + public FreightAnalysisServiceTracking getServiceTracking() { + return serviceTracking; + } +} diff --git a/contribs/vsp/src/test/java/org/matsim/contrib/freight/analysis/MyShipmentTrackerEventHandler.java b/contribs/vsp/src/test/java/org/matsim/freight/carriers/analysis/analysis/MyShipmentTrackerEventHandler.java similarity index 51% rename from contribs/vsp/src/test/java/org/matsim/contrib/freight/analysis/MyShipmentTrackerEventHandler.java rename to contribs/vsp/src/test/java/org/matsim/freight/carriers/analysis/analysis/MyShipmentTrackerEventHandler.java index 6b2409d7e3d..b44036eed60 100644 --- a/contribs/vsp/src/test/java/org/matsim/contrib/freight/analysis/MyShipmentTrackerEventHandler.java +++ b/contribs/vsp/src/test/java/org/matsim/freight/carriers/analysis/analysis/MyShipmentTrackerEventHandler.java @@ -1,15 +1,37 @@ -package org.matsim.contrib.freight.analysis; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.analysis.analysis; import org.matsim.api.core.v01.events.ActivityStartEvent; import org.matsim.api.core.v01.events.handler.ActivityStartEventHandler; import org.matsim.api.core.v01.network.Network; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierShipment; -import org.matsim.contrib.freight.carrier.Carriers; -import org.matsim.contrib.freight.events.CarrierShipmentDeliveryEndEvent; -import org.matsim.contrib.freight.events.CarrierShipmentPickupEndEvent; -import org.matsim.contrib.freight.events.eventhandler.FreightShipmentDeliveryEventHandler; -import org.matsim.contrib.freight.events.eventhandler.FreightShipmentPickupEventHandler; +import org.matsim.freight.carriers.analysis.analysis.FreightAnalysisShipmentTracking; +import org.matsim.freight.carriers.carrier.Carrier; +import org.matsim.freight.carriers.carrier.CarrierShipment; +import org.matsim.freight.carriers.carrier.Carriers; +import org.matsim.freight.carriers.events.CarrierShipmentDeliveryEndEvent; +import org.matsim.freight.carriers.events.CarrierShipmentPickupEndEvent; +import org.matsim.freight.carriers.events.eventhandler.FreightShipmentDeliveryEventHandler; +import org.matsim.freight.carriers.events.eventhandler.FreightShipmentPickupEventHandler; import org.matsim.vehicles.Vehicles; public class MyShipmentTrackerEventHandler implements ActivityStartEventHandler, FreightShipmentPickupEventHandler, FreightShipmentDeliveryEventHandler { diff --git a/contribs/vsp/src/test/java/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT.java b/contribs/vsp/src/test/java/org/matsim/freight/carriers/analysis/analysis/RunFreightAnalysisIT.java similarity index 99% rename from contribs/vsp/src/test/java/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT.java rename to contribs/vsp/src/test/java/org/matsim/freight/carriers/analysis/analysis/RunFreightAnalysisIT.java index 4eb53f186bd..40cf13debd1 100644 --- a/contribs/vsp/src/test/java/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT.java +++ b/contribs/vsp/src/test/java/org/matsim/freight/carriers/analysis/analysis/RunFreightAnalysisIT.java @@ -3,7 +3,7 @@ * project: org.matsim.* * *********************************************************************** * * * - * copyright : (C) 2021 by the members listed in the COPYING, * + * copyright : (C) by the members listed in the COPYING, * * LICENSE and WARRANTY file. * * email : info at matsim dot org * * * @@ -19,17 +19,17 @@ * */ -package org.matsim.contrib.freight.analysis; +package org.matsim.freight.carriers.analysis.analysis; import org.junit.*; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Network; import org.matsim.api.core.v01.population.Person; -import org.matsim.contrib.freight.carrier.*; import org.matsim.core.api.experimental.events.EventsManager; import org.matsim.core.events.EventsUtils; import org.matsim.core.events.MatsimEventsReader; import org.matsim.core.network.NetworkUtils; +import org.matsim.freight.carriers.carrier.*; import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.*; diff --git a/contribs/vsp/src/test/java/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest.java b/contribs/vsp/src/test/java/org/matsim/freight/carriers/analysis/analysis/RunFreightAnalysisWithShipmentTest.java similarity index 73% rename from contribs/vsp/src/test/java/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest.java rename to contribs/vsp/src/test/java/org/matsim/freight/carriers/analysis/analysis/RunFreightAnalysisWithShipmentTest.java index 77cef7e441a..f092d11c6af 100644 --- a/contribs/vsp/src/test/java/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest.java +++ b/contribs/vsp/src/test/java/org/matsim/freight/carriers/analysis/analysis/RunFreightAnalysisWithShipmentTest.java @@ -1,4 +1,25 @@ -package org.matsim.contrib.freight.analysis; +/* + * *********************************************************************** * + * project: org.matsim.* + * *********************************************************************** * + * * + * copyright : (C) by the members listed in the COPYING, * + * LICENSE and WARRANTY file. * + * email : info at matsim dot org * + * * + * *********************************************************************** * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * See also COPYING, LICENSE and WARRANTY file * + * * + * *********************************************************************** + * + */ + +package org.matsim.freight.carriers.analysis.analysis; import org.junit.Assert; import org.junit.Rule; @@ -6,10 +27,10 @@ import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.network.Network; -import org.matsim.contrib.freight.carrier.CarrierPlanXmlReader; -import org.matsim.contrib.freight.carrier.CarrierShipment; -import org.matsim.contrib.freight.carrier.CarrierVehicleTypes; -import org.matsim.contrib.freight.carrier.Carriers; +import org.matsim.freight.carriers.carrier.CarrierPlanXmlReader; +import org.matsim.freight.carriers.carrier.CarrierShipment; +import org.matsim.freight.carriers.carrier.CarrierVehicleTypes; +import org.matsim.freight.carriers.carrier.Carriers; import org.matsim.core.api.experimental.events.EventsManager; import org.matsim.core.events.EventsUtils; import org.matsim.core.events.MatsimEventsReader; @@ -20,7 +41,6 @@ import java.io.File; import java.util.Iterator; import java.util.LinkedHashMap; -import java.util.Set; public class RunFreightAnalysisWithShipmentTest { diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/FreightAnalysisEventBasedTest/output_allVehicles.xml.gz b/contribs/vsp/test/input/org/matsim/freight/analysis/FreightAnalysisEventBasedTest/output_allVehicles.xml.gz similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/FreightAnalysisEventBasedTest/output_allVehicles.xml.gz rename to contribs/vsp/test/input/org/matsim/freight/analysis/FreightAnalysisEventBasedTest/output_allVehicles.xml.gz diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/FreightAnalysisEventBasedTest/output_carriers.xml.gz b/contribs/vsp/test/input/org/matsim/freight/analysis/FreightAnalysisEventBasedTest/output_carriers.xml.gz similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/FreightAnalysisEventBasedTest/output_carriers.xml.gz rename to contribs/vsp/test/input/org/matsim/freight/analysis/FreightAnalysisEventBasedTest/output_carriers.xml.gz diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/FreightAnalysisEventBasedTest/output_events.xml.gz b/contribs/vsp/test/input/org/matsim/freight/analysis/FreightAnalysisEventBasedTest/output_events.xml.gz similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/FreightAnalysisEventBasedTest/output_events.xml.gz rename to contribs/vsp/test/input/org/matsim/freight/analysis/FreightAnalysisEventBasedTest/output_events.xml.gz diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/FreightAnalysisEventBasedTest/output_network.xml.gz b/contribs/vsp/test/input/org/matsim/freight/analysis/FreightAnalysisEventBasedTest/output_network.xml.gz similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/FreightAnalysisEventBasedTest/output_network.xml.gz rename to contribs/vsp/test/input/org/matsim/freight/analysis/FreightAnalysisEventBasedTest/output_network.xml.gz diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/FreightAnalysisEventBasedTest/runFreightAnalysisEventBasedTest/Carrier_stats.tsv b/contribs/vsp/test/input/org/matsim/freight/analysis/FreightAnalysisEventBasedTest/runFreightAnalysisEventBasedTest/Carrier_stats.tsv similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/FreightAnalysisEventBasedTest/runFreightAnalysisEventBasedTest/Carrier_stats.tsv rename to contribs/vsp/test/input/org/matsim/freight/analysis/FreightAnalysisEventBasedTest/runFreightAnalysisEventBasedTest/Carrier_stats.tsv diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/FreightAnalysisEventBasedTest/runFreightAnalysisEventBasedTest/Load_perVehicle.tsv b/contribs/vsp/test/input/org/matsim/freight/analysis/FreightAnalysisEventBasedTest/runFreightAnalysisEventBasedTest/Load_perVehicle.tsv similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/FreightAnalysisEventBasedTest/runFreightAnalysisEventBasedTest/Load_perVehicle.tsv rename to contribs/vsp/test/input/org/matsim/freight/analysis/FreightAnalysisEventBasedTest/runFreightAnalysisEventBasedTest/Load_perVehicle.tsv diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/FreightAnalysisEventBasedTest/runFreightAnalysisEventBasedTest/TimeDistance_perVehicle.tsv b/contribs/vsp/test/input/org/matsim/freight/analysis/FreightAnalysisEventBasedTest/runFreightAnalysisEventBasedTest/TimeDistance_perVehicle.tsv similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/FreightAnalysisEventBasedTest/runFreightAnalysisEventBasedTest/TimeDistance_perVehicle.tsv rename to contribs/vsp/test/input/org/matsim/freight/analysis/FreightAnalysisEventBasedTest/runFreightAnalysisEventBasedTest/TimeDistance_perVehicle.tsv diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/FreightAnalysisEventBasedTest/runFreightAnalysisEventBasedTest/TimeDistance_perVehicleType.tsv b/contribs/vsp/test/input/org/matsim/freight/analysis/FreightAnalysisEventBasedTest/runFreightAnalysisEventBasedTest/TimeDistance_perVehicleType.tsv similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/FreightAnalysisEventBasedTest/runFreightAnalysisEventBasedTest/TimeDistance_perVehicleType.tsv rename to contribs/vsp/test/input/org/matsim/freight/analysis/FreightAnalysisEventBasedTest/runFreightAnalysisEventBasedTest/TimeDistance_perVehicleType.tsv diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/compareResults/carrierStats.tsv b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/compareResults/carrierStats.tsv similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/compareResults/carrierStats.tsv rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/compareResults/carrierStats.tsv diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_##carrier1_tripStats.tsv b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_##carrier1_tripStats.tsv similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_##carrier1_tripStats.tsv rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_##carrier1_tripStats.tsv diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_##carrier1_vehicleStats.tsv b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_##carrier1_vehicleStats.tsv similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_##carrier1_vehicleStats.tsv rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_##carrier1_vehicleStats.tsv diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_carrier1_ServiceStats.tsv b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_carrier1_ServiceStats.tsv similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_carrier1_ServiceStats.tsv rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_carrier1_ServiceStats.tsv diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_carrier1_ShipmentStats.tsv b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_carrier1_ShipmentStats.tsv similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_carrier1_ShipmentStats.tsv rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_carrier1_ShipmentStats.tsv diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_carrier1_VehicleTypeStats.tsv b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_carrier1_VehicleTypeStats.tsv similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_carrier1_VehicleTypeStats.tsv rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/compareResults/carrier_carrier1_VehicleTypeStats.tsv diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/compareResults/freightVehicleStats.tsv b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/compareResults/freightVehicleStats.tsv similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/compareResults/freightVehicleStats.tsv rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/compareResults/freightVehicleStats.tsv diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/compareResults/freightVehicleTripStats.tsv b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/compareResults/freightVehicleTripStats.tsv similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/compareResults/freightVehicleTripStats.tsv rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/compareResults/freightVehicleTripStats.tsv diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/compareResults/serviceStats.tsv b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/compareResults/serviceStats.tsv similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/compareResults/serviceStats.tsv rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/compareResults/serviceStats.tsv diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/compareResults/shipmentStats.tsv b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/compareResults/shipmentStats.tsv similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/compareResults/shipmentStats.tsv rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/compareResults/shipmentStats.tsv diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/output_allVehicles.xml.gz b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/output_allVehicles.xml.gz similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/output_allVehicles.xml.gz rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/output_allVehicles.xml.gz diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/output_carriers.xml.gz b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/output_carriers.xml.gz similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/output_carriers.xml.gz rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/output_carriers.xml.gz diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/output_events.xml.gz b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/output_events.xml.gz similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/output_events.xml.gz rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/output_events.xml.gz diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/output_network.xml.gz b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/output_network.xml.gz similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisIT/output_network.xml.gz rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisIT/output_network.xml.gz diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrierStats.tsv b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrierStats.tsv similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrierStats.tsv rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrierStats.tsv diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrier_##carrier1_tripStats.tsv b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrier_##carrier1_tripStats.tsv similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrier_##carrier1_tripStats.tsv rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrier_##carrier1_tripStats.tsv diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrier_##carrier1_vehicleStats.tsv b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrier_##carrier1_vehicleStats.tsv similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrier_##carrier1_vehicleStats.tsv rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrier_##carrier1_vehicleStats.tsv diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrier_carrier1_ShipmentStats.tsv b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrier_carrier1_ShipmentStats.tsv similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrier_carrier1_ShipmentStats.tsv rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrier_carrier1_ShipmentStats.tsv diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrier_carrier1_VehicleTypeStats.tsv b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrier_carrier1_VehicleTypeStats.tsv similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrier_carrier1_VehicleTypeStats.tsv rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/carrier_carrier1_VehicleTypeStats.tsv diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/freightVehicleStats.tsv b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/freightVehicleStats.tsv similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/freightVehicleStats.tsv rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/freightVehicleStats.tsv diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/freightVehicleTripStats.tsv b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/freightVehicleTripStats.tsv similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/freightVehicleTripStats.tsv rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisWithShipmentTest/compareResults/shipment/freightVehicleTripStats.tsv diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest/shipment/output_allVehicles.xml.gz b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisWithShipmentTest/shipment/output_allVehicles.xml.gz similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest/shipment/output_allVehicles.xml.gz rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisWithShipmentTest/shipment/output_allVehicles.xml.gz diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest/shipment/output_carriers.xml.gz b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisWithShipmentTest/shipment/output_carriers.xml.gz similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest/shipment/output_carriers.xml.gz rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisWithShipmentTest/shipment/output_carriers.xml.gz diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest/shipment/output_events.xml.gz b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisWithShipmentTest/shipment/output_events.xml.gz similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest/shipment/output_events.xml.gz rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisWithShipmentTest/shipment/output_events.xml.gz diff --git a/contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest/shipment/output_network.xml.gz b/contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisWithShipmentTest/shipment/output_network.xml.gz similarity index 100% rename from contribs/vsp/test/input/org/matsim/contrib/freight/analysis/RunFreightAnalysisWithShipmentTest/shipment/output_network.xml.gz rename to contribs/vsp/test/input/org/matsim/freight/analysis/RunFreightAnalysisWithShipmentTest/shipment/output_network.xml.gz