Symphony
1.0
Loading...
Searching...
No Matches
utils.cpp
Go to the documentation of this file.
1
//
2
// Created by velocitatem on 12/15/24.
3
//
4
5
6
#include "
search.h
"
7
8
// node copmarator for priority queue
9
class
NodeComparator
{
10
public
:
11
bool
operator()
(
const
std::shared_ptr<Node> &a,
const
std::shared_ptr<Node> &b) {
12
if
(!a || !b) {
13
throw
std::invalid_argument(
"Null node pointer in comparison"
);
14
}
15
return
a->path_cost + a->heuristic > b->path_cost + b->heuristic;
16
}
17
};
18
NodeComparator
Definition
utils.cpp:9
NodeComparator::operator()
bool operator()(const std::shared_ptr< Node > &a, const std::shared_ptr< Node > &b)
Definition
utils.cpp:11
search.h
src
utils.cpp
Generated on Mon Jan 13 2025 12:40:41 for Symphony by
1.9.8