Skip to main content

Module route

Module route 

Source
Expand description

Timed routes: a ready-made path score for agents that travel between task sites.

An agent leaves its origin at its departure time, travels to each task’s place in path order, waits for the task’s earliest start if it arrives early, works for the task’s duration, and collects a reward that depends on when it finishes. Implement Route for the travel times, windows and rewards, and wrap it in Timed to get a PathScore; wrap that in BestInsertion to get a Valuation that inserts each task where it adds the most.

flowchart LR
    origin --> travel[travel to the task's place]
    travel --> wait[wait for the earliest start]
    wait --> work[work for the duration]
    work --> reward[reward for the finish time]
    reward -->|next task| travel

Whether gains diminish depends on the route: rewards that never grow with later finish times, and travel times that obey the triangle inequality, keep feasibility monotone, but decaying rewards can still let one task raise another’s gain: once the path passes near a site, visiting it delays the rest less. In the plane, rewards::halving shows this within a handful of sites. Run check_diminishing on representative instances.

rewards has common reward shapes.

Modules§

rewards
Common shapes of time-dependent rewards, for Route::reward.

Structs§

Timed
A PathScore from a Route: the sum of the rewards along the path, or None when a place is unreachable or a task finishes too late.
Visit
One task of a timed route: when the agent arrives, starts, finishes, and what it earns.

Traits§

Route
How an agent travels between task sites, and what each task is worth when.