line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
5
|
use Map::Metro::Standard::Moops; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
11
|
|
2
|
1
|
|
|
1
|
|
2429
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
25
|
|
3
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
64
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.2300'; # VERSION |
6
|
|
|
|
|
|
|
# PODNAME: Map::Metro::Graph::Routing |
7
|
|
|
|
|
|
|
# ABSTRACT: A collection of routes between two stations |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
1583
|
class Map::Metro::Graph::Routing { |
|
1
|
|
|
1
|
|
34
|
|
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
69
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
274
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
61
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
65
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
154
|
|
|
1
|
|
|
|
|
52
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
4760
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
6634
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
4555
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
14
|
|
|
1
|
|
|
|
|
81
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
229
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
1332
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
6196
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
28
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
57
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
158
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
5416
|
|
|
1
|
|
|
|
|
24
|
|
|
1
|
|
|
|
|
185
|
|
|
0
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
|
|
16
|
has origin_station => ( |
12
|
|
|
|
|
|
|
is => 'ro', |
13
|
|
|
|
|
|
|
isa => Station, |
14
|
|
|
|
|
|
|
required => 1, |
15
|
|
|
|
|
|
|
); |
16
|
1
|
|
|
|
|
4710
|
has destination_station => ( |
17
|
|
|
|
|
|
|
is => 'ro', |
18
|
|
|
|
|
|
|
isa => Station, |
19
|
|
|
|
|
|
|
required => 1, |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
has line_stations => ( |
22
|
|
|
|
|
|
|
is => 'ro', |
23
|
|
|
|
|
|
|
isa => ArrayRef[ LineStation ], |
24
|
|
|
|
|
|
|
traits => ['Array'], |
25
|
0
|
|
|
|
|
0
|
default => sub {[]}, |
26
|
1
|
|
|
|
|
4102
|
handles => { |
27
|
|
|
|
|
|
|
add_line_station => 'push', |
28
|
|
|
|
|
|
|
find_line_station => 'first', |
29
|
|
|
|
|
|
|
all_line_stations => 'elements', |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
); |
32
|
1
|
|
|
|
|
32780
|
has routes => ( |
33
|
|
|
|
|
|
|
is => 'ro', |
34
|
|
|
|
|
|
|
isa => ArrayRef[ Route ], |
35
|
|
|
|
|
|
|
traits => ['Array'], |
36
|
|
|
|
|
|
|
handles => { |
37
|
|
|
|
|
|
|
get_route => 'get', |
38
|
|
|
|
|
|
|
add_route => 'push', |
39
|
|
|
|
|
|
|
all_routes => 'elements', |
40
|
|
|
|
|
|
|
sort_routes => 'sort', |
41
|
|
|
|
|
|
|
route_count => 'count', |
42
|
|
|
|
|
|
|
find_route => 'first', |
43
|
|
|
|
|
|
|
}, |
44
|
|
|
|
|
|
|
); |
45
|
|
|
|
|
|
|
|
46
|
1
|
0
|
|
1
|
|
18278
|
around add_line_station(LineStation $ls) { |
|
1
|
0
|
|
1
|
|
3
|
|
|
1
|
0
|
|
0
|
|
245
|
|
|
1
|
0
|
|
|
|
5
|
|
|
1
|
0
|
|
|
|
3
|
|
|
1
|
0
|
|
|
|
186
|
|
|
1
|
|
|
|
|
39533
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
47
|
0
|
|
|
0
|
|
|
my $exists = $self->find_line_station(sub { $ls->line_station_id == $_->line_station_id }); |
|
0
|
|
|
|
|
|
|
48
|
0
|
0
|
|
|
|
|
return if $exists; |
49
|
0
|
|
|
|
|
|
$self->$next($ls); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
1
|
0
|
|
1
|
|
1241
|
method ordered_routes { |
|
1
|
|
|
0
|
|
3
|
|
|
1
|
|
|
|
|
139
|
|
|
1
|
|
|
|
|
1030
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
53
|
0
|
|
|
0
|
|
|
$self->sort_routes(sub { $_[0]->weight <=> $_[1]->weight }); |
|
0
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
__END__ |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=pod |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=encoding UTF-8 |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 NAME |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Map::Metro::Graph::Routing - A collection of routes between two stations |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 VERSION |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Version 0.2300, released 2016-01-14. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 DESCRIPTION |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
A routing is the collection of L<Routes|Map::Metro::Graph::Route> possible between two L<Stations|Map::Metro::Graph::Station>. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 METHODS |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head2 origin_station() |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Returns the L<Station|Map::Metro::Graph::Station> object representing the starting station of the route. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head2 destination_station() |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Returns the L<Station|Map::Metro::Graph::Station> object representing the final station of the route. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head2 line_stations() |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Returns an array of all L<LineStation|Map::Metro::Graph::LineStations> possible in the routing. |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head2 routes() |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Returns an array of all L<Route|Map::Metro::Graph::Routes> in the routing. |
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 |