[go: nahoru, domu]

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

Add transfer time settings #522

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
routing: add transfer time settings
  • Loading branch information
pablohoch committed Jun 19, 2024
commit 3ac49d26b1199f70e87dc1f337a2aa29678a6c12
2 changes: 1 addition & 1 deletion .pkg
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
[nigiri]
url=git@github.com:motis-project/nigiri.git
branch=master
commit=29e632864c8f0ca25fd90c4f4181ba1b2a3aa184
commit=5c6ef1817e955c0965547a191dbb728e5abf40d3
[osr]
url=git@github.com:motis-project/osr.git
branch=master
Expand Down
4 changes: 2 additions & 2 deletions .pkg.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
7229772967459208531
1545742930884391374
cista 259ee7fbdc622e8f796081337ea842c5b152791c
zlib fe8e13ffca867612951bc6baf114e5ac8b00f305
boost 60cae66449fa3c9599b2b7d3d5d44c65301ed3a3
Expand All @@ -24,7 +24,7 @@ abseil-cpp ba5240842d352b4b67a32092453a2fe5fe53a62e
protobuf d8136b9c6a62db6ce09900ecdeb82bb793096cbd
unordered_dense c11595a7743d20622637584bddf77243d72ae152
wyhash 1e012b57fc2227a9e583a57e2eacb3da99816d99
nigiri 29e632864c8f0ca25fd90c4f4181ba1b2a3aa184
nigiri 5c6ef1817e955c0965547a191dbb728e5abf40d3
expat 636c9861e8e7c119f3626d1e6c260603ab624516
libosmium d5cc2a02d997c2b464d37d37c3a75cd9efa23dc4
protozero 8c9f3fa97c2cfdceef86d0b61818ae98e9328f29
Expand Down
16 changes: 15 additions & 1 deletion docs/api/schemas/motis/intermodal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,24 @@ IntermodalRoutingRequest:
description: |
The maximum number of transfers allowed per journey.

If set to `-1`, the internal default value is used.
If set to `-1` (the default value if not specified), the internal
default value is used.
bike_transport:
description: |
Whether only journeys where bike transport is allowed should be considered.

If set to `true`, only trips where bike transport is allowed can be
used.
min_transfer_time:
description: |
The minimum transfer time in minutes.

Set to `0` (the default value if not specified) to use the default
transfer times from the timetable.
transfer_time_factor:
description: |
Multiply all transfer times by this factor. Must be >= 1.0.
The minimum transfer time is not multiplied by this factor.

Set to `1.0` (the default value if not specified) to use the default
transfer times from the timetable.
16 changes: 15 additions & 1 deletion docs/api/schemas/motis/routing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,27 @@ RoutingRequest:
description: |
The maximum number of transfers allowed per journey.

If set to `-1`, the internal default value is used.
If set to `-1` (the default value if not specified), the internal
default value is used.
bike_transport:
description: |
Whether only journeys where bike transport is allowed should be considered.

If set to `true`, only trips where bike transport is allowed can be
used.
min_transfer_time:
description: |
The minimum transfer time in minutes.

Set to `0` (the default value if not specified) to use the default
transfer times from the timetable.
transfer_time_factor:
description: |
Multiply all transfer times by this factor. Must be >= 1.0.
The minimum transfer time is not multiplied by this factor.

Set to `1.0` (the default value if not specified) to use the default
transfer times from the timetable.
RoutingResponse:
description: TODO
fields:
Expand Down
3 changes: 2 additions & 1 deletion modules/intermodal/src/intermodal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,8 @@ msg_ptr intermodal::route(msg_ptr const& msg) {
? 0
: mc.CreateVector(req->allowed_claszes()->Data(),
req->allowed_claszes()->size()),
req->max_transfers(), req->bike_transport())
req->max_transfers(), req->bike_transport(),
req->min_transfer_time(), req->transfer_time_factor())
.Union(),
router);

Expand Down
7 changes: 6 additions & 1 deletion modules/nigiri/src/routing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,12 @@ motis::module::msg_ptr route(tag_lookup const& tags, n::timetable const& tt,
.extend_interval_later_ = extend_interval_later,
.prf_idx_ = prf_idx,
.allowed_claszes_ = to_clasz_mask(req->allowed_claszes()),
.require_bike_transport_ = req->bike_transport()};
.require_bike_transport_ = req->bike_transport(),
.transfer_time_settings_ = n::routing::transfer_time_settings{
.default_ = req->min_transfer_time() <= 0 &&
req->transfer_time_factor() == 1.0F,
.min_transfer_time_ = n::duration_t{req->min_transfer_time()},
.factor_ = req->transfer_time_factor()}};

utl::verify(!q.start_.empty(), "no start edges");
utl::verify(!q.destination_.empty(), "no destination edges");
Expand Down
2 changes: 2 additions & 0 deletions protocol/intermodal/IntermodalRoutingRequest.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,6 @@ table IntermodalRoutingRequest {
allowed_claszes: [ubyte] (optional);
max_transfers: int = -1 (optional); // -1 = use default value
bike_transport: bool = false (optional);
min_transfer_time: int = 0 (optional); // minutes
transfer_time_factor: float = 1.0 (optional);
}
2 changes: 2 additions & 0 deletions protocol/routing/RoutingRequest.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,6 @@ table RoutingRequest {
allowed_claszes: [ubyte] (optional);
max_transfers: int = -1 (optional); // -1 = use default value
bike_transport: bool = false (optional);
min_transfer_time: int = 0 (optional); // minutes
transfer_time_factor: float = 1.0 (optional);
}
Loading