Expand description
Route planning and step-along-route API for agents.
Mirrors Julia Agents.jl plan_route!, plan_best_route!, and
move_along_route! functions. Agents store their planned routes in
a RoutePlanner, then step along them one waypoint at a time.
§Usage Pattern
ⓘ
use rustsim_pathfinding::route::RoutePlanner;
let mut planner = RoutePlanner::new();
// Plan a route for agent 1
let waypoints = vec![(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)];
planner.set_route(1, waypoints);
// Move agent one step along the route at speed 1.5
let result = planner.move_along_route_2d(
1,
(0.5, 1.0), // current position
1.5, // speed
1.0, // dt
false, // periodic
100.0, // extent_x (only used when periodic)
100.0, // extent_y
);Structs§
- Move
Result2D - 2D route planning result.
- Move
Result3D - 3D route planning result.
- Route
Planner - Per-agent route storage and movement controller.