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 CW30 #106

Merged
merged 176 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
1b641f8
Score explanation functionality
rakow Apr 18, 2023
ec75934
rename a method from add... to set... since that is what is does.
kainagel Feb 8, 2024
5a28bad
Merge branch 'master' into drtMaintenance
kainagel Feb 8, 2024
b24d01b
changes
kainagel Feb 12, 2024
fbcce95
Merge branch 'master' into score-exaplaination
rakow Mar 3, 2024
7d54e16
update config group
rakow Mar 3, 2024
2257d30
update tests and added attributes
rakow Mar 3, 2024
e62ffce
fix un initialized attribute
rakow Mar 3, 2024
febd686
small improvement to object creation
rakow Mar 3, 2024
bc0bb82
Merge branch 'master' into score-exaplaination
rakow Mar 18, 2024
e148010
add leg score for individual legs
rakow Mar 18, 2024
41bf9a4
more consistent naming
rakow Mar 18, 2024
67e1429
Merge branch 'master' into score-explanation
rakow Mar 18, 2024
44cf94b
more consistent naming
rakow Mar 18, 2024
c6f70ed
revert unintentional changes
rakow Mar 18, 2024
ccc5522
Merge branch 'master' into score-explanation
rakow Mar 18, 2024
6a4dda5
CreateDrtDashboard
tschlenther Jun 18, 2024
fa69d25
Merge branch 'master' into drtSimwrapperRunner
tschlenther Jun 18, 2024
31b91d0
Bump org.apache.maven.plugins:maven-failsafe-plugin from 3.2.5 to 3.3.0
dependabot[bot] Jun 19, 2024
548a431
Merge branch 'master' into drtSimwrapperRunner
tschlenther Jun 19, 2024
2e9e58b
rename pooling ratio to occupancy rate
tschlenther Jun 19, 2024
e2aa840
Merge branch 'drtSimwrapperRunner' of https://github.com/matsim-org/m…
tschlenther Jun 19, 2024
10c245f
Merge pull request #3323 from matsim-org/drtSimwrapperRunner
tschlenther Jun 19, 2024
3e16d89
account for group bookings in DrtAnalysisPostProcessing (and thus Drt…
tschlenther Jun 19, 2024
6ee1b3b
Merge pull request #3326 from matsim-org/drtDashboard
tschlenther Jun 19, 2024
0a1f2c2
typo in CreateDrtDashboard
tschlenther Jun 20, 2024
cc78ba4
fix wrong sum calculation
rewertvsp Jun 20, 2024
886ea24
debug NoiseAnalysis and proper testing in NoiseDashboardTests
tschlenther Jun 20, 2024
b9ab343
Merge pull request #3328 from matsim-org/noiseDashboard
tschlenther Jun 20, 2024
0474657
fix wrong map selection
rewertvsp Jun 20, 2024
728fc28
add reduction of numberOfJobs
rewertvsp Jun 20, 2024
10b884b
add comments and format log massages
rewertvsp Jun 21, 2024
22ba33e
combine
rewertvsp Jun 21, 2024
d08b85a
rename parameter
rewertvsp Jun 21, 2024
27b6173
reduce code
rewertvsp Jun 21, 2024
fa70df1
format logging
rewertvsp Jun 21, 2024
1856d07
use method for demand calculating
rewertvsp Jun 21, 2024
9cc13cf
use method for shipment creation
rewertvsp Jun 21, 2024
89d24bf
remove todo
rewertvsp Jun 21, 2024
b6efcbe
use method to calculate demand based on link lengths
rewertvsp Jun 21, 2024
4646328
introduce parameter
rewertvsp Jun 21, 2024
ef954c1
simplify
rewertvsp Jun 21, 2024
a127fee
cleanup
rewertvsp Jun 21, 2024
17bf445
Merge branch 'refs/heads/master' into modifyFreightDemandGenerationTool
rewertvsp Jun 21, 2024
5960389
Merge pull request #3329 from matsim-org/modifyFreightDemandGeneratio…
rewertvsp Jun 21, 2024
2c5374a
Support TransitRouteStops where boarding or alighting is not allowed
mrieser Jun 22, 2024
1ac6e04
Merge pull request #3330 from matsim-org/transit-schedule-enhancements
mrieser Jun 22, 2024
ddd6914
make drt shifts multi mode drt comatible
nkuehnel Jun 23, 2024
b739633
adjust shift efficiency tracker as well
nkuehnel Jun 23, 2024
1663f22
Merge pull request #3331 from moia-oss/multimodeDrtShifts
nkuehnel Jun 23, 2024
4fcb5f3
Extended Trip analysis and dashboard (#3332)
rakow Jun 24, 2024
f1f54c3
Merge branch 'master' into dependabot/maven/org.apache.maven.plugins-…
jfbischoff Jun 24, 2024
4ef1c05
Merge pull request #3320 from matsim-org/dependabot/maven/org.apache.…
jfbischoff Jun 24, 2024
69169b5
Bump org.apache.maven.plugins:maven-surefire-plugin from 3.2.5 to 3.3.0
dependabot[bot] Jun 24, 2024
7966b6b
Merge pull request #3321 from matsim-org/dependabot/maven/org.apache.…
jfbischoff Jun 24, 2024
3097f6d
Bump org.apache.maven.plugins:maven-surefire-report-plugin
dependabot[bot] Jun 24, 2024
59b30d0
Bump org.apache.maven.plugins:maven-jar-plugin from 3.4.1 to 3.4.2
dependabot[bot] Jun 24, 2024
f0c58c3
Merge pull request #3322 from matsim-org/dependabot/maven/org.apache.…
jfbischoff Jun 24, 2024
d6e0399
Merge branch 'master' into dependabot/maven/org.apache.maven.plugins-…
jfbischoff Jun 24, 2024
b971cd6
Merge pull request #3327 from matsim-org/dependabot/maven/org.apache.…
jfbischoff Jun 24, 2024
bae8902
Bump com.fasterxml.woodstox:woodstox-core from 6.6.2 to 7.0.0
dependabot[bot] Jun 24, 2024
b3f4252
Bump org.jfree:jfreechart from 1.5.4 to 1.5.5
dependabot[bot] Jun 24, 2024
8396454
Merge pull request #3335 from matsim-org/dependabot/maven/org.jfree-j…
jfbischoff Jun 25, 2024
187541c
Merge branch 'master' into dependabot/maven/com.fasterxml.woodstox-wo…
jfbischoff Jun 25, 2024
05e5285
Merge branch 'master' into score-explanation
jfbischoff Jun 25, 2024
67ee3bc
Merge pull request #3334 from matsim-org/dependabot/maven/com.fasterx…
jfbischoff Jun 25, 2024
c722dcd
Merge branch 'master' into score-explanation
jfbischoff Jun 25, 2024
12335a8
Merge pull request #3175 from matsim-org/score-explanation
jfbischoff Jun 25, 2024
3194e9d
Merge branch 'master' into drtMaintenance
jfbischoff Jun 25, 2024
abbab85
Merge pull request #3099 from matsim-org/drtMaintenance
kainagel Jun 25, 2024
a9949d5
make drt work with only custom constraints sets
nkuehnel Jun 25, 2024
63208e9
add some logging to NetworkChangeEventsWriter
nkuehnel Jun 25, 2024
38d54d6
Merge branch 'master' into custom-constraints-update
nkuehnel Jun 25, 2024
2d72078
Merge branch 'master' into add-logging-to-network-change-events-writer
nkuehnel Jun 25, 2024
7f245e6
correct logging statement
nkuehnel Jun 25, 2024
47ebec6
Merge pull request #3337 from moia-oss/add-logging-to-network-change-…
nkuehnel Jun 25, 2024
5b1aa87
Merge branch 'master' into custom-constraints-update
nkuehnel Jun 25, 2024
0ec23f8
Merge pull request #3336 from moia-oss/custom-constraints-update
nkuehnel Jun 25, 2024
0282b8a
add router binding for complex request unscheduling
nkuehnel Jun 27, 2024
4c57821
use time as disutility
nkuehnel Jun 27, 2024
2054bba
Bump junit.version from 5.10.2 to 5.10.3
dependabot[bot] Jun 27, 2024
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
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
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
1dd4d60
Merge pull request #3340 from moia-oss/addROuterToPrebooking
nkuehnel Jul 2, 2024
d6c43d9
Split CalculateSkimMatrices.prepareAndCalculateNetworkMatrices() to a…
marecabo Jul 2, 2024
8dfc8c3
Bump org.checkerframework:checker-qual from 3.44.0 to 3.45.0
dependabot[bot] Jul 2, 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
f1b39c5
Merge pull request #3353 from matsim-org/dependabot/maven/org.apache.…
jfbischoff 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
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
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
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
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
5c43a95
Merge branch 'moia-deployment' into fixcw30
nkuehnel Jul 23, 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 @@ -667,18 +667,25 @@ else if (samplingOption.equals("changeDemandOnLocation")) {
int demandForThisLink = calculateDemandBasedOnLinkLength(countOfLinks, distributedDemand, demandToDistribute, possibleLinksForService.size(),
sumOfPossibleLinkLength, link);
countOfLinks++;
double serviceTime = newDemandInformationElement.getFirstJobElementTimePerUnit()
* demandForThisLink;
Id<CarrierService> idNewService = Id.create(
Carrier thisCarrier = CarriersUtils.getCarriers(scenario).getCarriers()
.get(Id.create(newDemandInformationElement.getCarrierName(), Carrier.class));
int numberOfJobsForDemand = calculateNumberOfJobsForDemand(thisCarrier, demandForThisLink);
for (int i = 0; i < numberOfJobsForDemand; i++) {
int singleDemandForThisLink = demandForThisLink / numberOfJobsForDemand;
if (i == numberOfJobsForDemand - 1)
singleDemandForThisLink = demandForThisLink - (numberOfJobsForDemand - 1) * singleDemandForThisLink;
double serviceTime = newDemandInformationElement.getFirstJobElementTimePerUnit()
* singleDemandForThisLink;
Id<CarrierService> idNewService = Id.create(
createJobId(scenario, newDemandInformationElement, link.getId(), null),
CarrierService.class);
if (demandToDistribute > 0 && demandForThisLink > 0) {
CarrierService thisService = CarrierService.Builder.newInstance(idNewService, link.getId())
.setCapacityDemand(demandForThisLink).setServiceDuration(serviceTime)
if (demandToDistribute > 0 && singleDemandForThisLink > 0) {
CarrierService thisService = CarrierService.Builder.newInstance(idNewService, link.getId())
.setCapacityDemand(singleDemandForThisLink).setServiceDuration(serviceTime)
.setServiceStartTimeWindow(newDemandInformationElement.getFirstJobElementTimeWindow())
.build();
CarriersUtils.getCarriers(scenario).getCarriers().values().iterator().next().getServices()
.put(thisService.getId(), thisService);
thisCarrier.getServices().put(thisService.getId(), thisService);
}
}
distributedDemand = distributedDemand + demandForThisLink;
}
Expand Down Expand Up @@ -706,23 +713,31 @@ else if (samplingOption.equals("changeDemandOnLocation")) {
}
int demandForThisLink = calculateDemandForThisLink(demandToDistribute, numberOfJobs, distributedDemand, i);

double serviceTime;
if (demandToDistribute == 0)
serviceTime = newDemandInformationElement.getFirstJobElementTimePerUnit();
else
serviceTime = newDemandInformationElement.getFirstJobElementTimePerUnit() * demandForThisLink;
usedServiceLocations.add(link.getId().toString());
Carrier thisCarrier = CarriersUtils.getCarriers(scenario).getCarriers()
.get(Id.create(newDemandInformationElement.getCarrierName(), Carrier.class));
int numberOfJobsForDemand = calculateNumberOfJobsForDemand(thisCarrier, demandForThisLink);
for (int j = 0; j < numberOfJobsForDemand; j++) {
int singleDemandForThisLink = demandForThisLink / numberOfJobsForDemand;
if (j == numberOfJobsForDemand - 1)
singleDemandForThisLink = demandForThisLink - (numberOfJobsForDemand - 1) * singleDemandForThisLink;
double serviceTime;
if (singleDemandForThisLink == 0)
serviceTime = newDemandInformationElement.getFirstJobElementTimePerUnit();
else
serviceTime = newDemandInformationElement.getFirstJobElementTimePerUnit() * demandForThisLink;
usedServiceLocations.add(link.getId().toString());

Id<CarrierService> idNewService = Id.create(
Id<CarrierService> idNewService = Id.create(
createJobId(scenario, newDemandInformationElement, link.getId(), null), CarrierService.class);
if ((demandToDistribute > 0 && demandForThisLink > 0) || demandToDistribute == 0) {
CarrierService thisService = CarrierService.Builder.newInstance(idNewService, link.getId())
.setCapacityDemand(demandForThisLink).setServiceDuration(serviceTime)
if ((demandToDistribute > 0 && singleDemandForThisLink > 0) || demandToDistribute == 0) {
CarrierService thisService = CarrierService.Builder.newInstance(idNewService, link.getId())
.setCapacityDemand(singleDemandForThisLink).setServiceDuration(serviceTime)
.setServiceStartTimeWindow(newDemandInformationElement.getFirstJobElementTimeWindow())
.build();
CarriersUtils.getCarriers(scenario).getCarriers()
CarriersUtils.getCarriers(scenario).getCarriers()
.get(Id.create(newDemandInformationElement.getCarrierName(), Carrier.class)).getServices()
.put(thisService.getId(), thisService);
}
}
distributedDemand = distributedDemand + demandForThisLink;
}
Expand Down Expand Up @@ -1007,29 +1022,56 @@ else if (numberOfPickupLocations != null) {
private static void createSingleShipment(Scenario scenario, DemandInformationElement newDemandInformationElement,
Link linkPickup, Link linkDelivery, int demandForThisLink) {

Id<CarrierShipment> idNewShipment = Id.create(createJobId(scenario, newDemandInformationElement,
linkPickup.getId(), linkDelivery.getId()), CarrierShipment.class);
Carrier thisCarrier = CarriersUtils.getCarriers(scenario).getCarriers()
.get(Id.create(newDemandInformationElement.getCarrierName(), Carrier.class));
int numberOfJobsForDemand = calculateNumberOfJobsForDemand(thisCarrier, demandForThisLink);

TimeWindow timeWindowPickup = newDemandInformationElement.getFirstJobElementTimeWindow();
TimeWindow timeWindowDelivery = newDemandInformationElement.getSecondJobElementTimeWindow();

double serviceTimePickup;
double serviceTimeDelivery;
if (demandForThisLink == 0) {
serviceTimePickup = newDemandInformationElement.getFirstJobElementTimePerUnit();
serviceTimeDelivery = newDemandInformationElement.getSecondJobElementTimePerUnit();
} else {
serviceTimePickup = newDemandInformationElement.getFirstJobElementTimePerUnit() * demandForThisLink;
serviceTimeDelivery = newDemandInformationElement.getSecondJobElementTimePerUnit() * demandForThisLink;
for (int i = 0; i < numberOfJobsForDemand; i++) {
Id<CarrierShipment> idNewShipment = Id.create(createJobId(scenario, newDemandInformationElement,
linkPickup.getId(), linkDelivery.getId()), CarrierShipment.class);
double serviceTimePickup;
double serviceTimeDelivery;
int singleDemandForThisLink = Math.round ((float) demandForThisLink / numberOfJobsForDemand);
if (i == numberOfJobsForDemand - 1)
singleDemandForThisLink = demandForThisLink - (numberOfJobsForDemand - 1) * singleDemandForThisLink;
if (singleDemandForThisLink == 0) {
serviceTimePickup = newDemandInformationElement.getFirstJobElementTimePerUnit();
serviceTimeDelivery = newDemandInformationElement.getSecondJobElementTimePerUnit();
} else {
serviceTimePickup = newDemandInformationElement.getFirstJobElementTimePerUnit() * singleDemandForThisLink;
serviceTimeDelivery = newDemandInformationElement.getSecondJobElementTimePerUnit() * singleDemandForThisLink;
}
CarrierShipment thisShipment = CarrierShipment.Builder
.newInstance(idNewShipment, linkPickup.getId(), linkDelivery.getId(), singleDemandForThisLink)
.setPickupServiceTime(serviceTimePickup).setPickupTimeWindow(timeWindowPickup)
.setDeliveryServiceTime(serviceTimeDelivery).setDeliveryTimeWindow(timeWindowDelivery)
.build();
thisCarrier.getShipments().put(thisShipment.getId(), thisShipment);
}
}

/**
* Method calculates the number of jobs for a demand on one link based on the largest vehicle capacity of the carrier.
*
* @param thisCarrier the carrier of a job
* @param demandForThisLink Demand for this link
* @return Number of jobs for this demand
*/
private static int calculateNumberOfJobsForDemand(Carrier thisCarrier, int demandForThisLink) {
double largestVehicleCapacity = 0;
for (CarrierVehicle vehicle : thisCarrier.getCarrierCapabilities().getCarrierVehicles().values()) {
if (vehicle.getType().getCapacity().getOther() > largestVehicleCapacity) {
largestVehicleCapacity = vehicle.getType().getCapacity().getOther();
}
}
if (demandForThisLink > largestVehicleCapacity) {
log.info("Demand {} is larger than the largest vehicle capacity ({}). Splitting demand into multiple jobs.", demandForThisLink, largestVehicleCapacity);
return (int) Math.ceil((double) demandForThisLink / largestVehicleCapacity);
}
CarrierShipment thisShipment = CarrierShipment.Builder
.newInstance(idNewShipment, linkPickup.getId(), linkDelivery.getId(), demandForThisLink)
.setPickupServiceTime(serviceTimePickup).setPickupTimeWindow(timeWindowPickup)
.setDeliveryServiceTime(serviceTimeDelivery).setDeliveryTimeWindow(timeWindowDelivery)
.build();
CarriersUtils.getCarriers(scenario).getCarriers()
.get(Id.create(newDemandInformationElement.getCarrierName(), Carrier.class)).getShipments()
.put(thisShipment.getId(), thisShipment);
return 1;
}

/**
Expand Down Expand Up @@ -1086,7 +1128,7 @@ private static int calculateDemandForThisLink(int demandToDistribute, int number
} else {
roundingError = roundingError
+ ((double) demandForThisLink - ((double) demandToDistribute / (double) numberOfJobs));
if (roundingError > 1) {
if (roundingError >= 1) {
demandForThisLink = demandForThisLink - 1;
roundingError = roundingError - 1;
}
Expand All @@ -1113,7 +1155,7 @@ private static int calculateDemandBasedOnLinkLength(int countOfLinks, int distri
.ceil(link.getLength() / sumOfPossibleLinkLength * (double) demandToDistribute);
roundingError = roundingError + ((double) demandForThisLink
- (link.getLength() / sumOfPossibleLinkLength * (double) demandToDistribute));
if (roundingError > 1) {
if (roundingError >= 1) {
demandForThisLink = demandForThisLink - 1;
roundingError = roundingError - 1;
}
Expand Down Expand Up @@ -1265,7 +1307,7 @@ private static HashMap<Id<Link>, Link> findAllPossibleLinks(Scenario scenario,
crsTransformationNetworkAndShape);
if (!possibleLinks.containsKey(newPossibleLink.getId()))
possibleLinks.put(newPossibleLink.getId(), newPossibleLink);
if (nearestLinkPerPerson.size() == possiblePersons.size())
if (!possiblePersons.isEmpty() && nearestLinkPerPerson.size() == possiblePersons.size())
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,13 @@ private void createDemand(DemandGenerationOptions selectedDemandGenerationOption
*/
FreightDemandGenerationUtils.preparePopulation(population, sampleSizeInputPopulation,
upSamplePopulationTo, "changeDemandOnLocation");
case noPopulationSampling ->
/*
* If the demand sample is equal to the population sample, the demand is created
* based on the given population and the set input population sampleSize
*/
FreightDemandGenerationUtils.preparePopulation(population, sampleSizeInputPopulation,
sampleSizeInputPopulation, "noPopulationSampling");
default -> throw new RuntimeException("No valid sampling option selected!");
}
switch (selectedPopulationOption) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public void configure(Header header, Layout layout) {
viz.description = "Number of rides (customers) is displayed in bars, wait statistics in lines";

Plotly.DataSet waitStats = viz.addDataset(data.output("*_waitStats_" + drtConfigGroup.mode + ".csv"));
Plotly.DataSet rejections = viz.addDataset(data.output("*drt_rejections_perTimeBin_" + drtConfigGroup.mode + ".csv"));
Plotly.DataSet rejections = viz.addDataset(data.output("*drt_rejections_perTimeBin_" + drtConfigGroup.mode + ".csv"));

viz.layout = tech.tablesaw.plotly.components.Layout.builder()
.xAxis(Axis.builder().title("Time Bin").build())
Expand Down Expand Up @@ -244,7 +244,7 @@ public void configure(Header header, Layout layout) {

viz.layout = tech.tablesaw.plotly.components.Layout.builder()
.xAxis(Axis.builder().title("Iteration").build())
.yAxis(Axis.builder().title("Wait Time [s]").build())
.yAxis(Axis.builder().title("Number of Rides").build())
.barMode(tech.tablesaw.plotly.components.Layout.BarMode.STACK)
.build();

Expand Down Expand Up @@ -272,12 +272,12 @@ public void configure(Header header, Layout layout) {
viz.description = "";
viz.dataset = data.output("*customer_stats_" + drtConfigGroup.mode + ".csv");
viz.x = "iteration";
viz.columns = List.of("wait_average","wait_median", "wait_p95");
viz.columns = List.of("wait_average", "wait_median", "wait_p95");
viz.legendName = List.of("Average", "Median", "95th Percentile");
viz.xAxisName = "Iteration";
viz.yAxisName = "Waiting Time [s]";
})
;
;

layout.row("Demand And Travel Time Statistics per iteration")
.el(Plotly.class, (viz, data) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@
public class EDrtControlerCreator {

public static Controler createControler(Config config, boolean otfvis) {
MultiModeDrtConfigGroup multiModeDrtConfig = MultiModeDrtConfigGroup.get(config);
DrtConfigs.adjustMultiModeDrtConfig(multiModeDrtConfig, config.scoring(), config.routing());

Scenario scenario = DrtControlerCreator.createScenarioWithDrtRouteFactory(config);
ScenarioUtils.loadScenario(scenario);
return createControler(config, scenario, otfvis);
}
public static Controler createControler(Config config, Scenario scenario, boolean otfvis) {
MultiModeDrtConfigGroup multiModeDrtConfig = MultiModeDrtConfigGroup.get(config);
DrtConfigs.adjustMultiModeDrtConfig(multiModeDrtConfig, config.scoring(), config.routing());

Controler controler = new Controler(scenario);
controler.addOverridingModule(new MultiModeEDrtModule());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.matsim.contrib.drt.extension.operations;

import org.matsim.api.core.v01.Scenario;
import org.matsim.contrib.drt.extension.DrtWithExtensionsConfigGroup;
import org.matsim.contrib.drt.extension.operations.operationFacilities.OperationFacilitiesModeModule;
import org.matsim.contrib.drt.extension.operations.operationFacilities.OperationFacilitiesQSimModule;
import org.matsim.contrib.drt.extension.operations.shifts.analysis.efficiency.DrtShiftEfficiencyModeModule;
Expand All @@ -26,20 +28,34 @@ public class DrtOperationsControlerCreator {
* @return
*/
public static Controler createControler(Config config, boolean otfvis) {
MultiModeDrtConfigGroup multiModeDrtConfig = MultiModeDrtConfigGroup.get(config);

Controler controler = DrtControlerCreator.createControler(config, otfvis);
return prepareController(config, controler);
}

/**
* Creates a controller in one step.
*
* @param config
* @param scenario
* @param otfvis
* @return
*/
public static Controler createControler(Config config, Scenario scenario, boolean otfvis) {
Controler controler = DrtControlerCreator.createControler(config, scenario, otfvis);
return prepareController(config, controler);
}

private static Controler prepareController(Config config, Controler controler) {
MultiModeDrtConfigGroup multiModeDrtConfig = MultiModeDrtConfigGroup.get(config);
for (DrtConfigGroup drtCfg : multiModeDrtConfig.getModalElements()) {
controler.addOverridingModule(new ShiftDrtModeModule(drtCfg));
controler.addOverridingQSimModule(new DrtModeQSimModule(drtCfg, new ShiftDrtModeOptimizerQSimModule(drtCfg)));
controler.addOverridingModule(new OperationFacilitiesModeModule((DrtWithOperationsConfigGroup) drtCfg));
controler.addOverridingModule(new OperationFacilitiesModeModule((DrtWithExtensionsConfigGroup) drtCfg));
controler.addOverridingQSimModule(new OperationFacilitiesQSimModule(drtCfg));
controler.addOverridingModule(new DrtShiftEfficiencyModeModule(drtCfg));
}

controler.configureQSimComponents(DvrpQSimComponents.activateAllModes(multiModeDrtConfig));

return controler;
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.matsim.contrib.drt.extension.operations;

import org.matsim.api.core.v01.Scenario;
import org.matsim.contrib.drt.extension.DrtWithExtensionsConfigGroup;
import org.matsim.contrib.drt.extension.edrt.run.EDrtControlerCreator;
import org.matsim.contrib.drt.extension.operations.eshifts.charging.ShiftOperatingVehicleProvider;
import org.matsim.contrib.drt.extension.operations.eshifts.fleet.EvShiftDvrpFleetQSimModule;
Expand All @@ -23,29 +25,34 @@
public class EDrtOperationsControlerCreator {

public static Controler createControler(Config config, boolean otfvis) {

MultiModeDrtConfigGroup multiModeDrtConfig = MultiModeDrtConfigGroup.get(config);

Controler controler = EDrtControlerCreator.createControler(config, otfvis);
prepareController(config, controler);
return controler;
}

public static Controler createControler(Config config, Scenario scenario, boolean otfvis) {
Controler controler = EDrtControlerCreator.createControler(config, scenario, otfvis);
prepareController(config, controler);
return controler;
}

private static void prepareController(Config config, Controler controler) {
MultiModeDrtConfigGroup multiModeDrtConfig = MultiModeDrtConfigGroup.get(config);
for (DrtConfigGroup drtCfg : multiModeDrtConfig.getModalElements()) {
controler.addOverridingModule(new ShiftDrtModeModule(drtCfg));
controler.addOverridingQSimModule(new DrtModeQSimModule(drtCfg, new ShiftDrtModeOptimizerQSimModule(drtCfg)));
controler.addOverridingQSimModule(new ShiftEDrtModeOptimizerQSimModule(drtCfg));
controler.addOverridingQSimModule(new EvShiftDvrpFleetQSimModule(drtCfg.getMode()));
controler.addOverridingModule(new OperationFacilitiesModeModule((DrtWithOperationsConfigGroup) drtCfg));
controler.addOverridingModule(new OperationFacilitiesModeModule((DrtWithExtensionsConfigGroup) drtCfg));
controler.addOverridingQSimModule(new OperationFacilitiesQSimModule(drtCfg));
controler.addOverridingModule(new DrtShiftEfficiencyModeModule(drtCfg));
}


controler.addOverridingQSimModule(new AbstractQSimModule() {
@Override
protected void configureQSim() {
this.bind(IdleDischargingHandler.VehicleProvider.class).to(ShiftOperatingVehicleProvider.class);
}
});

return controler;
}
}
Loading