MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / __init__

Method __init__

graphs/greedy_best_first.py:56–72  ·  view source on GitHub ↗
(
        self,
        pos_x: int,
        pos_y: int,
        goal_x: int,
        goal_y: int,
        g_cost: float,
        parent: Node | None,
    )

Source from the content-addressed store, hash-verified

54 """
55
56 def __init__(
57 self,
58 pos_x: int,
59 pos_y: int,
60 goal_x: int,
61 goal_y: int,
62 g_cost: float,
63 parent: Node | None,
64 ):
65 self.pos_x = pos_x
66 self.pos_y = pos_y
67 self.pos = (pos_y, pos_x)
68 self.goal_x = goal_x
69 self.goal_y = goal_y
70 self.g_cost = g_cost
71 self.parent = parent
72 self.f_cost = self.calculate_heuristic()
73
74 def calculate_heuristic(self) -> float:
75 """

Callers

nothing calls this directly

Calls 1

calculate_heuristicMethod · 0.95

Tested by

no test coverage detected