This applet requires Java 1.3 or higher.
The aim of this project was to create a simulation of two moving vehicles that will avoid colliding.
The simulation exists in a two dimensional real co-ordinate system. This means that the vehicles are able to move in any direction and do not snap to a grid position. In a grid system the vehicles can only move to a spare grid slot around them. However, in a real co-ordinate system there are an infinite number of places to move to in your vicinity.
I have been working on solving this problem since it arose during the development of YARTS. At that time I was trying to make a reactive decision; once a predicted collision was detected then try and avoid it.
This new solution predicts the path to the target and if there is a collision then it will avoid it. This approach can only be taken in a situation where all the information is known about the system. For example in RTS games the world is completely known and the only variable is the user interaction, but the user can only move a vehicle in the way the game lets them. So everytime the user moves a vehicle (in a legal move) then the system recalculates the predicted positions and paths.
The results of my project can be seen above. The speed is set as a constant so that once the vehicles reach their target they do not stop but continue travelling in circles. This further demonstrates the collision avoidance system. If you set the targets of both vehicles to the same position, they will travel in circles avoiding each other.
However, there are two ways of making them crash:
This is still work in progress but as I am going on holiday soon it will have to take a back seat till the other 101 things in my life are sorted.