Class: Astar::ManhattenDistance
- Defined in:
- lib/astar/heuristic/manhatten_distance.rb
Instance Method Summary collapse
Methods inherited from Heuristic
Instance Method Details
#score ⇒ Object
3 4 5 6 7 |
# File 'lib/astar/heuristic/manhatten_distance.rb', line 3 def score f = relative_to_parent g = (@node.destination.x - @node.x).abs + (@node.destination.y - @node.y).abs f + g end |