jupedsim_scenarios.direct_steering_runtime#
Functions#
|
|
|
|
|
True if a disk of agent_radius centered at (x, y) overlaps polygon. |
|
Determine whether the agent has reached its current stage. |
|
|
|
|
|
|
|
|
|
|
|
Pick a target point in the stage polygon. |
|
|
|
|
|
|
|
|
|
Module Contents#
- body_intersects_polygon(x, y, polygon, agent_radius)[source]#
True if a disk of agent_radius centered at (x, y) overlaps polygon.
Used for exit-arrival checks where the routing’s arrival waypoint may land outside a narrow exit polygon (issue #15). Shapely’s polygon.distance(point) is 0 when the point is inside or on the boundary, so this also subsumes is_inside_polygon for any non-negative radius.
- check_stage_reached(wait_info, stage_cfg, x, y, current_time, target)[source]#
Determine whether the agent has reached its current stage.
Transit stages (waiting_time=0, non-exit, with polygon) use entry-based transition: the agent only needs to enter the polygon and dwell briefly. Waiting stages and exits use the original distance-based check.
Returns True if the stage should be considered reached. May mutate wait_info[“inside_since”] as a side-effect.
- ensure_agent_speed_state(agent_speed_state: dict[int, dict[str, Any]], agent_id: int, agent)[source]#
- pick_stage_target(wait_state, next_stage_cfg)[source]#
Pick a target point in the stage polygon.
Transit stages (waiting_time=0, non-exit) use the polygon centroid so agents approach head-on without crossing paths. Waiting stages use a random interior point to distribute agents.