jupedsim_scenarios.simulation_init#
Attributes#
Functions#
|
Build DS routing state as origin->weighted-next mapping. |
|
Create appropriate agent parameters based on the model type |
|
Run the real placer for one static start area without a simulation. |
|
Position of |
|
Initialize a JuPedSim simulation from a JSON configuration with fallback logic. |
|
Pip install missing packages. |
|
Check if packages is installed. |
|
True when the journeys_v2 path runs; False selects the fallback path. |
Module Contents#
- build_agent_path_state(variant_data: dict[str, Any], journey_key: str | None, transitions: list[dict[str, Any]], direct_steering_info: dict[str, dict[str, Any]], waypoint_routing: dict[str, Any] | None, seed: int, agent_id: int, agent_radius: float = 0.2) dict[str, Any] | None[source]#
Build DS routing state as origin->weighted-next mapping.
- create_agent_parameters(model_type: str, position: tuple, params: dict, global_params=None, journey_id=None, stage_id=None)[source]#
Create appropriate agent parameters based on the model type
- dry_run_static_placement(data: dict[str, Any], walkable_polygon: shapely.geometry.Polygon, dist_id: str, requested_count: int, seed: int) list[tuple[float, float]][source]#
Run the real placer for one static start area without a simulation.
Uses the same spawn area, radius, distances and seed derivation as the run that
initialize_simulation_from_json()performs forseed, so a scenario that passes here places the same agents in the real run. Raises whatever the run would raise (the capacityValueErroror jupedsim’sAgentNumberError).
- fallback_placement_index(data: dict[str, Any], dist_id: str) int[source]#
Position of
dist_idin the fallback path’s distribution list.Mirrors the filter in
_initialize_with_fallback()(a distribution counts when it has at least three coordinates); the fallback placer seeds start areaiwithseed + i.
- initialize_simulation_from_json(json_path: str, simulation: jupedsim.Simulation, walkable_area: pedpy.WalkableArea, seed: int = 42, model_type: str = 'CollisionFreeSpeedModel', global_parameters=None) tuple[dict[str, Any], list[tuple[float, float]], dict[int, float], dict[str, Any]][source]#
Initialize a JuPedSim simulation from a JSON configuration with fallback logic.
- install_if_missing(pip_name: str, import_name: str | None = None)[source]#
Pip install missing packages.
- uses_complete_config(data: dict[str, Any]) bool[source]#
True when the journeys_v2 path runs; False selects the fallback path.
Journey Definition v2 (issue #376) is the only journey path. The fallback runs when no distribution has journeys or a journey is missing altogether.