40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass, field
|
|
from typing import Literal, Any
|
|
|
|
|
|
VisibilityGuidanceMode = Literal["off", "exact_corner", "tangent_corner"]
|
|
|
|
|
|
|
|
@dataclass
|
|
class RouterConfig:
|
|
"""Configuration parameters for the A* Router."""
|
|
|
|
node_limit: int = 1000000
|
|
max_straight_length: float = 2000.0
|
|
min_straight_length: float = 5.0
|
|
|
|
sbend_offsets: list[float] | None = None
|
|
|
|
bend_radii: list[float] = field(default_factory=lambda: [50.0, 100.0])
|
|
sbend_radii: list[float] = field(default_factory=lambda: [10.0])
|
|
snap_to_target_dist: float = 1000.0
|
|
bend_penalty: float = 250.0
|
|
sbend_penalty: float = 500.0
|
|
bend_collision_type: Literal["arc", "bbox", "clipped_bbox"] | Any = "arc"
|
|
bend_clip_margin: float = 10.0
|
|
visibility_guidance: VisibilityGuidanceMode = "tangent_corner"
|
|
|
|
|
|
@dataclass
|
|
class CostConfig:
|
|
"""Configuration parameters for the Cost Evaluator."""
|
|
|
|
unit_length_cost: float = 1.0
|
|
greedy_h_weight: float = 1.5
|
|
congestion_penalty: float = 10000.0
|
|
bend_penalty: float = 250.0
|
|
sbend_penalty: float = 500.0
|
|
min_bend_radius: float = 50.0
|