pathfinder
Class RandomPathFinder

java.lang.Object
  extended by pathfinder.JPathFinder
      extended by pathfinder.RandomPathFinder

public class RandomPathFinder
extends JPathFinder

An example class that runs random path search (without any memory) instead of any requested search


Constructor Summary
RandomPathFinder()
           
 
Method Summary
static void main(java.lang.String[] args)
           
 void performBFS(int start, int stop, JPFMap map)
          implements the breadth first search (performBFS) path search - searches a road from given start to target city
 void performDFS(int start, int stop, JPFMap map)
          implements the depth first search (performDFS) path search - searches a road from given start to target city
 void performRandomSearch(int start, int stop, JPFMap map)
          implements the random path search - searches a road from given start to target city but does not display the correct path (uses no memory)
 void searchForShortestPath(int start, int stop, JPFMap map)
          implements the A* path search - searches shortest road from given start to target city
 void searchForShortestTime(int start, int stop, JPFMap map)
          implements the A* path search - searches fastest road from given start to target city
 
Methods inherited from class pathfinder.JPathFinder
clearInfoArea, inform, setInformationArea, showGUI, showGUI, showGUI, showGUI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomPathFinder

public RandomPathFinder()
Method Detail

performRandomSearch

public void performRandomSearch(int start,
                                int stop,
                                JPFMap map)
implements the random path search - searches a road from given start to target city but does not display the correct path (uses no memory)

Parameters:
start - id of starting city
stop - id of target city
map - the map to be searched

performDFS

public void performDFS(int start,
                       int stop,
                       JPFMap map)
Description copied from class: JPathFinder
implements the depth first search (performDFS) path search - searches a road from given start to target city

Specified by:
performDFS in class JPathFinder
Parameters:
start - id of starting city
stop - id of target city
map - the map to be searched

performBFS

public void performBFS(int start,
                       int stop,
                       JPFMap map)
Description copied from class: JPathFinder
implements the breadth first search (performBFS) path search - searches a road from given start to target city

Specified by:
performBFS in class JPathFinder
Parameters:
start - id of starting city
stop - id of target city
map - the map to be searched

searchForShortestPath

public void searchForShortestPath(int start,
                                  int stop,
                                  JPFMap map)
Description copied from class: JPathFinder
implements the A* path search - searches shortest road from given start to target city

Specified by:
searchForShortestPath in class JPathFinder
Parameters:
start - id of starting city
stop - id of target city
map - the map to be searched

searchForShortestTime

public void searchForShortestTime(int start,
                                  int stop,
                                  JPFMap map)
Description copied from class: JPathFinder
implements the A* path search - searches fastest road from given start to target city

Specified by:
searchForShortestTime in class JPathFinder
Parameters:
start - id of starting city
stop - id of target city
map - the map to be searched

main

public static void main(java.lang.String[] args)
Parameters:
args - the command line arguments