Refactor routing internals and archive retry benchmarks
This commit is contained in:
parent
a8720ac8c9
commit
ea5cfe7f31
1 changed files with 3481 additions and 2583 deletions
|
|
@ -9,7 +9,7 @@ from inire.constants import TOLERANCE_LINEAR
|
|||
from inire.model import ObjectiveWeights
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from collections.abc import Sequence
|
||||
from collections.abc import Iterable, Mapping, Sequence
|
||||
from typing import Protocol
|
||||
|
||||
from inire.geometry.collision import RoutingWorld
|
||||
|
|
@ -26,6 +26,10 @@ if TYPE_CHECKING:
|
|||
def move_type(self) -> MoveKind: ...
|
||||
|
||||
|
||||
def weighted_path_length(path: Iterable[ScoreableMove], weights: Mapping[MoveKind, float]) -> float:
|
||||
return sum(component.length * weights[component.move_type] for component in path)
|
||||
|
||||
|
||||
class CostEvaluator:
|
||||
__slots__ = (
|
||||
"collision_engine",
|
||||
|
|
|
|||
Loading…
Reference in a new issue