Smart Rocket is a Javascript demonstration portraying a simple version of computer machine learning, which is handled in canvas. Through multiple attempts, the computer is able to determine the shortest path to reach the target. Rockets send out multiple subrockets every time it collides with the barrier. This process is repeated until a rocket finally finds the target. The new rounds begins with the smart rocket that follows the path to reach the target and the smart rocket keeps taking the path of the shortest rocket before it.
View the live demo!
Smart rocket is designed to determine the shortest distance from the starting position to the target.
The demonstration has three major components: target, barriers, and rockets:
Located at the top of the model, the target explodes once a rocket has reached it.
Position between the starting point of the rockets and the target, the barriers prevent the rockets from reaching the target.
Rockets are shot from the opposite side of the target and has the goal of eventually reaching the target. They bounce from the barriers until a rocket has reached the target. Once the rocket reaches a target, a copy of that rocket trajectory is saved for the next test.
Each Rocket has a constant velocity. The subrocket velocities are given random directional vectors, which results to a unique path every single cycle.
The main focus for this project is the use of collision detection. The rockets need to be aware of its position and have an opposite vector depending on where the rocket collides with either the barrier or boundary.
The smart rocket is delineated as the red rocket with the white border. This shows the most efficient trajectory that the computer found so far to reach the target. This efficiency is calculated by the shorted time required in order to reach the target.