dk.deepthought.sidious.planner
Class AStarAlgorithm

java.lang.Object
  extended by dk.deepthought.sidious.planner.AStarAlgorithm
All Implemented Interfaces:
Pathfinder

@ThreadSafe
public class AStarAlgorithm
extends java.lang.Object
implements Pathfinder

Implements the A* search algorithm.

Author:
Deepthought

Field Summary
private  boolean cancelled
          Flag to stop the calculation.
private static org.apache.commons.logging.Log logger
          Logger for this class.
 
Constructor Summary
AStarAlgorithm()
           
 
Method Summary
 void cancel()
          Cancels the search.
private  void jAStar(Graph graph)
          This method implements the A* algorithm.
 void search(Graph graph)
          This is the search algorithm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final org.apache.commons.logging.Log logger
Logger for this class.


cancelled

private volatile boolean cancelled
Flag to stop the calculation.

Constructor Detail

AStarAlgorithm

public AStarAlgorithm()
Method Detail

search

public void search(Graph graph)
Description copied from interface: Pathfinder
This is the search algorithm.

Specified by:
search in interface Pathfinder
Parameters:
graph - the graph to be searched

jAStar

private void jAStar(Graph graph)
This method implements the A* algorithm.

The resulting shortest path is represented in the traversed graph, by following the predecessors from end vertex to start vertex.

Parameters:
graph - the graph to be searched

cancel

public void cancel()
Description copied from interface: Pathfinder
Cancels the search.

Specified by:
cancel in interface Pathfinder


Copyright © Deepthought Development - All Rights Reserved.