Since then, all of the improvements were about GUI, adding load maze property and fixing bugs. As a GUI, I added radio button set which is used to replace starting and destination nodes and put obstacles.
After making some tests on the map, I encountered a problem. Since the algorithm can spread on every direction, the scenarios like in the image can create unwanted situations. Technically speaking, this is caused by diagonal search of neighbor nodes.
To avoid that, I added a radio button which enables and disables diagonal movement. Here is the new result of the same scenario. In this case, neighbor search is done only horizontal and vertical directions.
Other than these, I wanted to add an extra property which is loading maze to the map. With it, users can choose predefined mazes according to their difficulties. These are easy maze, medium maze, hard maze and dead-end maze. To do this, I used the idea of tile maps. I created txt files which includes numbers which are 0, 1, 2 and 3. Each of the numbers has its own node type. 0's are the normal nodes, 1 is the starting node, 2 is the destination node and 3's are the obstacle nodes.
0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 3 0 0 0 0 0 0
0 0 0 0 0 3 0 0 0 0 0 0
0 0 0 0 0 3 0 0 0 0 2 0
0 0 0 0 0 3 0 0 0 0 0 0
This is an example of a txt file that includes nodes' information.
On the Java side, I'm going through all numbers in the file with two for loops and prepare the new state of the nodes according to the number that is read from the file.
And of course images of the program:
You can download the executable jar here. Loading maze is not working in this version. Because it is using another folder which has maze files.
Before finishing the post I would like to share the links that gave me idea about how I should set up the GUI and choose colors.
http://www.ccg.leeds.ac.uk/people/j.macgill/xaStar/
http://www.youtube.com/watch?v=FNRfSQDF7TA