Skip to content

[WIP] feat(freight): (Logistics) use CarrierShipments for Delivery #3871

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 47 commits into
base: main
Choose a base branch
from

Conversation

kt86
Copy link
Contributor

@kt86 kt86 commented Mar 31, 2025

Problem:

Currently, the delivery is planned based on CarrierServices.
VRPs with Services cannot use a vehicle for more than one subtour, so it runs only once. As a consequence there are - for the last mile - too many vehicles on the road, leading to too much fixed costs.

Solution:

With this PR, it is now possible to plan the delivery based on CarrierShipments, allowing the Vehicle to return to the depot/hub and reload goods for the next (sub-)tour.

Other changes:

  • Some formatting: mostly avoid line breaks
  • Replace some hard-coded strings by use of (existing) constants
  • Add a isWithinBound(...) method for the tests to reduce code-duplication in various tests.

kt86 added 25 commits February 6, 2025 14:11
This should fix the failing tests from commit e18f641
…livery

# Conflicts:
#	contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/MatsimJspritFactory.java
#	contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/FreightScenarioCreator.java
#	contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGrid.java
#	contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGrid_NR.java
#	contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/CarrierSchedulerUtils.java
#	contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/CollectionCarrierScheduler.java
#	contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/DistributionCarrierScheduler.java
#	contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/LSPTourStartEventHandler.java
#	contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/MainRunCarrierScheduler.java
#	contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsSecondReloadLSPSchedulingTest.java
#	contribs/freight/src/test/java/org/matsim/freight/logistics/resourceImplementations/SecondReloadLSPSchedulingTest.java
Note: Nothing changed to set this in the builder, so they may be null...
@kt86 kt86 changed the title kmt/useShipments4Delivery [WIP] feat(freight:logistics): use CarrierShipments for Delivery Mar 31, 2025
@sebhoerl
Copy link
Contributor

Please use feat(freight) (contrib name)

@kt86
Copy link
Contributor Author

kt86 commented Mar 31, 2025

Please use feat(freight) (contrib name)

@sebhoerl : I can change it.
My idea was to specify to which of the two parts of the freight contrib this PR belongs to.

The reason: Carriers is the old freight contrib, used from some groups independently, while logistics is a new package.

@kt86 kt86 changed the title [WIP] feat(freight:logistics): use CarrierShipments for Delivery [WIP] feat(freight): (Logistics) use CarrierShipments for Delivery Mar 31, 2025
@sebhoerl
Copy link
Contributor

ah ok, if there is a good reason, fine for me ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants