This Java applications let you play around with an Agent that uses simpe artificial intelligence to help him navigate through a somewhat complicated tiled-based map. The AI that the Agent used for pathfinding is an A* search algorithm. You can think of the whole map as a huge search tree with each map tile as a node in the tree. An A* search is an informed search algorithm that utilizes a cost function and a heuristic function to determine which node to be considered next in order to expand the search tree towards the goal. Cost function of Node N calculates the actual cost of path from the starting node to Node N. Whereas the heuristic function of node N will return the estimated cost from node N to the goal. A* search algorithm is a complete and yet optimally efficient search algorithm. Meaning that, given there are finite number of nodes in the search tree, it will always returns an optimal solution (either a shortest cost path, or no solution if the goal is not exist or unreachable) with the minimum nodes expansion. With this properties, it makes a perfect solution for applications that required automated pathfinding on a big domain.
How to run the program:
- Download the Java archive of the application here.
- You need to have Java Runtime version 1.3 or above installed on your PC.
- Double click on the Java archive path_finder.jar that you have downloaded.
- If it fails to run, you need to execute it in Command Prompt / Console. Go to the directory where your download is saved. Type java -jar path_finder.jar
Instructions:
- Green areas are trek-able path, brown areas are obstacles, grey areas are preferred path.
- Left click on any trek-able areas to move the Agent. The Agent will complain if the designated position is unreachable.
- SHIFT + Left Click: to place or remove an obstacle on the path.
- SHIFT + Double Left Click: to clear all obstacles in the map.
- SHIFT + Triple Left Click: to placed the specified percentage of obstacles randomly on the map.
- CTRL + Left Click: to place or remove a preferred path.
This program let you experiment with the following:
- The pattern of A* search in a pathfinding application.