Skip to content

Commit 8074f17

Browse files
committed
Add boardCost field for cars to the router config.
1 parent 61872ca commit 8074f17

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

application/src/main/java/org/opentripplanner/standalone/config/routerequest/RouteRequestConfig.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,19 @@ private static void mapCarPreferences(NodeAdapter root, CarPreferences.Builder b
636636
)
637637
.asDouble(dft.reluctance())
638638
)
639+
.withBoardCost(
640+
c
641+
.of("boardCost")
642+
.since(V2_7)
643+
.summary(
644+
"Prevents unnecessary transfers by adding a cost for boarding a transit vehicle."
645+
)
646+
.description(
647+
"This is the cost that is used when boarding while driving. " +
648+
"This can be different compared to the boardCost while walking or cycling."
649+
)
650+
.asInt(dft.boardCost())
651+
)
639652
.withPickupCost(
640653
c
641654
.of("pickupCost")

application/src/test/resources/standalone/config/router-config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
},
4545
"car": {
4646
"reluctance": 10,
47+
"boardCost": 600,
4748
"decelerationSpeed": 2.9,
4849
"accelerationSpeed": 2.9,
4950
"rental": {

doc/user/RouteRequest.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ and in the [transferRequests in build-config.json](BuildConfiguration.md#transfe
8787
| [boardSlackForMode](#rd_boardSlackForMode) | `enum map of duration` | How much extra time should be given when boarding a vehicle for each given mode. | *Optional* | | 2.0 |
8888
| car | `object` | Car preferences. | *Optional* | | 2.5 |
8989
|    accelerationSpeed | `double` | The acceleration speed of an automobile, in meters per second per second. | *Optional* | `2.9` | 2.0 |
90+
|    [boardCost](#rd_car_boardCost) | `integer` | Prevents unnecessary transfers by adding a cost for boarding a transit vehicle. | *Optional* | `600` | 2.7 |
9091
|    decelerationSpeed | `double` | The deceleration speed of an automobile, in meters per second per second. | *Optional* | `2.9` | 2.0 |
9192
|    pickupCost | `integer` | Add a cost for car pickup changes when a pickup or drop off takes place | *Optional* | `120` | 2.1 |
9293
|    pickupTime | `duration` | Add a time for car pickup changes when a pickup or drop off takes place | *Optional* | `"PT1M"` | 2.1 |
@@ -618,6 +619,15 @@ Sometimes there is a need to configure a board times for specific modes, such as
618619
ferries, where the check-in process needs to be done in good time before ride.
619620

620621

622+
<h3 id="rd_car_boardCost">boardCost</h3>
623+
624+
**Since version:** `2.7`**Type:** `integer`**Cardinality:** `Optional`**Default value:** `600`
625+
**Path:** /routingDefaults/car
626+
627+
Prevents unnecessary transfers by adding a cost for boarding a transit vehicle.
628+
629+
This is the cost that is used when boarding while driving. This can be different compared to the boardCost while walking or cycling.
630+
621631
<h3 id="rd_car_parking_unpreferredVehicleParkingTagCost">unpreferredVehicleParkingTagCost</h3>
622632

623633
**Since version:** `2.3`**Type:** `integer`**Cardinality:** `Optional`**Default value:** `300`
@@ -1209,6 +1219,7 @@ include stairs as a last result.
12091219
},
12101220
"car" : {
12111221
"reluctance" : 10,
1222+
"boardCost" : 600,
12121223
"decelerationSpeed" : 2.9,
12131224
"accelerationSpeed" : 2.9,
12141225
"rental" : {

doc/user/RouterConfiguration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ Used to group requests when monitoring OTP.
514514
},
515515
"car" : {
516516
"reluctance" : 10,
517+
"boardCost" : 600,
517518
"decelerationSpeed" : 2.9,
518519
"accelerationSpeed" : 2.9,
519520
"rental" : {

0 commit comments

Comments
 (0)