pub trait Route {
type Place;
// Required methods
fn origin(&self) -> Self::Place;
fn place(&self, task: TaskId) -> Self::Place;
fn travel(&self, from: &Self::Place, to: &Self::Place) -> Option<u64>;
fn reward(&self, task: TaskId, finish: u64) -> Option<u64>;
// Provided methods
fn departure(&self) -> u64 { ... }
fn duration(&self, task: TaskId) -> u64 { ... }
fn earliest_start(&self, task: TaskId) -> u64 { ... }
}Expand description
How an agent travels between task sites, and what each task is worth when.
Times are in a unit of the implementer’s choice, the same everywhere: ticks, seconds or minutes.
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn earliest_start(&self, task: TaskId) -> u64
fn earliest_start(&self, task: TaskId) -> u64
The earliest time task may start; an agent that arrives earlier waits. The default
is time zero.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".