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