Kei18 / py-lacam

Minimal Python implementation of LaCAM* for MAPF
https://kei18.github.io/lacam/
MIT License
13 stars 3 forks source link

is it a bug in `get_h_value` funciton? #4

Closed Arseni1919 closed 1 month ago

Arseni1919 commented 1 month ago
    def get_h_value(self, Q: Config) -> int:
        # e.g., \sum_i dist(Q[i], g_i)
        cost = 0
        for agent_idx, loc in enumerate(Q):
            c = self.dist_tables[agent_idx].get(loc)
            if c is None:
                return np.iinfo(np.int32).max
            cost += c
        return 0

the return statement suppose to be: return cost, right?..

Kei18 commented 1 month ago

That’s right.

Just to note, there is no problem with return 0 because it is an admissible heuristic.