line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
5
|
use Map::Metro::Standard::Moops; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
2
|
1
|
|
|
1
|
|
2380
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
29
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
51
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.2300'; # VERSION |
6
|
|
|
|
|
|
|
# PODNAME: Map::Metro::Graph::Step |
7
|
|
|
|
|
|
|
# ABSTRACT: The movement from one station to the next in a route |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
1647
|
class Map::Metro::Graph::Step { |
|
1
|
|
|
1
|
|
35
|
|
|
1
|
|
|
1
|
|
7
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
71
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
284
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
61
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
52
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
103
|
|
|
1
|
|
|
|
|
36
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
4766
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
6804
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
4616
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
13
|
|
|
1
|
|
|
|
|
79
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
225
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
1342
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
6381
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
27
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
51
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
154
|
|
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
5357
|
|
|
1
|
|
|
|
|
20
|
|
|
1
|
|
|
|
|
160
|
|
|
0
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
|
|
16
|
has origin_line_station => ( |
12
|
|
|
|
|
|
|
is => 'ro', |
13
|
|
|
|
|
|
|
isa => LineStation, |
14
|
|
|
|
|
|
|
required => 1, |
15
|
|
|
|
|
|
|
); |
16
|
1
|
|
|
|
|
4729
|
has destination_line_station => ( |
17
|
|
|
|
|
|
|
is => 'ro', |
18
|
|
|
|
|
|
|
isa => LineStation, |
19
|
|
|
|
|
|
|
required => 1, |
20
|
|
|
|
|
|
|
); |
21
|
1
|
|
|
|
|
4306
|
has previous_step => ( |
22
|
|
|
|
|
|
|
is => 'rw', |
23
|
|
|
|
|
|
|
isa => Maybe[ Step ], |
24
|
|
|
|
|
|
|
predicate => 1, |
25
|
|
|
|
|
|
|
); |
26
|
1
|
|
|
|
|
6664
|
has next_step => ( |
27
|
|
|
|
|
|
|
is => 'rw', |
28
|
|
|
|
|
|
|
isa => Maybe[ Step ], |
29
|
|
|
|
|
|
|
predicate => 1, |
30
|
|
|
|
|
|
|
); |
31
|
1
|
|
|
|
|
6079
|
has weight => ( |
32
|
|
|
|
|
|
|
is => 'ro', |
33
|
|
|
|
|
|
|
isa => Int, |
34
|
|
|
|
|
|
|
required => 1, |
35
|
|
|
|
|
|
|
default => 1, |
36
|
|
|
|
|
|
|
); |
37
|
|
|
|
|
|
|
|
38
|
1
|
0
|
0
|
1
|
|
18068
|
around BUILDARGS($orig: $class, %args) { |
|
1
|
0
|
|
1
|
|
2
|
|
|
1
|
0
|
|
1
|
|
183
|
|
|
1
|
0
|
|
0
|
|
5
|
|
|
1
|
0
|
|
|
|
2
|
|
|
1
|
|
|
|
|
167
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
216
|
|
|
1
|
|
|
|
|
4252
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
39
|
0
|
0
|
|
|
|
|
return $class->$orig(%args) if !exists $args{'from_connection'}; |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
my $conn = $args{'from_connection'}; |
42
|
0
|
0
|
|
|
|
|
return if !defined $conn; |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
return $class->$orig( |
45
|
|
|
|
|
|
|
origin_line_station => $conn->origin_line_station, |
46
|
|
|
|
|
|
|
destination_line_station => $conn->destination_line_station, |
47
|
|
|
|
|
|
|
weight => $conn->weight, |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
1
|
0
|
|
1
|
|
1257
|
method is_line_transfer { |
|
1
|
|
|
0
|
|
3
|
|
|
1
|
|
|
|
|
145
|
|
|
1
|
|
|
|
|
1036
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
return $self->origin_line_station->station->id == $self->destination_line_station->station->id; |
53
|
0
|
|
|
|
|
|
return $self->origin_line_station->line->id ne $self->destination_line_station->line->id; |
54
|
|
|
|
|
|
|
} |
55
|
1
|
0
|
|
1
|
|
1263
|
method is_station_transfer { |
|
1
|
|
|
0
|
|
1
|
|
|
1
|
|
|
|
|
230
|
|
|
1
|
|
|
|
|
177
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
my $origin_station_line_ids = [ map { $_->id } $self->origin_line_station->station->all_lines ]; |
|
0
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
my $destination_station_line_ids = [ map { $_->id } $self->destination_line_station->station->all_lines ]; |
|
0
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
my $are_on_same_line = List::Compare->new($origin_station_line_ids, $destination_station_line_ids)->get_intersection; |
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
return !$are_on_same_line; |
62
|
|
|
|
|
|
|
} |
63
|
1
|
0
|
|
1
|
|
1274
|
method was_line_transfer { |
|
1
|
|
|
0
|
|
2
|
|
|
1
|
|
|
|
|
128
|
|
|
1
|
|
|
|
|
152
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
64
|
0
|
0
|
|
|
|
|
return if !$self->has_previous_step; |
65
|
0
|
|
|
|
|
|
return $self->previous_step->is_line_transfer; |
66
|
|
|
|
|
|
|
} |
67
|
1
|
0
|
|
1
|
|
1227
|
method was_station_transfer { |
|
1
|
|
|
0
|
|
4
|
|
|
1
|
|
|
|
|
123
|
|
|
1
|
|
|
|
|
151
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
68
|
0
|
0
|
|
|
|
|
return if !$self->has_previous_step; |
69
|
0
|
|
|
|
|
|
return $self->previous_step->is_station_transfer; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
1; |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
__END__ |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=pod |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=encoding UTF-8 |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 NAME |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Map::Metro::Graph::Step - The movement from one station to the next in a route |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 VERSION |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
Version 0.2300, released 2016-01-14. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 DESCRIPTION |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Steps are exactly like L<Connections::Map::Metro::Graph::Connection>, in that they describe the combination of two |
92
|
|
|
|
|
|
|
specific L<LineStations|Map::Metro::Graph::LineStation>, and the 'cost' of travelling between them, but with an important |
93
|
|
|
|
|
|
|
difference: A Step is part of a specific L<Route|Map::Metro::Graph::Route>. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head1 SOURCE |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
L<https://github.com/Csson/p5-Map-Metro> |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head1 HOMEPAGE |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
L<https://metacpan.org/release/Map-Metro> |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 AUTHOR |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Erik Carlsson <info@code301.com> |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
This software is copyright (c) 2016 by Erik Carlsson. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
112
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=cut |