File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
PathPlanning/TimeBasedPathPlanning Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -48,13 +48,17 @@ def __lt__(self, other: object):
4848 return NotImplementedError (f"Cannot compare Node with object of type: { type (other )} " )
4949 return (self .time + self .heuristic ) < (other .time + other .heuristic )
5050
51+ """
52+ Note: cost and heuristic are not included in eq or hash, since they will always be the same
53+ for a given (position, time) pair. Including either cost or heuristic would be redundant.
54+ """
5155 def __eq__ (self , other : object ):
5256 if not isinstance (other , Node ):
5357 return NotImplementedError (f"Cannot compare Node with object of type: { type (other )} " )
5458 return self .position == other .position and self .time == other .time
5559
5660 def __hash__ (self ):
57- return hash ((self .position , self .time , self . heuristic ))
61+ return hash ((self .position , self .time ))
5862
5963class NodePath :
6064 path : list [Node ]
You can’t perform that action at this time.
0 commit comments