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

Update MATSim CW34 #111

Merged
merged 334 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
334 commits
Select commit Hold shift + click to select a range
ca7746a
Merge branch 'master' into parkingChoiceMaintenance
kainagel Jun 27, 2024
06e654f
Merge pull request #3345 from matsim-org/parkingChoiceMaintenance
kainagel Jun 27, 2024
126ffcd
norm subgroups to 1 (#3346)
rakow Jun 27, 2024
f05ec2d
Merge branch 'master' into dependabot/maven/junit.version-5.10.3
jfbischoff Jun 28, 2024
bd9e865
Merge pull request #3343 from matsim-org/dependabot/maven/junit.versi…
jfbischoff Jun 28, 2024
28e33d2
add tests for mode restriction
paulheinr Jun 28, 2024
b49541f
add test integration test case for complex unscheduler
nkuehnel Jun 28, 2024
b4b9429
Merge branch 'master' into addROuterToPrebooking
nkuehnel Jun 28, 2024
e388016
Bump io.grpc:grpc-all from 1.64.0 to 1.65.0
dependabot[bot] Jun 28, 2024
276a46f
add tests that depict the current behaviour
paulheinr Jun 28, 2024
5220b13
Merge pull request #3347 from matsim-org/dependabot/maven/io.grpc-grp…
jfbischoff Jun 28, 2024
3702bb5
Bump com.google.protobuf:protobuf-java from 4.27.1 to 4.27.2
dependabot[bot] Jun 30, 2024
88acd6c
Merge pull request #3338 from matsim-org/dependabot/maven/com.google.…
michalmac Jun 30, 2024
a497cc1
Merge branch 'master' into addROuterToPrebooking
nkuehnel Jun 30, 2024
02d389f
implement multiple mode test
paulheinr Jul 1, 2024
1dd4d60
Merge pull request #3340 from moia-oss/addROuterToPrebooking
nkuehnel Jul 2, 2024
d6c43d9
Split CalculateSkimMatrices.prepareAndCalculateNetworkMatrices() to a…
marecabo Jul 2, 2024
3671fe6
implement option for network inconsistency check; no test adaptation …
paulheinr Jul 2, 2024
8dfc8c3
Bump org.checkerframework:checker-qual from 3.44.0 to 3.45.0
dependabot[bot] Jul 2, 2024
08729b0
implemented network changer
paulheinr Jul 3, 2024
a527e84
implement functionality in Util classes and moved config
paulheinr Jul 3, 2024
bd6a5fc
implement test using the new functionality for mode restriction
paulheinr Jul 3, 2024
40ef8a2
revert changing the default access egress type
paulheinr Jul 3, 2024
8313a4d
Switch to DrtWithExtensionsConfigGroup
steffenaxer Jul 3, 2024
7fc08d6
Merge pull request #3355 from steffenaxer/DrtWithExtensionsConfigGroup
steffenaxer Jul 4, 2024
eba4326
Merge branch 'master' into skim-matrices-with-custom-travel-time-object
steffenaxer Jul 4, 2024
cb853ee
Merge pull request #3351 from matsim-org/skim-matrices-with-custom-tr…
steffenaxer Jul 4, 2024
f79f0bf
Merge branch 'master' into dependabot/maven/org.checkerframework-chec…
jfbischoff Jul 4, 2024
12160b2
Merge pull request #3352 from matsim-org/dependabot/maven/org.checker…
jfbischoff Jul 4, 2024
64c4bd5
Bump org.apache.poi:poi-ooxml from 5.2.5 to 5.3.0
dependabot[bot] Jul 4, 2024
3200fe1
explicitly set access egress type
paulheinr Jul 4, 2024
d647a6b
fix test failures in contribs
paulheinr Jul 4, 2024
f1b39c5
Merge pull request #3353 from matsim-org/dependabot/maven/org.apache.…
jfbischoff Jul 4, 2024
79f0f23
fix test failures in contribs and add config parameter so relevant fu…
paulheinr Jul 4, 2024
56f5868
reworked CreatePseudoNetwork with loop-links to avoid duplicating stops
davibicudo Jul 4, 2024
5d278aa
Merge branch 'master' of github.com:matsim-org/matsim-libs into featu…
davibicudo Jul 4, 2024
f8c417a
Merge pull request #3357 from davibicudo/feature/pseudonet-looplinks
jfbischoff Jul 4, 2024
7b0e554
repair test failures
kainagel Jul 4, 2024
8ddacdf
Trip facet dashboard (#3350)
frievoe97 Jul 4, 2024
041381a
adjust rounding
rewertvsp Jul 8, 2024
c52cbed
exclude case
rewertvsp Jul 8, 2024
a745c95
Merge pull request #3361 from matsim-org/fixLinkSelectionForFreightGe…
rewertvsp Jul 8, 2024
cdc625d
Drt dashboard typo fix (#3360)
frievoe97 Jul 8, 2024
e07615e
Bump com.fasterxml.jackson:jackson-bom from 2.17.1 to 2.17.2
dependabot[bot] Jul 8, 2024
c2d4592
Merge pull request #3362 from matsim-org/dependabot/maven/com.fasterx…
jfbischoff Jul 8, 2024
5c3b825
Merge branch 'master' into mode-restriction
paulheinr Jul 9, 2024
613c039
Bump net.bytebuddy:byte-buddy from 1.14.17 to 1.14.18
dependabot[bot] Jul 9, 2024
a639335
set networkMode based on vehicleTypes
rewertvsp Jul 9, 2024
3c72fcb
pass lambda function as parameter
paulheinr Jul 10, 2024
cd4a870
Bump org.assertj:assertj-core from 3.26.0 to 3.26.3
dependabot[bot] Jul 10, 2024
5359c73
Merge pull request #3363 from matsim-org/dependabot/maven/net.bytebud…
jfbischoff Jul 10, 2024
2c849ea
Merge branch 'master' into dependabot/maven/org.assertj-assertj-core-…
jfbischoff Jul 10, 2024
ae137e3
Merge pull request #3364 from matsim-org/dependabot/maven/org.assertj…
jfbischoff Jul 10, 2024
61b02bc
chore: clean up MinimalTransferTimes (#3365)
sebhoerl Jul 11, 2024
79c9523
chore: cleanup adaptive transfers (#3366)
sebhoerl Jul 11, 2024
d0f310a
Bump org.apache.maven.plugins:maven-failsafe-plugin from 3.3.0 to 3.3.1
dependabot[bot] Jul 11, 2024
678ef0f
Merge pull request #3367 from matsim-org/dependabot/maven/org.apache.…
jfbischoff Jul 11, 2024
bad4be0
add missing case of enum
rewertvsp Jul 12, 2024
9cf945d
add functionality to split jobs
rewertvsp Jul 12, 2024
c157c29
use new methods
rewertvsp Jul 12, 2024
346b6e7
update activity creation
rewertvsp Jul 12, 2024
0137ffc
Merge pull request #3370 from matsim-org/changesForFreightDemandGener…
rewertvsp Jul 12, 2024
5fd7bb2
set activity time correctly
rewertvsp Jul 12, 2024
b98e04a
Merge branch 'refs/heads/master' into adjustModeSelectionForSmallScal…
rewertvsp Jul 12, 2024
d485262
Merge branch 'master' into adjustModeSelectionForSmallScaleCommercial
rewertvsp Jul 12, 2024
683b731
remove unneeded exception
rewertvsp Jul 13, 2024
f8119af
Merge pull request #3371 from matsim-org/adjustModeSelectionForSmallS…
rewertvsp Jul 13, 2024
6f0721e
change to parameterized log message
kt86 Jul 16, 2024
af5098e
delete empty test methods
kt86 Jul 16, 2024
6d14b25
remove unused import
kt86 Jul 16, 2024
edda343
fix unchecked assignment
kt86 Jul 16, 2024
a1c3a77
remove redundant local variables
kt86 Jul 16, 2024
720a2d0
minor code style update
kt86 Jul 16, 2024
7e45620
remove not needed throw information
kt86 Jul 16, 2024
8d310b4
make things final
kt86 Jul 16, 2024
295ef5f
remove redundant final declaration
kt86 Jul 16, 2024
e57b138
remove unnecessary 'throws' declarations
kt86 Jul 16, 2024
72aa7ca
simplify assertions
kt86 Jul 16, 2024
154f91b
cleanup Strings
kt86 Jul 16, 2024
bbb1919
remove redundant casts
kt86 Jul 16, 2024
bc5fda2
code style update
kt86 Jul 16, 2024
2814bc9
cleanup imports
kt86 Jul 16, 2024
00beceb
Java language: Replace explicit type with <>
kt86 Jul 16, 2024
93e6294
Java language: use computeIfAbsent
kt86 Jul 16, 2024
b5d767f
Java language: use Double.hashCode(...)
kt86 Jul 16, 2024
3c964b0
Java language: replace if by switch
kt86 Jul 16, 2024
967e0e8
Java language: avoid raw use
kt86 Jul 16, 2024
87e7f99
Java language: use text block
kt86 Jul 16, 2024
6a1cc65
Java language: use pattern variable
kt86 Jul 16, 2024
128b9aa
Java language: use add/getFirst()
kt86 Jul 16, 2024
ac78f5b
Access to TestUtils.EPSILION
kt86 Jul 16, 2024
f59e4d6
add not null assertion
kt86 Jul 16, 2024
31d2c0d
Merge pull request #3374 from matsim-org/kmt_freightCleanupCode
kt86 Jul 17, 2024
af740e6
remove one layer of "LSPs"
kt86 Jul 17, 2024
0da2db8
Merge pull request #3375 from matsim-org/kmt_updateLspDefinition
kt86 Jul 17, 2024
60368d2
add prebooking support for drt shifts
nkuehnel Jul 19, 2024
4a5ad3f
cancel assigned shifts
nkuehnel Jul 19, 2024
e5bf4d9
Bump com.google.errorprone:error_prone_annotations from 2.28.0 to 2.29.2
dependabot[bot] Jul 19, 2024
7c2f4d2
add some documentation
nkuehnel Jul 19, 2024
106766a
shift drt maintenance
nkuehnel Jul 19, 2024
c7a9904
some more drt shift maintenance
nkuehnel Jul 19, 2024
6dc0421
consider break corridors for (pre)bookings
nkuehnel Jul 19, 2024
6f8d841
consider break corridors for (pre)bookings
nkuehnel Jul 19, 2024
ef5de17
clean up obsolete method
nkuehnel Jul 19, 2024
2d4f1d7
update FISS test, reduce iterations to reduce runtime
nkuehnel Jul 23, 2024
f55bf93
avoid abandoning prebooked requests twice in the same time step
nkuehnel Jul 23, 2024
9e934d4
Merge pull request #3379 from moia-oss/drtShiftsWithPrebooking
nkuehnel Jul 23, 2024
aea22bd
Merge branch 'master' into fix_prebooking_abandonment
nkuehnel Jul 23, 2024
2a40907
Merge pull request #3380 from moia-oss/fix_prebooking_abandonment
nkuehnel Jul 23, 2024
a09c238
Merge branch 'master' into mode-restriction
paulheinr Jul 24, 2024
1b9041f
fix tests by disabling net consistency check
paulheinr Jul 25, 2024
ad6f17e
adapt error messages
paulheinr Jul 25, 2024
f684d07
remove redundant suppression
kt86 Jul 25, 2024
95af125
remove unused field
kt86 Jul 25, 2024
f754070
internal renaming
kt86 Jul 25, 2024
50daf7d
remove unnecessary toString() calls
kt86 Jul 25, 2024
db06b2b
remove unnecessary semicolon
kt86 Jul 25, 2024
53a9a1f
inline and remove method
kt86 Jul 25, 2024
f2eee3f
cleanup imports
kt86 Jul 25, 2024
c104df2
simplification
kt86 Jul 25, 2024
fdadeca
make final, internal renaming
kt86 Jul 25, 2024
26cbfd4
replace 'if' by 'switch'
kt86 Jul 25, 2024
41af9a2
simplification
kt86 Jul 25, 2024
a3c5c2b
use enhanced 'switch'
kt86 Jul 25, 2024
71c8509
simplification
kt86 Jul 25, 2024
174009f
use 'getFirst()'
kt86 Jul 25, 2024
ad74210
javadoc: replace blank lines with '<p>'
kt86 Jul 25, 2024
fcd62ef
javadoc: set link as a link
kt86 Jul 25, 2024
8de79dc
logging: use parameterized logging
kt86 Jul 25, 2024
f9ccc49
add casting
kt86 Jul 25, 2024
268f609
simplification
kt86 Jul 25, 2024
44713d9
use 'append()' calls
kt86 Jul 25, 2024
8fd0955
simplification by removing inaccessibly parts of if statements.
kt86 Jul 25, 2024
1a8510d
remove duplicated setting of variable
kt86 Jul 25, 2024
3fa72e9
Simplify assertions
kt86 Jul 25, 2024
04ad679
Simplify stream
kt86 Jul 25, 2024
ebec885
avoid casting
kt86 Jul 25, 2024
0319bab
suppress warning
kt86 Jul 25, 2024
597faae
fix some (language) grammar
kt86 Jul 25, 2024
d08aec1
fix some typos
kt86 Jul 25, 2024
adcb9f8
more simplifications
kt86 Jul 25, 2024
2d5c06f
cleanup: remove commented out code
kt86 Jul 25, 2024
dac7488
small cleanups
kt86 Jul 25, 2024
ed26933
Merge pull request #3383 from matsim-org/kmt_emissions-maintenance
kt86 Jul 25, 2024
96b14ee
fix test failures by disable net consistency check
paulheinr Jul 25, 2024
65ec814
Merge branch 'master' into mode-restriction
paulheinr Jul 25, 2024
213fae0
optimize h3 zone system initialization; move h3 test to common module
nkuehnel Jul 27, 2024
8091cab
Merge branch 'master' into optimizeH3ZoneSystem
nkuehnel Jul 27, 2024
0730d0b
Merge pull request #3384 from moia-oss/optimizeH3ZoneSystem
nkuehnel Jul 28, 2024
8caaa37
shift drt maintenance; fix bug for prebooked e-drt scenarios that nee…
nkuehnel Jul 29, 2024
3af17e5
make FISS integration test less sensible to smaller changes in link e…
nkuehnel Jul 29, 2024
84ee758
Merge pull request #3385 from moia-oss/drtShiftMaintenance
nkuehnel Jul 29, 2024
4fa6530
set level of some logging's back from WARN to DEBUG
kt86 Jul 29, 2024
e1783db
Merge pull request #3386 from matsim-org/kmt_reduceLoggingLevel
kt86 Jul 29, 2024
33d857b
SimWrapper Dashboard features (#3381)
rakow Jul 30, 2024
d5df451
Merge branch 'master' into bicycleContrib
tschlenther Aug 1, 2024
8f8bb17
Merge branch 'master' into populationAnalysis
tschlenther Aug 1, 2024
84948be
Merge pull request #3344 from matsim-org/bicycleContrib
kainagel Aug 1, 2024
e2b5f17
Merge branch 'master' into mode-restriction
paulheinr Aug 1, 2024
ec12c86
Update GenerateFreightPlans.java (#3387)
luchengqi7 Aug 1, 2024
8dc0f73
add events files comparison
paulheinr Aug 1, 2024
43287db
Merge branch 'master' into mode-restriction
paulheinr Aug 1, 2024
ad2da0c
Merge pull request #3348 from matsim-org/mode-restriction
paulheinr Aug 1, 2024
86d8b5d
Merge branch 'master' into populationAnalysis
tschlenther Aug 2, 2024
92019b7
Merge pull request #2830 from matsim-org/populationAnalysis
tschlenther Aug 2, 2024
7dd60f1
more (javadoc) comments
kainagel Aug 2, 2024
0b68451
Merge branch 'master' into comments
kainagel Aug 2, 2024
893b8fc
Merge pull request #3388 from matsim-org/comments
kainagel Aug 2, 2024
d4a2962
add test which includes tolling.
kt86 Aug 4, 2024
3b7896d
WIP: Prepare test for tolling with factor. Not implemented to the end…
kt86 Aug 4, 2024
4024046
replace self-build RoadPricingCalculator with official RoadPricingScheme
kainagel Aug 4, 2024
ae8aa5a
adapt test: use tollFactor
kt86 Aug 5, 2024
3bc9b18
add option if person==null
kt86 Aug 5, 2024
f051660
more tests
kt86 Aug 6, 2024
99f008a
more steps forward
kainagel Aug 6, 2024
9b3f818
fix one test: Use MATSim's vehicles
kt86 Aug 6, 2024
8a3cd45
fix the last test: Building the netbased costs without MATSim's vehic…
kt86 Aug 6, 2024
883f2d3
some cleanup and javadoc
kt86 Aug 6, 2024
307c602
fix typos, internal renaming
kt86 Aug 6, 2024
f7f5629
Merge pull request #3390 from matsim-org/kmt_roadpricingInFreight
kt86 Aug 6, 2024
e307db4
Merge branch 'master' into dependabot/maven/com.google.errorprone-err…
tschlenther Aug 6, 2024
0212861
Merge pull request #3378 from matsim-org/dependabot/maven/com.google.…
tschlenther Aug 6, 2024
71c63db
Bump org.apache.maven.plugins:maven-surefire-report-plugin
dependabot[bot] Aug 6, 2024
8297af9
Merge pull request #3368 from matsim-org/dependabot/maven/org.apache.…
jfbischoff Aug 6, 2024
79c687f
Bump io.grpc:grpc-all from 1.65.0 to 1.65.1
dependabot[bot] Aug 6, 2024
b0a5f3d
Bump org.apache.maven.plugins:maven-surefire-plugin from 3.3.0 to 3.3.1
dependabot[bot] Aug 6, 2024
ced295a
Merge pull request #3369 from matsim-org/dependabot/maven/org.apache.…
jfbischoff Aug 6, 2024
45c9201
Merge branch 'master' into dependabot/maven/io.grpc-grpc-all-1.65.1
jfbischoff Aug 6, 2024
5c91b59
Merge pull request #3372 from matsim-org/dependabot/maven/io.grpc-grp…
jfbischoff Aug 6, 2024
0ab2647
Bump commons-codec:commons-codec from 1.17.0 to 1.17.1
dependabot[bot] Aug 6, 2024
d6b1a57
Merge pull request #3373 from matsim-org/dependabot/maven/commons-cod…
jfbischoff Aug 6, 2024
43b3bcb
Bump it.unimi.dsi:fastutil-core from 8.5.13 to 8.5.14
dependabot[bot] Aug 6, 2024
799bf54
Bump geotools.version from 31.2 to 31.3
dependabot[bot] Aug 6, 2024
5bf784e
Preserve the working directory when gui is run from cli (#3391)
rakow Aug 6, 2024
4e4afdc
use asterisk for act type default
tschlenther Aug 7, 2024
a382078
Merge pull request #3397 from matsim-org/noiseAnalysis
tschlenther Aug 7, 2024
6a30c28
NoiseAnalysis: set the scale factor for according to sample size
tschlenther Aug 7, 2024
63713ba
Merge branch 'master' into noiseAnalysis
tschlenther Aug 7, 2024
12b08e1
Merge pull request #3398 from matsim-org/noiseAnalysis
tschlenther Aug 7, 2024
ea1f72c
add fare zone based pt pricing (#3382)
simei94 Aug 8, 2024
e981bde
better defaults for NoiseDashboard
tschlenther Aug 8, 2024
cdfe0bc
remove the static
rewertvsp Aug 8, 2024
90c72f3
Merge pull request #3400 from matsim-org/removeStaticParameterForSmal…
rewertvsp Aug 8, 2024
624ca13
NoiseAnalysis: more explicit parameter settings + bug fix in MergeNoi…
tschlenther Aug 8, 2024
a455df3
Update DRT estimate and teleport module (#3333)
luchengqi7 Aug 9, 2024
1730ac8
NoiseAnalysis: merge damages files
tschlenther Aug 9, 2024
6ba2578
NoiseDashboard: include stats and damage plots
tschlenther Aug 9, 2024
cda5767
only perform net consistency check once
paulheinr Aug 9, 2024
4c42086
Merge pull request #3401 from matsim-org/mode-restriction-update
paulheinr Aug 9, 2024
e2f7c36
CreateSingleSimWrapperDashboard
tschlenther Aug 9, 2024
9175ec8
fix noise tests: explicitly set activity types for rp grid, when sett…
tschlenther Aug 9, 2024
2d8aece
Merge branch 'master' into noiseAnalysis
tschlenther Aug 9, 2024
9948285
Merge pull request #3402 from matsim-org/noiseAnalysis
tschlenther Aug 9, 2024
61c65bf
add simple way of rejecting request insertion offers by the customer
nkuehnel Aug 9, 2024
fcc0f3b
Merge branch 'master' into addDrtCustomerRejection
nkuehnel Aug 9, 2024
954d552
update test
nkuehnel Aug 9, 2024
c316aa5
fix nasty insertion scheduler bug
nkuehnel Aug 11, 2024
b705f05
Merge pull request #3405 from moia-oss/fixDrtInsertionBug
nkuehnel Aug 12, 2024
c243cbd
Merge branch 'master' into dependabot/maven/it.unimi.dsi-fastutil-cor…
jfbischoff Aug 13, 2024
33ad29f
Merge pull request #3393 from matsim-org/dependabot/maven/it.unimi.ds…
jfbischoff Aug 13, 2024
1cd0c59
Merge branch 'master' into dependabot/maven/geotools.version-31.3
jfbischoff Aug 13, 2024
8566f96
Merge pull request #3394 from matsim-org/dependabot/maven/geotools.ve…
jfbischoff Aug 13, 2024
940cad8
Bump org.hamcrest:hamcrest from 2.2 to 3.0
dependabot[bot] Aug 13, 2024
1cdfc04
Merge branch 'master' into addDrtCustomerRejection
nkuehnel Aug 13, 2024
c77fe93
Merge pull request #3395 from matsim-org/dependabot/maven/org.hamcres…
jfbischoff Aug 13, 2024
0e1dbf7
Merge branch 'master' into addDrtCustomerRejection
jfbischoff Aug 13, 2024
de00c66
Accept optional OD pairs in route validation (#3409)
luchengqi7 Aug 13, 2024
4dbce8e
add ride scoring parametrization based on car (#3410)
vsp-gleich Aug 15, 2024
4c5cc89
Merge branch 'master' into addDrtCustomerRejection
luchengqi7 Aug 15, 2024
091b754
add chained pt fare handler
paulheinr Aug 16, 2024
6b15b10
implemented tests
paulheinr Aug 16, 2024
417a83b
implemented integration test
paulheinr Aug 16, 2024
3efd6a5
Merge pull request #3411 from matsim-org/pt_fare_handler
paulheinr Aug 16, 2024
4c66b90
Pt distance class fares (#3413)
vsp-gleich Aug 16, 2024
8d209f6
Pt fares minor cleanup (#3414)
vsp-gleich Aug 16, 2024
e52f90a
Merge branch 'master' into addDrtCustomerRejection
nkuehnel Aug 19, 2024
b7f8a9d
Merge pull request #3404 from moia-oss/addDrtCustomerRejection
nkuehnel Aug 19, 2024
3f7824c
add designated vehicle for shifts
nkuehnel Aug 19, 2024
56e1e32
actually use designated vehicle in assignment
nkuehnel Aug 19, 2024
17dfeac
Merge branch 'master' into drtShiftDesignatedVehicle
nkuehnel Aug 19, 2024
2505f67
Merge pull request #3416 from moia-oss/drtShiftDesignatedVehicle
steffenaxer Aug 19, 2024
9dcb7a7
drt shift designated vehicle fix
nkuehnel Aug 19, 2024
2ecf008
Merge pull request #3418 from moia-oss/drtShiftDesignatedVehicle
steffenaxer Aug 20, 2024
0dfee66
update (e)shift task schedulers
nkuehnel Aug 20, 2024
b2f3516
update (e)shift task schedulers
nkuehnel Aug 20, 2024
b9ca9e2
Merge branch 'master' into updateInsertionScheduler
nkuehnel Aug 20, 2024
58cd9fa
Merge pull request #3422 from moia-oss/updateInsertionScheduler
nkuehnel Aug 20, 2024
7b0304b
Merge branch 'master' into shifttaskschedulerupdate
nkuehnel Aug 20, 2024
8b8b85d
Merge pull request #3421 from moia-oss/shifttaskschedulerupdate
steffenaxer Aug 20, 2024
f6df55b
merge
nkuehnel Aug 20, 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
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
import org.matsim.api.core.v01.network.Node;
import org.matsim.application.CommandSpec;
import org.matsim.application.MATSimAppCommand;
import org.matsim.application.options.CrsOptions;
import org.matsim.application.options.InputOptions;
import org.matsim.application.options.OutputOptions;
import org.matsim.application.options.ShpOptions;
import org.matsim.application.options.*;
import org.matsim.application.prepare.network.SampleNetwork;
import org.matsim.core.network.NetworkUtils;
import org.matsim.core.router.costcalculators.OnlyTimeDependentTravelDisutility;
Expand All @@ -32,9 +29,11 @@
import org.matsim.core.trafficmonitoring.FreeSpeedTravelTime;
import org.matsim.core.utils.geometry.CoordUtils;
import org.matsim.core.utils.geometry.transformations.GeotoolsTransformation;
import org.matsim.core.utils.io.IOUtils;
import picocli.CommandLine;

import java.io.IOException;
import java.io.UncheckedIOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.*;
Expand Down Expand Up @@ -86,6 +85,8 @@ public class SampleValidationRoutes implements MATSimAppCommand {
@CommandLine.Option(names = "--mode", description = "Mode to validate", defaultValue = TransportMode.car)
private String mode;

@CommandLine.Option(names = "--input-od", description = "Use input fromNode,toNode instead of sampling", required = false)
private String inputOD;

public static void main(String[] args) {
new SampleValidationRoutes().execute(args);
Expand Down Expand Up @@ -142,9 +143,15 @@ public Integer call() throws Exception {
OnlyTimeDependentTravelDisutility util = new OnlyTimeDependentTravelDisutility(tt);
LeastCostPathCalculator router = new SpeedyALTFactory().createPathCalculator(network, util, tt);

List<Route> routes = sampleRoutes(network, router, rnd);

log.info("Sampled {} routes in range {}", routes.size(), distRange);
List<Route> routes;
if (inputOD != null) {
log.info("Using input OD file {}", inputOD);
routes = queryRoutes(network, router);
} else {
routes = sampleRoutes(network, router, rnd);
log.info("Sampled {} routes in range {}", routes.size(), distRange);
}

try (CSVPrinter csv = new CSVPrinter(Files.newBufferedWriter(output.getPath()), CSVFormat.DEFAULT)) {
csv.printRecord("from_node", "to_node", "beeline_dist", "dist", "travel_time", "geometry");
Expand Down Expand Up @@ -228,6 +235,7 @@ private List<Route> sampleRoutes(Network network, LeastCostPathCalculator router
ShpOptions.Index index = shp.isDefined() ? shp.createIndex(crs, "_") : null;
Predicate<Link> exclude = excludeRoads != null && !excludeRoads.isBlank() ? new Predicate<>() {
final Pattern p = Pattern.compile(excludeRoads, Pattern.CASE_INSENSITIVE);

@Override
public boolean test(Link link) {
return p.matcher(NetworkUtils.getHighwayType(link)).find();
Expand Down Expand Up @@ -282,6 +290,59 @@ public boolean test(Link link) {
return result;
}

/**
* Use given od pairs as input for validation.
*/
private List<Route> queryRoutes(Network network, LeastCostPathCalculator router) {

List<Route> result = new ArrayList<>();
String crs = ProjectionUtils.getCRS(network);

if (this.crs.getInputCRS() != null)
crs = this.crs.getInputCRS();

if (crs == null) {
throw new IllegalArgumentException("Input CRS could not be detected. Please specify with --input-crs [EPSG:xxx]");
}

GeotoolsTransformation ct = new GeotoolsTransformation(crs, "EPSG:4326");

try (CSVParser parser = CSVParser.parse(IOUtils.getBufferedReader(inputOD), CSVFormat.DEFAULT.builder().setHeader().setSkipHeaderRecord(true).
setDelimiter(CsvOptions.detectDelimiter(inputOD)).build())) {

List<String> header = parser.getHeaderNames();
if (!header.contains("from_node"))
throw new IllegalArgumentException("Missing 'from_node' column in input file");
if (!header.contains("to_node"))
throw new IllegalArgumentException("Missing 'to_node' column in input file");

for (CSVRecord r : parser) {
Node fromNode = network.getNodes().get(Id.createNodeId(r.get("from_node")));
Node toNode = network.getNodes().get(Id.createNodeId(r.get("to_node")));

if (fromNode == null)
throw new IllegalArgumentException("Node " + r.get("from_node") + " not found");
if (toNode == null)
throw new IllegalArgumentException("Node " + r.get("to_node") + " not found");

LeastCostPathCalculator.Path path = router.calcLeastCostPath(fromNode, toNode, 0, null, null);
result.add(new Route(
fromNode.getId(),
toNode.getId(),
ct.transform(fromNode.getCoord()),
ct.transform(toNode.getCoord()),
path.travelTime,
path.links.stream().mapToDouble(Link::getLength).sum()
));
}

} catch (IOException e) {
throw new UncheckedIOException(e);
}

return result;
}

/**
* Key as pair of from and to node.
*/
Expand Down
Loading