forked from JenJenChung/RAGS
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCompareNode.h
More file actions
28 lines (26 loc) · 768 Bytes
/
CompareNode.h
File metadata and controls
28 lines (26 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef COMPARE_NODE_H_
#define COMPARE_NODE_H_
// Node comparison class
class CompareNode
{
public:
bool operator() (const Node * n1, const Node * n2) const
{
// switch (SEARCH_TYPE)
// {
// case BREADTH:
// return (n1->GetDepth() > n2->GetDepth()) ;
// default:
double n1Cost = n1->GetMeanCost() + n1->GetHeuristic() ;
double n2Cost = n2->GetMeanCost() + n2->GetHeuristic() ;
return (n1Cost >= n2Cost && n1->GetSigCost() >= n2->GetSigCost()) ;
// if (n1Cost > n2Cost && n1->GetSigCost() > n2->GetSigCost())
// return true ;
// else if (n2Cost > n1Cost && n2->GetSigCost() > n1->GetSigCost())
// return false ;
// else
// return (n1Cost > n2Cost) ;
// }
}
} ;
#endif // COMPARE_NODE_H_