MCPcopy Create free account
hub / github.com/geekcomputers/Python / __lt__

Method __lt__

8_puzzle.py:20–22  ·  view source on GitHub ↗

For PriorityQueue ordering: compare priorities.

(self, other: "PuzzleState")

Source from the content-addressed store, hash-verified

18 self.previous = previous # Previous state in solution path
19
20 def __lt__(self, other: "PuzzleState") -> bool:
21 """For PriorityQueue ordering: compare priorities."""
22 return self.priority() < other.priority()
23
24 def priority(self) -> int:
25 """A* priority: moves + Manhattan distance."""

Callers

nothing calls this directly

Calls 1

priorityMethod · 0.95

Tested by

no test coverage detected