Пример #1
0
 /**
  * @param NodeInterface $goal
  * @param NodeInterface $current
  * @return number
  */
 protected function getHeuristic(NodeInterface $goal, NodeInterface $current)
 {
     return abs($goal->getX() - $current->getX()) + abs($goal->getY() - $current->getY());
 }
Пример #2
0
 /**
  * @param NodeInterface $node
  * @return string
  */
 protected function hash(NodeInterface $node)
 {
     return md5($node->getX() . "," . $node->getY());
 }