Why not adopt me?
NAME
Algorithm::ScheduledPath::Path - path class for Algorithm::ScheduledPath
DESCRIPTION
This is a class for managine paths (ordered sets of edges) in Algorithm::ScheduledPath.
Methods
- new
- add_edge
- first_edge
- last_edge
- depart_time
- arrive_time
- travel_time
- get_edges
-
@edges = @{ $path->get_edges };
Returns a reference to an array containing the component Algorithm::ScheduledPath::Edge objects.
- num_edges
-
$size = $path->num_edges;
Returns the number of edges in the path.
- has_vertex
-
if ($path->has_vertex('LEV')) { ... }
Returns true if a path passes through a given vertex.
- has_cycle
-
if ($path->has_cycle) { ... }
Returns true if the path has a "cycle" (that is, if it passes through the same vertex more than once).
- compressed
-
$cpath = $path->compressed;
Produces a "compressed" version of the path, where sequential edges sharing the same path identifier are merged. The result may be a path with "virtual" edges.
For instance, if the path represents a route one might take on a bus line, where the path identifier refers to bus routes, then the compressed version would merge bus stops on the same route so as to make it easier to identify where one needs to transfer to different bus lines. (One could also use this to facilitate analysis of the number of transfers.)
AUTHOR
Robert Rothenberg <rrwo at cpan.org>
LICENSE
Copyright (c) 2004 Robert Rothenberg. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.