Algorithm::ScheduledPath::Edge - Edge class for Algorithm::ScheduledPath
This is a class used for managing edges in the Algorithm::ScheduledPath::Path manpage and the Algorithm::ScheduledPath manpage.
$edge = Algorithm::ScheduledPath::Edge->new();
The constructor. Fields can be set from the constructor:
$edge = Algorithm::ScheduledPath::Edge->new( path_id => 'X60', origin => 'KDY', depart_time => 500, destination => 'EDH', arrive_time => 570, );
Note that the call style has changed from versions prior to 0.41. It no longer accepts a hash reference.
$edge->id( $id );
$id = $edge->id;
An accessor method for the unique edge id. It is currently unused.
If the value is set to 0 or undef, it will automatically
generate a unique identifier.
$edge->path_id( $id );
$id = $edge->path_id;
An accessor method for the edge path id. This is a tag used to group together multiple egdes into one path. It is assumed to be a string.
$edge->origin( $name );
$name = $edge->origin;
An accessor method for identifying the origin vertex. It is assumed to be a string.
$edge->depart_time( $time );
$time = $edge->depart_time;
An accessor method for specifying the depature time, as a number.
The number value can be anything you need it to be: reals or integers, Unix epoch time, the number of days since X day, shire years, seconds, minutes, hours, days, weeks, whatever. As long as all edges have time values in the same units.
An accessor method for identifying the destination vertex. It is assumed to be a string.
An accessor method for specifying the arrival time, as a number. It is assumed to be greater than or equal to the depature time. (See depart_time for more information on the format.)
An accessor method for attaching additional data to the edge. It is assumed to be a scalar value (though it may be a reference to an object).
$time = $edge->travel_time;
Returns the difference between the departure and arrival times.
$edge2 = $edge->clone;
Clones the edge object.
Robert Rothenberg <rrwo at cpan.org>
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.
Algorithm::ScheduledPath