Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
travelynx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
derf
travelynx
Commits
a9850d07
Commit
a9850d07
authored
5 years ago
by
Birte Kristina Friesel
Browse files
Options
Downloads
Patches
Plain Diff
improve connection detection heuristic
parent
35cc18df
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/Travelynx/Controller/Passengerrights.pm
+21
-1
21 additions, 1 deletion
lib/Travelynx/Controller/Passengerrights.pm
with
21 additions
and
1 deletion
lib/Travelynx/Controller/Passengerrights.pm
+
21
−
1
View file @
a9850d07
...
...
@@ -13,8 +13,28 @@ sub mark_if_missed_connection {
my
$wait_time
=
(
$next_journey
->
{
rt_departure
}
->
epoch
-
$journey
->
{
rt_arrival
}
->
epoch
)
/
60
;
# Assumption: $next_journey is a missed connection (i.e., if $journey had
# been on time it would have been an earlier train)
# * the wait time between arrival and departure is less than 70 minutes
# (up to 60 minutes to wait for the next train in an hourly connection
# + up to 10 minutes transfer time between platforms)
# * the delay between scheduled arrival at the interchange station and
# real departure of $next_journey (which is hopefully the same as the
# total delay at the destination of $next_journey) is more than 120
# minutes (-> 50% fare reduction) or it is more than 60 minutes and the
# single-journey delay is less than 60 minutes (-> 25% fare reduction)
# This ensures that $next_journey is only referenced if the missed
# connection makes a difference from a passenger rights point of view --
# if $journey itself is already 60 .. 119 minutes delayed and the
# delay with the connection to $next_journey is also 60 .. 119 minutes,
# including it is not worth the effort. Similarly, if $journey is already
# ≥120 minutes delayed, looking for connections and more delay is
# pointless.
if
(
$wait_time
<
12
0
$wait_time
<
7
0
and
(
$possible_delay
>=
120
or
(
$journey
->
{
delay
}
<
60
and
$possible_delay
>=
60
)
)
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment