from dataclasses import dataclass
from typing import List
from dataclasses import field

@dataclass
class RoadConfig:
    name: str
    enabled: bool = True
    vehicles: int = 50
    min_speed: float = 20.0
    max_speed: float = 50.0
    forward_lanes: list[int] = field(default_factory=lambda: [1])
    backward_lanes: list[int] = field(default_factory=lambda: [2])

@dataclass
class SimulationPlan:
    configs: List[RoadConfig]

    def enabled_roads(self) -> List[str]:
        return [c.name for c in self.configs if c.enabled and c.vehicles > 0]

