Spaces:
Runtime error
Runtime error
Download env/intersection_config.py from tokev/traffic-visualizer: direct link, hf CLI and curl.
- Browser
- Download file 1.24 kB
-
https://huggingface.co/spaces/tokev/traffic-visualizer/resolve/main/env/intersection_config.py
- Command line
-
hf download hf://spaces/tokev/traffic-visualizer/env/intersection_config.py
-
curl -L -o intersection_config.py https://huggingface.co/spaces/tokev/traffic-visualizer/resolve/main/env/intersection_config.py
1.24 kB
| from __future__ import annotations | |
| from dataclasses import dataclass | |
| DISTRICT_TYPES: tuple[str, ...] = ( | |
| "residential", | |
| "commercial", | |
| "industrial", | |
| "mixed", | |
| ) | |
| DISTRICT_TYPE_TO_INDEX: dict[str, int] = { | |
| district_type: index for index, district_type in enumerate(DISTRICT_TYPES) | |
| } | |
| DEFAULT_DISTRICT_TYPE = "mixed" | |
| class PhaseConfig: | |
| engine_phase_index: int | |
| available_road_links: tuple[int, ...] | |
| incoming_lanes_served: tuple[str, ...] | |
| outgoing_lanes_served: tuple[str, ...] | |
| class IntersectionConfig: | |
| intersection_id: str | |
| district_id: str | |
| district_type: str | |
| district_type_index: int | |
| incoming_lanes: tuple[str, ...] | |
| outgoing_lanes: tuple[str, ...] | |
| is_boundary: bool | |
| green_phases: tuple[PhaseConfig, ...] | |
| all_phase_indices: tuple[int, ...] | |
| initial_engine_phase_index: int | |
| def num_green_phases(self) -> int: | |
| return len(self.green_phases) | |
| class DistrictConfig: | |
| district_id: str | |
| district_type: str | |
| district_type_index: int | |
| intersection_ids: tuple[str, ...] | |
| neighbor_districts: tuple[str, ...] | |