NAME

Algorithm::ScheduledPath::Edge - Edge class for Algorithm::ScheduledPath

DESCRIPTION

This is a class used for managing edges in Algorithm::ScheduledPath::Path and Algorithm::ScheduledPath.

Methods

new
$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.

id
$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.

path_id
$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.

origin
$edge->origin( $name );

$name = $edge->origin;

An accessor method for identifying the origin vertex. It is assumed to be a string.

depart_time
$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.

destination

An accessor method for identifying the destination vertex. It is assumed to be a string.

arrive_time

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.)

data

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).

travel_time
$time = $edge->travel_time;

Returns the difference between the departure and arrival times.

clone
$edge2 = $edge->clone;

Clones the edge object.

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.

SEE ALSO

Algorithm::ScheduledPath