Skip to content
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

Merge Logistics (LSP) into freight contrib #3602

Merged
merged 1,616 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1616 commits
Select commit Hold shift + click to select a range
a6b85a5
Re-enable ExampleTwoLspsGroceryDeliveryMultipleChainsTest
kt86 Jul 8, 2024
023ea5f
code style: use .isEmpty()
kt86 Jul 8, 2024
a8dd7c4
code style: use .remove/get First/Last ()
kt86 Jul 8, 2024
3cf90a7
code style: replace explicit by <>
kt86 Jul 8, 2024
1f4ac5c
code style: replace if by switch
kt86 Jul 8, 2024
b93d52f
code style: use parameterized logging
kt86 Jul 8, 2024
6418e14
code style: more string append
kt86 Jul 8, 2024
8ca7763
code style: javadoc
kt86 Jul 8, 2024
5390d86
Merge pull request #259 from matsim-vsp/kmt_2chelon4diss2
kt86 Jul 8, 2024
434652f
code style: replace Lambda with method reference
kt86 Jul 8, 2024
06cb017
code style change based on IntelliJ's suggestion
kt86 Jul 8, 2024
1fc97d0
code style: shorten switch statement
kt86 Jul 8, 2024
e3a979e
code style: fix typos
kt86 Jul 8, 2024
e8f51b5
code style: delete (out)commented code
kt86 Jul 8, 2024
323c09e
remove deprecated calls: adding the vehicleType is not needed here. T…
kt86 Jul 8, 2024
0937e7b
Merge branch 'main' into kmt_2chelon4diss2
kt86 Jul 8, 2024
6ebd970
add != null to if condition to avoid NullPointerException
kt86 Jul 9, 2024
6e1de90
Instantiation vs static access
kt86 Jul 9, 2024
31fd1f9
minor language / spelling fixes in comments
kt86 Jul 9, 2024
8cc6eb7
final not needed for private method
kt86 Jul 9, 2024
8e1b006
make final
kt86 Jul 9, 2024
9e47129
EscapeDefinitionScopes because these Builders are there to access the…
kt86 Jul 9, 2024
a984209
Merge branch 'kmt_2chelon4diss2' of github.com:matsim-vsp/logistics i…
kt86 Jul 9, 2024
457d96e
Merge pull request #260 from matsim-vsp/kmt_2chelon4diss2
kt86 Jul 9, 2024
6b4d487
Merge branch 'main' into kmt_2echelon4Diss
kt86 Jul 9, 2024
6ff10a7
play around with RandomNumberGenerator
kt86 Jul 9, 2024
528dad5
update output for test to new results due to changed RNG
kt86 Jul 9, 2024
9760742
Merge pull request #255 from matsim-vsp/kmt_2echelon4Diss
kt86 Jul 9, 2024
50c2c4d
move out list of links to be tolled to an own class.
kt86 Jul 9, 2024
ed88f11
move List of vehicleToBeTolled one step up.. needs to get moved even …
kt86 Jul 9, 2024
355890d
Create FreightLogisticsConfigGroup
kt86 Jul 12, 2024
0096d3f
minor fix
kt86 Jul 12, 2024
d1b897f
Merge pull request #261 from matsim-vsp/kmt_2echelon4Diss
kt86 Jul 12, 2024
c0f3af3
Bump project.parent.version from 2025.0-2024w28 to 2025.0-2024w29
dependabot[bot] Jul 15, 2024
6309574
Merge pull request #262 from matsim-vsp/dependabot/maven/project.pare…
kt86 Jul 15, 2024
1ad6c27
remove CarrierService and some more not-needed stuff from ScheduledSh…
kt86 Jul 16, 2024
4eff180
cleanup.. remove unused method
kt86 Jul 16, 2024
50ac0f7
remove CarrierService and some more not-needed stuff from ScheduledSh…
kt86 Jul 16, 2024
3f2821c
rearrange inner classes in ShipmentUtils
kt86 Jul 16, 2024
5d425cd
Merge pull request #264 from matsim-vsp/kmt_2echelon4Diss
kt86 Jul 16, 2024
20d8a10
deprecation and inlining
kt86 Jul 16, 2024
c8a1dae
more cleanup and deprecation of "old" replanning example.
kt86 Jul 16, 2024
fb5dd0d
update package-info.java
kt86 Jul 16, 2024
4d97589
Merge branch 'main' into kmt_2echelon4Diss
kt86 Jul 16, 2024
11c4297
Merge pull request #265 from matsim-vsp/kmt_2echelon4Diss
kt86 Jul 16, 2024
80ac88b
remove one layer of "LSPs"
kt86 Jul 17, 2024
e288f7d
We do not use https yet. -> Revert this part of changes here.
kt86 Jul 18, 2024
813ca9d
go to MATSim version 2025.0-PR3375
kt86 Jul 18, 2024
b49c838
Merge pull request #267 from matsim-vsp/kmt_updateLspDefinition
kt86 Jul 18, 2024
f7539a1
delete empty java file
kt86 Jul 18, 2024
0f96222
rename Requirement to LSPShipmentRequirement, because it is a require…
kt86 Jul 18, 2024
cd988fa
minor renaming
kt86 Jul 18, 2024
70f486b
reorganizing examples
kt86 Jul 18, 2024
8bb7693
for some reason, the copyright infos has been duplicated... fixing this.
kt86 Jul 18, 2024
8796dec
Merge pull request #268 from matsim-vsp/kmt_2echelon4Diss
kt86 Jul 18, 2024
7534a9d
copy over ScoreStats from MATSim-libs
kt86 Jul 18, 2024
f2c8027
install LspScoreStatsModule
kt86 Jul 18, 2024
5bdcbe9
start rebuilding it for the LSP...
kt86 Jul 18, 2024
61aea27
fix path and extract it as constant
kt86 Jul 18, 2024
d11d4b8
Merge branch 'main' into lspScoreStats
kt86 Jul 18, 2024
d7b1da2
Merge pull request #269 from matsim-vsp/lspScoreStats
kt86 Jul 18, 2024
7716aab
cleanup. Writer was not needed
kt86 Jul 19, 2024
69c31f4
minor internal renaming
kt86 Jul 19, 2024
ce6ca2a
reduce visibility of some EventsHandler (again). After some reorganiz…
kt86 Jul 19, 2024
e68004b
Merge branch 'main' into kmt_2echelon4Diss
kt86 Jul 19, 2024
24fda44
Merge pull request #271 from matsim-vsp/kmt_2echelon4Diss
kt86 Jul 19, 2024
47b378e
Bump org.matsim:matsim-all from 2025.0-PR3375 to 2025.0-2024w30
dependabot[bot] Jul 22, 2024
dc9ffb1
Merge pull request #273 from matsim-vsp/dependabot/maven/org.matsim-m…
kt86 Jul 22, 2024
541a0e4
make toll scoring setting settable in the carrier scorer.
kt86 Jul 26, 2024
3cba033
Aktualisieren von README.md
kt86 Jul 28, 2024
a2d4d16
Merge pull request #274 from matsim-vsp/kmt_2echelon4Diss
kt86 Jul 29, 2024
378dd23
Bump project.parent.version from 2025.0-2024w30 to 2025.0-2024w31
dependabot[bot] Jul 29, 2024
3f83f6d
Merge pull request #277 from matsim-vsp/dependabot/maven/project.pare…
kt86 Jul 29, 2024
6203d53
reduce logging level from DEBUG to INFO.
kt86 Jul 29, 2024
97aa6e6
Merge pull request #278 from matsim-vsp/reduceLoggingLevel
kt86 Jul 30, 2024
51baadc
add Javadoc for LSP strategies
kt86 Jul 30, 2024
ef89e70
Merge pull request #279 from matsim-vsp/addJavadoc4LspStrategies
kt86 Jul 30, 2024
472a3f3
update MATSim version
kt86 Jul 30, 2024
a84c4a3
renaming and JavaDoc
kt86 Jul 30, 2024
9ab7f0c
WIP: add method for calculation with toll. Some refactoring on the way
kt86 Jul 31, 2024
c200a31
run settings
kt86 Jul 31, 2024
2ff0151
first try with Roadprincing contrib
kt86 Jul 31, 2024
254892c
minor refactoring
kt86 Jul 31, 2024
609ceb9
javadoc and cleanup
kt86 Jul 31, 2024
56484be
Merge pull request #280 from matsim-vsp/kmt_2echelon4Diss
kt86 Jul 31, 2024
44f71bb
use tolled version for planning.
kt86 Aug 1, 2024
7507c06
Merge remote-tracking branch 'origin/main' into kmt_2echelon4Diss
kt86 Aug 1, 2024
4e23da5
Todos nach KN - Meeting
kt86 Aug 7, 2024
5cdcf94
Update pom: Use official RoadpricingScheme in Freight
kt86 Aug 7, 2024
39c406e
fix compile errors after updating MATSim
kt86 Aug 7, 2024
d9b2536
Merge pull request #286 from matsim-vsp/kmt_2echelon4Diss
kt86 Aug 7, 2024
8848007
remove not needed (and already deprecated) calls
kt86 Aug 7, 2024
21c23bd
also sum up jspritScore of auxiliary carriers
kt86 Aug 7, 2024
ddd8c28
WORKAROUND: pass rpScheme through to VRP solving.
kt86 Aug 7, 2024
034b2fe
comments
kt86 Aug 7, 2024
81ee1c5
add two EventsHandler to build connections between driver - vehicle -…
kt86 Aug 7, 2024
7bc3251
use toll scheme
kt86 Aug 7, 2024
d51941d
toll scoring also from events.
kt86 Aug 7, 2024
8148d39
javadoc
kt86 Aug 7, 2024
4bf50a2
reset old scorer and use another class for score tolls via personMone…
kt86 Aug 8, 2024
1a02598
add PersonMoneyEventsAnalysisModule() to write out PersonMoneyEvents ...
kt86 Aug 8, 2024
321ae2d
add PersonMoneyEventsAnalysisModule() to write out PersonMoneyEvents ...
kt86 Aug 8, 2024
775d6fc
more revert of current EventBasedCarrierScorer4MultipleChains
kt86 Aug 8, 2024
af62589
Versuche die Mautsachen aus den PersonMoneyEvents zu scoren... Klappt…
kt86 Aug 8, 2024
d5fb110
Merge branch 'main' into kmt_2echelon4Diss
kt86 Aug 8, 2024
744db00
Merge pull request #287 from matsim-vsp/kmt_2echelon4Diss
kt86 Aug 8, 2024
c8eb3f8
Update MATSim version to current weekly (w33)
kt86 Aug 12, 2024
7c3e4c1
Merge branch 'main' into kmt_2echelon4Diss
kt86 Aug 12, 2024
8405b77
Merge pull request #288 from matsim-vsp/kmt_2echelon4Diss
kt86 Aug 12, 2024
54eb373
use jspritIteratation as set in the carrier. Use 1 otherwise.
kt86 Aug 12, 2024
a7acb63
combine the solveVrpWithJsprit... methods
kt86 Aug 12, 2024
8e03b96
cleanup, comment
kt86 Aug 12, 2024
2c658b5
Merge branch 'main' into kmt_2echelon4Diss
kt86 Aug 12, 2024
624417c
Merge pull request #289 from matsim-vsp/kmt_2echelon4Diss
kt86 Aug 12, 2024
818f69d
rename shipment(s) to lspShipments, to avoid confusions with (Carrier…
kt86 Aug 12, 2024
2ee697c
rename services(s) to CarrierServices for clarification reasons
kt86 Aug 12, 2024
5790244
pass the scenario through to the *CarrierScheduler
kt86 Aug 13, 2024
aead2c1
pass the scenario through to the *CarrierScheduler, ctd.
kt86 Aug 13, 2024
0eae067
remove Deprecation tag, make scenario final
kt86 Aug 13, 2024
4c440cc
extract side effect
kt86 Aug 13, 2024
e5a4bcc
combine methods
kt86 Aug 13, 2024
1c42fb6
remove network from DistributionCarrierResource and its Builder
kt86 Aug 13, 2024
ce44ec7
remove network from CollectionCarrierResource and its Builder
kt86 Aug 13, 2024
2db8f74
remove network from MainRunCarrierResource and its Builder
kt86 Aug 13, 2024
dd61053
remove network from MainRunCarrierResource and its Builder
kt86 Aug 13, 2024
e9669f9
Merge pull request #291 from matsim-vsp/kmt_2echelon4Diss
kt86 Aug 13, 2024
7734b36
Move getter/setter for VRP solving logic to a CarrierAttribute.
kt86 Aug 13, 2024
4a9c897
rename classes and interfaces to indicate that it deals with LspShipm…
kt86 Aug 13, 2024
bb73bfb
revert renaming inside lsps.xml file.
kt86 Aug 13, 2024
0ab5c10
Merge pull request #292 from matsim-vsp/kmt_2echelon4Diss
kt86 Aug 14, 2024
5fc4cec
store time in Attribute of LspShipment.
kt86 Aug 14, 2024
60b5140
move methods to Utils class
kt86 Aug 14, 2024
4ff74c8
WIP get rid of LspShipmentWithTime
kt86 Aug 14, 2024
a0f4e18
renaming
kt86 Aug 14, 2024
caa9e38
IMO, after scheduling, the outgoingElements must contain the shipment.
kt86 Aug 14, 2024
37ffad7
simplify calls
kt86 Aug 14, 2024
a1024e0
simplify assertions
kt86 Aug 14, 2024
cfdd81d
parameterized logging
kt86 Aug 14, 2024
aa704b4
remove deprecated setting of vehType
kt86 Aug 14, 2024
cd4e456
remove unused variables
kt86 Aug 14, 2024
38f18d9
cleanup imports
kt86 Aug 14, 2024
c513752
improve tests
kt86 Aug 14, 2024
463ec1f
add not null check
kt86 Aug 14, 2024
804b99d
java language level improvement
kt86 Aug 14, 2024
e2122a7
fix typos
kt86 Aug 14, 2024
908b496
remove LspShipmentWithTime.java
kt86 Aug 14, 2024
1476110
fix typo
kt86 Aug 14, 2024
9b2e27c
rename tuple to lspShipment, because the tuple "ShipmentWithTime" no …
kt86 Aug 14, 2024
1f901f0
remove unused var from method signature
kt86 Aug 14, 2024
28217d0
some encapsulation. fix and comment test
kt86 Aug 14, 2024
d583037
remove the temporarily added get/setTime(..) methods. They where only…
kt86 Aug 14, 2024
b052bd9
Merge pull request #293 from matsim-vsp/kmt_2echelon4Diss
kt86 Aug 14, 2024
b8b0c07
minor internal simplification
kt86 Aug 14, 2024
2057918
remove LSPCarrierPair and the list storing it. This is not needed in …
kt86 Aug 16, 2024
1293b86
build new object instead of just handing over the object.
kt86 Aug 16, 2024
37d94ef
test for values instead of objects
kt86 Aug 16, 2024
4bae9b0
Merge pull request #294 from matsim-vsp/kmt_2echelon4Diss
kt86 Aug 16, 2024
7235198
Bump org.matsim:matsim-all from 2025.0-2024w33 to 2025.0-2024w34
dependabot[bot] Aug 19, 2024
c105e0a
Merge pull request #296 from matsim-vsp/dependabot/maven/org.matsim-m…
kt86 Aug 19, 2024
bcfb579
comment
kt86 Aug 21, 2024
17eee39
towards using shipments for the delivery carrier.
kt86 Aug 23, 2024
c95d985
not working now.. needs infrastructure for EventHandling..
kt86 Aug 23, 2024
12be97c
Bump org.matsim:matsim-all from 2025.0-2024w34 to 2025.0-2024w35
dependabot[bot] Aug 26, 2024
d11aac6
Merge pull request #298 from matsim-vsp/dependabot/maven/org.matsim-m…
kt86 Aug 26, 2024
bd80bfa
WIP commiting just to change the workspace..
kt86 Aug 30, 2024
62fda43
for debugging
kt86 Sep 2, 2024
f098eb9
pass money and additionalScore events through to carrierScoringFunction
kainagel Sep 2, 2024
44e3f8d
Bump org.matsim:matsim-all from 2025.0-2024w35 to 2025.0-2024w36
dependabot[bot] Sep 2, 2024
322cddb
Merge pull request #299 from matsim-vsp/dependabot/maven/org.matsim-m…
kt86 Sep 2, 2024
6ddf8ea
renaming
kt86 Sep 2, 2024
6569879
pom to shnapshot
kt86 Sep 2, 2024
c60206d
avoid null pointers
kt86 Sep 2, 2024
134c896
cleanup
kt86 Sep 2, 2024
531763d
use MATSim PR version 3443, with the fix on matsim-libs
kt86 Sep 2, 2024
7671c49
Merge branch 'main' into kmt_scoringWithToll
kt86 Sep 3, 2024
e8e2bb5
Merge pull request #301 from matsim-vsp/kmt_scoringWithToll
kt86 Sep 3, 2024
a13d2ec
Merge remote-tracking branch 'origin/main' into kmt_2echelon4Diss
kt86 Sep 3, 2024
b8a7fad
Merge branch 'kmt_2echelon4Diss' of github.com:matsim-vsp/logistics i…
kt86 Sep 5, 2024
943d4fb
Bump project.parent.version from 2025.0-PR3443 to 2025.0-2024w37
dependabot[bot] Sep 9, 2024
b708cc4
Merge pull request #303 from matsim-vsp/dependabot/maven/project.pare…
kt86 Sep 9, 2024
088dff7
Bump org.matsim:matsim-all from 2025.0-2024w37 to 2025.0-2024w38
dependabot[bot] Sep 16, 2024
f42cbf9
Merge pull request #304 from matsim-vsp/dependabot/maven/org.matsim-m…
kt86 Sep 16, 2024
e4b1748
Merge remote-tracking branch 'origin/main' into kmt_2echelon4Diss
kt86 Sep 17, 2024
5c7d593
Merge branch 'kmt_2echelon4Diss' of github.com:matsim-vsp/logistics i…
kt86 Sep 17, 2024
9da043a
Fix was in MATSim-PR3443
kt86 Sep 17, 2024
71a8d42
add CarrierAnalysis
kt86 Sep 18, 2024
5d4dd0c
bind CarrierModule in LspModule
kt86 Sep 18, 2024
be32d3f
Merge pull request #306 from matsim-vsp/kmt_fixScoring
kt86 Sep 18, 2024
5b85b8e
toll value is already negative ... thus add it to the score instead o…
kt86 Sep 18, 2024
cacb76c
score all toll events -> scoring is consistent to the events
kt86 Sep 18, 2024
cb262be
runs setting and cleanup (e.g., avoid overriding of LastMatsimIteration)
kt86 Sep 18, 2024
17d4960
sun setting, and extract method to make main(..) shorter
kt86 Sep 19, 2024
f39b714
align both run classes
kt86 Sep 19, 2024
92c001f
fix scoring: Only toll the current carrier!
kt86 Sep 19, 2024
0ba6b1e
logging
kt86 Sep 19, 2024
1db3e43
comment, that both directions are tolled...
kt86 Sep 20, 2024
e6c62f4
adapt test inputs, to updated scoring (toll each time a toll link is …
kt86 Sep 20, 2024
e182fb0
missed to commit renaming in all classes
kt86 Sep 20, 2024
199b022
Merge branch 'main' into kmt_fixScoring
kt86 Sep 20, 2024
c23af36
Merge pull request #307 from matsim-vsp/kmt_fixScoring
kt86 Sep 20, 2024
a23c866
Bump org.matsim:matsim-all from 2025.0-2024w38 to 2025.0-2024w39
dependabot[bot] Sep 23, 2024
ac6975b
Merge pull request #309 from matsim-vsp/dependabot/maven/org.matsim-m…
kt86 Sep 23, 2024
041eeb5
Merge remote-tracking branch 'origin/main' into kmt_2echelon4Diss
kt86 Sep 23, 2024
51e3896
Bump project.parent.version from 2025.0-2024w39 to 2025.0-2024w40
dependabot[bot] Sep 30, 2024
1f08596
adjust to changes in MATSim-libs
kt86 Sep 30, 2024
2730985
Merge pull request #310 from matsim-vsp/dependabot/maven/project.pare…
kt86 Sep 30, 2024
3488e69
Bump org.matsim:matsim-all from 2025.0-2024w40 to 2025.0-2024w41
dependabot[bot] Oct 7, 2024
ce37c8e
Merge pull request #313 from matsim-vsp/dependabot/maven/org.matsim-m…
kt86 Oct 7, 2024
e042693
Merge remote-tracking branch 'origin/main' into kmt_2echelon4Diss
kt86 Oct 10, 2024
89283a3
some minor adaptions towards Shipment-based solving. some comments
kt86 Oct 10, 2024
c79b3f4
towards using instanceof
kainagel Oct 10, 2024
1ea559b
some more work, check that serviceBased still works
kt86 Oct 11, 2024
a087058
more forward
kt86 Oct 11, 2024
92b13f1
replace if by switch
kt86 Oct 11, 2024
f358399
implement ShipmentBased
kt86 Oct 11, 2024
04f95ee
extract method, comment
kt86 Oct 11, 2024
7082b91
move setting to config setup
kt86 Oct 11, 2024
5019bd7
Bump project.parent.version from 2025.0-2024w41 to 2025.0-2024w42
dependabot[bot] Oct 14, 2024
28fd588
Merge pull request #315 from matsim-vsp/dependabot/maven/project.pare…
kt86 Oct 14, 2024
fe7bf4b
Bump org.matsim:matsim-all from 2025.0-2024w42 to 2025.0-2024w46
dependabot[bot] Nov 11, 2024
90831d3
update based on changes in MATSim-libs
kt86 Nov 11, 2024
3c091b6
add networkMode to vehicleType. Do not use CarrierVehicleType.Builder…
kt86 Nov 12, 2024
e0dda3a
add networkMode to vehicleType.
kt86 Nov 12, 2024
5a86078
add networkMode to vehicleType. Do not use CarrierVehicleType.Builder…
kt86 Nov 12, 2024
c6e9c6c
add networkMode to vehicleType. Do not use CarrierVehicleType.Builder…
kt86 Nov 12, 2024
a31d53c
fix typo
kt86 Nov 12, 2024
2d3e661
update pom to use fix in #3560
kt86 Nov 12, 2024
af4fe05
comment out runCarrieranalysis, because it is broken somewhere
kt86 Nov 12, 2024
38d2f47
Merge pull request #325 from matsim-vsp/dependabot/maven/org.matsim-m…
kt86 Nov 12, 2024
0656a11
reactivate runCarrieranalysis,after fix in matsim-libs#3561
kt86 Nov 13, 2024
0a26470
Merge pull request #327 from matsim-vsp/326-re-enable-the-analysis
kt86 Nov 13, 2024
23bd646
comments after Kai/Kai mtg
kt86 Nov 15, 2024
3f62ec4
Merge remote-tracking branch 'refs/remotes/origin/main' into kmt_2ech…
kt86 Nov 15, 2024
5bcdeaf
remove dependency to vsp contrib, as it is no longer needed
kt86 Nov 15, 2024
198861c
update import for annotation
kt86 Nov 15, 2024
aed7ada
remove NotNull annotation
kt86 Nov 15, 2024
97b6937
remove dependency to vsp contrib, as it is no longer needed
kt86 Nov 15, 2024
140fc9d
comments after Kai/Kai mtg
kt86 Nov 15, 2024
530e21f
Merge pull request #329 from matsim-vsp/kmt_removeDependency
kt86 Nov 15, 2024
e96dac3
Merge pull request #330 from matsim-vsp/kmt_comment
kt86 Nov 15, 2024
0c355d1
fix indentation (and therefore syntax) error
kt86 Nov 22, 2024
c931692
Merge pull request #332 from matsim-vsp/fix-ghActions
kt86 Nov 22, 2024
4a604f7
Merge remote-tracking branch 'origin/main' into kmt_2echelon4Diss
kt86 Nov 25, 2024
92d6db6
Merge pull request #333 from matsim-vsp/kmt_2echelon4Diss
kt86 Nov 25, 2024
4e1e6de
Merge Logistics repository into freight contrib
kt86 Nov 25, 2024
9faf026
re-add missing interface
kt86 Nov 26, 2024
587540c
move test-input
kt86 Nov 26, 2024
0dbca05
update README.md
kt86 Nov 26, 2024
3a22fe5
Merge branch 'matsim-org:master' into kmt_mergeLogisticsProjectIntoMA…
kt86 Nov 27, 2024
9708c11
Merge branch 'master' into kmt_mergeLogisticsProjectIntoMATSim2
kt86 Nov 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions contribs/freight/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@

# Freight

Package that plugs freight algorithms (programmed in external package jsprit) into matsim.
This contrib contains the following packages:

## Carriers
(This is formally knows as 'freight contrib')

Package that plugs vehicle routing problem algorithms (programmed in external package jsprit) into MATSim.

A good starting point for jsprit is [ https://github.com/graphhopper/jsprit](https://github.com/graphhopper/jsprit).

For runnable code see, e.g., the packages org.matsim.contrib.freight.usecases.* above .
For runnable code see, e.g., the packages org.matsim.contrib.freight.carriers.usecases.* above .

## Logistics
(This code comes from [https://github.com/matsim-vsp/logistics/](https://github.com/matsim-vsp/logistics/) )

This code deals with creating logistics chains for freight transport.

Here the decision agent is the logistics service provider (LSP) who decides on the logistics chain to be used for a given freight transport request.
Therefore, it can use carriers (see above) and hubs.

This package bases on work in the dfg-freight project.


229 changes: 229 additions & 0 deletions contribs/freight/scenarios/2regions/2regions-network.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
/*
* *********************************************************************** *
* * 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.freight.logistics;

import java.util.ArrayList;
import org.matsim.api.core.v01.Id;
import org.matsim.freight.logistics.shipment.LspShipment;

/**
* .... Macht 3 Schritte: 1.) the LSPShipments are handed over to the first {@link
* LogisticChainElement} of their {@link LogisticChain} 2.) the neighbors, i.e. the predecessors and
* successors of all {@link LSPResource}s are determined 3.) the Resources are brought into the
* right sequence according to the algorithm.
*
* <p>When traversing this list of {@link LSPResource}s, the operations in each {@link LSPResource}
* are scheduled individually by calling their {@link LSPResourceScheduler}.
*/
/* package-private */ class ForwardLogisticChainSchedulerImpl implements LogisticChainScheduler {

/**
* The Resources are brought into the right sequence according to the algorithm. The result of
* this algorithm is a list of Resources that is later traversed from the front to the back, i.e.
* starting with the entry at index 0. In the algorithm, this list is called sortedResourceList.
*/
private final ArrayList<LSPResource> sortedResourceList;

/**
* The determination of the neighborhood structure among the Resources resulted in the
* neighborList.
*/
private final ArrayList<ResourceNeighbours> neighbourList;

private LSP lsp;
private int bufferTime;

ForwardLogisticChainSchedulerImpl() {
this.sortedResourceList = new ArrayList<>();
this.neighbourList = new ArrayList<>();
}

@Override
public void scheduleLogisticChain() {
insertShipmentsAtBeginning();
setResourceNeighbours();
sortResources();
for (LSPResource resource : sortedResourceList) {
resource.schedule(bufferTime, lsp.getSelectedPlan());
}
}

@Override
public void setEmbeddingContainer(LSP lsp) {
this.lsp = lsp;
}

private void setResourceNeighbours() {
// internal data structure, try to ignore when looking from outside. kai/kai, jan'22
neighbourList.clear();
for (LSPResource resource : lsp.getResources()) {
ResourceNeighbours neighbours = new ResourceNeighbours(resource);
for (LogisticChainElement element : resource.getClientElements()) {
LogisticChainElement predecessor = element.getPreviousElement();
LSPResource previousResource = predecessor.getResource();
neighbours.addPredecessor(previousResource);
LogisticChainElement successor = element.getNextElement();
LSPResource nextResource = successor.getResource();
neighbours.addSuccessor(nextResource);
}
neighbourList.add(neighbours);
}
}

private void sortResources() {
sortedResourceList.clear();
while (!neighbourList.isEmpty()) {
for (ResourceNeighbours neighbours : neighbourList) {
if (allPredecessorsAlreadyScheduled(neighbours)
&& noSuccessorAlreadyScheduled(neighbours)) {
sortedResourceList.add(neighbours.resource);
neighbourList.remove(neighbours);
}
}
}
}

private boolean allPredecessorsAlreadyScheduled(ResourceNeighbours neighbours) {
if (neighbours.predecessors.isEmpty()) {
return true;
}

for (LSPResource predecessor : neighbours.predecessors) {
if (!sortedResourceList.contains(predecessor)) {
return true;
}
}
return false;
}

private boolean noSuccessorAlreadyScheduled(ResourceNeighbours neighbours) {
if (neighbours.successors.isEmpty()) {
return true;
}

for (LSPResource successor : neighbours.successors) {
if (!sortedResourceList.contains(successor)) {
return true;
}
}
return false;
}

private void insertShipmentsAtBeginning() {
for (LogisticChain solution : lsp.getSelectedPlan().getLogisticChains()) {
LogisticChainElement firstElement = getFirstElement(solution);
assert firstElement != null;
for (Id<LspShipment> lspShipmentId : solution.getLspShipmentIds()) {
var shipment = LSPUtils.findLspShipment(lsp, lspShipmentId);
assert shipment != null;
firstElement
.getIncomingShipments()
.addShipment(shipment.getPickupTimeWindow().getStart(), shipment);
}
}
}

private LogisticChainElement getFirstElement(LogisticChain solution) {
for (LogisticChainElement element : solution.getLogisticChainElements()) {
if (element.getPreviousElement() == null) {
return element;
}
}
return null;
}

@Override
public void setBufferTime(int bufferTime) {
this.bufferTime = bufferTime;
}

/**
* The relationship between different {@link LSPResource}s allows to handle various supply
* structures that the {@link LSP} might decide to maintain. Thus, a {@link LSPResource} can have
* several successors or predecessors or can be used by several different {@link LogisticChain}s.
* The neighborhood structure among the {@link LSPResource}s is stored in instances of the class
* {@link ResourceNeighbours} which contain references on the considered {@link LSPResource} and
* on the set of immediate successors respective predecessors. As the result of this step, a
* collection of {@link ResourceNeighbours} called neighborList is created that contains the
* neighbors of all {@link LSPResource}s in the plan of the considered {@link LSP}.
*/
private static class ResourceNeighbours {
// internal data structure, try to ignore when looking from outside. kai/kai, jan'22

private final ArrayList<LSPResource> predecessors;
private final ArrayList<LSPResource> successors;
private final LSPResource resource;

private ResourceNeighbours(LSPResource resource) {
this.resource = resource;
this.predecessors = new ArrayList<>();
this.successors = new ArrayList<>();
}

private void addPredecessor(LSPResource resource) {
this.predecessors.add(resource);
}

private void addSuccessor(LSPResource resource) {
this.successors.add(resource);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
/*
*********************************************************************** *
* project: org.matsim.*
* *
* *********************************************************************** *
* *
* copyright : (C) 2024 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.logistics;

import java.net.URL;
import java.util.Arrays;
import java.util.Map;
import org.matsim.core.config.ConfigGroup;
import org.matsim.core.config.ReflectiveConfigGroup;

public class FreightLogisticsConfigGroup extends ReflectiveConfigGroup {

public static final String GROUPNAME="freightLogistics" ;

private String lspsFile;
static final String LSPS_FILE = "lspsFile";
private static final String LSPS_FILE_DESC = "Freight LogisticsServiceProviders (LSP)s File, according to MATSim logistics extension as part of MATSim's freight contrib.";

public FreightLogisticsConfigGroup() {
super(GROUPNAME);
}

//### CarriersFile ###
/**
* @return -- {@value #LSPS_FILE_DESC}
*/
@StringGetter(LSPS_FILE)
public String getLspsFile() {
return lspsFile;
}

URL getLspsFileUrl(URL context) {
return ConfigGroup.getInputFileURL(context, this.lspsFile);
}

/**
* @param -- {@value #LSPS_FILE_DESC}
*/
@StringSetter(LSPS_FILE)
public void setLspsFile(String lspsFile) {
this.lspsFile = lspsFile;
}



//---
// Commenting this out, because in a frist step I think it is better/ more streight forward to have the VRP logic in the carriers as an attribute.
// please see {@link CarrierSchedulerUtils#setVrpLogic(carrier, VRPLogic)} and {@link CarrierSchedulerUtils#getVrpLogic(carrier)}
//---

// static final String VRP_LOGIC_OF_DISTRIBUTION_CARRIER = "vrpLogicOfDistributionCarrier";
// private LSPUtils.LogicOfVrp vrpLogicOfDistributionCarrier = LSPUtils.LogicOfVrp.serviceBased;
// private static final String VRP_LOGIC_OF_DISTRIBUTION_CARRIER_DESC = "Define, on which type of jobs the VRP of the **distribution** carrier will base on:" + Arrays.toString(LSPUtils.LogicOfVrp.values());
//
// static final String VRP_LOGIC_OF_MAINRUN_CARRIER = "vrpLogicOfMainRunCarrier";
// private LSPUtils.LogicOfVrp vrpLogicOfMainRunCarrier = LSPUtils.LogicOfVrp.serviceBased;
// private static final String VRP_LOGIC_OF_MAINRUN_CARRIER_DESC = "Define, on which type of jobs the VRP of the **MainRun** carrier will base on:" + Arrays.toString(LSPUtils.LogicOfVrp.values());
//
// static final String VRP_LOGIC_OF_COLLECTION_CARRIER = "vrpLogicOfCollectionCarrier";
// private LSPUtils.LogicOfVrp vrpLogicOfCollectionCarrier = LSPUtils.LogicOfVrp.serviceBased;
// private static final String VRP_LOGIC_OF_COLLECTION_CARRIER_DESC = "Define, on which type of jobs the VRP of the **Collection** carrier will base on:" + Arrays.toString(LSPUtils.LogicOfVrp.values());
//
// /**
// *
// * @return The internal type of jobs, on which the VRPs of the distribution carrier bases on.
// */
// @StringGetter(VRP_LOGIC_OF_DISTRIBUTION_CARRIER)
// public LSPUtils.LogicOfVrp getVrpLogicOfDistributionCarrier() {
// return vrpLogicOfDistributionCarrier;
// }
//
// /**
// * @param vrpLogicOfDistributionCarrier {@value #VRP_LOGIC_OF_DISTRIBUTION_CARRIER}
// */
// @StringSetter(VRP_LOGIC_OF_DISTRIBUTION_CARRIER)
// public void setVrpLogicOfDistributionCarrier(LSPUtils.LogicOfVrp vrpLogicOfDistributionCarrier) {
// this.vrpLogicOfDistributionCarrier = vrpLogicOfDistributionCarrier;
// }
//
// /**
// * @return The internal type of jobs, on which the VRPs of the main run carrier bases on.
// */
// @StringGetter(FreightLogisticsConfigGroup.VRP_LOGIC_OF_MAINRUN_CARRIER)
// public LSPUtils.LogicOfVrp getVrpLogicOfMainRunCarrier() {
// return vrpLogicOfMainRunCarrier;
// }
//
// /**
// * @param vrpLogicOfMainRunCarrier {@value #VRP_LOGIC_OF_MAINRUN_CARRIER}
// */
// @StringSetter(FreightLogisticsConfigGroup.VRP_LOGIC_OF_MAINRUN_CARRIER)
// public void setVrpLogicOfMainRunCarrier(LSPUtils.LogicOfVrp vrpLogicOfMainRunCarrier) {
// this.vrpLogicOfMainRunCarrier = vrpLogicOfMainRunCarrier;
// }
//
// /**
// * @return The internal type of jobs, on which the VRPs of the collection carrier bases on.
// */
// @StringGetter(FreightLogisticsConfigGroup.VRP_LOGIC_OF_COLLECTION_CARRIER)
// public LSPUtils.LogicOfVrp getVrpLogicOfCollectionCarrier() {
// return vrpLogicOfCollectionCarrier;
// }
//
// /**
// * @param vrpLogicOfCollectionCarrier {@value #VRP_LOGIC_OF_COLLECTION_CARRIER}
// */
// @StringSetter(FreightLogisticsConfigGroup.VRP_LOGIC_OF_COLLECTION_CARRIER)
// public void setVrpLogicOfCollectionCarrier(LSPUtils.LogicOfVrp vrpLogicOfCollectionCarrier) {
// this.vrpLogicOfCollectionCarrier = vrpLogicOfCollectionCarrier;
// }

//---
//---
@Override
public Map<String, String> getComments() {
Map<String, String> map = super.getComments();
map.put(LSPS_FILE, LSPS_FILE_DESC);
// map.put(VRP_LOGIC_OF_DISTRIBUTION_CARRIER, VRP_LOGIC_OF_DISTRIBUTION_CARRIER_DESC);
// map.put(VRP_LOGIC_OF_MAINRUN_CARRIER, VRP_LOGIC_OF_MAINRUN_CARRIER_DESC);
// map.put(VRP_LOGIC_OF_COLLECTION_CARRIER, VRP_LOGIC_OF_COLLECTION_CARRIER_DESC);
return map;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.matsim.freight.logistics;

@SuppressWarnings("InterfaceMayBeAnnotatedFunctional")
public interface HasBackpointer<T> {
// In general, we set backpointers when we add to the container.

// yy maybe also have interface HasSettableBackpointer?
void setEmbeddingContainer(T pointer);

// T getEmbeddingContainer();

}
Loading
Loading