Improve automatic routing retries and reuse component geometry
Try verified perimeter construction early and reuse probe routes as movable hints during lookahead. Batch collision checks and cache component generation for repeated placement and refinement candidates.
This commit is contained in:
parent
9e41c1abf8
commit
ed52ea6ffd
1 changed files with 160 additions and 55 deletions
|
|
@ -31,6 +31,7 @@ if TYPE_CHECKING:
|
|||
from inire.model import RoutingOptions, RoutingProblem
|
||||
from inire.results import RoutingResult
|
||||
from inire.router._routing_policy import Trial
|
||||
from inire.seeds import PathSeed
|
||||
from inire.tests.routing_benchmark_case import BenchmarkCase
|
||||
|
||||
|
||||
|
|
@ -85,14 +86,14 @@ class _RetryExperiment(_AutomaticRun):
|
|||
options = replace(self.options, refinement=replace(self.options.refinement, enabled=False))
|
||||
trials.extend(self._widen_residual(options, retained, limit, target, policy="late-bounded-residual", check_connectivity=True))
|
||||
|
||||
def _direct(self, options: RoutingOptions, policy: str) -> list[Trial]:
|
||||
def _direct(self, options: RoutingOptions, policy: str, *, hints: dict[str, PathSeed] | None = None) -> list[Trial]:
|
||||
cap = self.retry_policy.probe_iterations
|
||||
if policy == "direct-probe-near-port" and cap is not None:
|
||||
configured = self.options.congestion.max_iterations
|
||||
iterations = configured if cap == "configured" else min(configured, cap)
|
||||
if iterations != options.congestion.max_iterations:
|
||||
options = replace(options, congestion=replace(options.congestion, max_iterations=iterations))
|
||||
return super()._direct(options, policy)
|
||||
return super()._direct(options, policy, hints=hints)
|
||||
|
||||
def _seed_recovery_trials(self, options: RoutingOptions, trials: list[Trial], target: int) -> None:
|
||||
limit = self.retry_policy.lattice_limit
|
||||
|
|
|
|||
Loading…
Reference in a new issue