This project uses a Neural Network (NN) called ShipTrainer, to control a spaceship navigating through a scrolling tunnel autonomously. The main goal is for the NN to keep the ship flying without hitting the tunnel walls for at least 30 seconds, showcasing effective AI control of the ship.
The following is a step by step guide on how you can clone this repository down on to your own machine and get it running. Please ensure you have the following prerequisites installed before continuing.
Installation of git
Installation of Java Development Kit JDK (version 17+)
In order to clone the github repository, use the following command:
git clone https://github.com/The-Mad-Ryanosaurus/Neural-Network.git
The HTTP link can be found in the green code button at the top of this page also, under the HTTPS tab.
Add the following aicme4j.jar file to the projects root directory.
Download the aicme4j.jar here
Once that is done, do the following command, also in the root directory of the project, to create an ai.jar:
jar –cf ai.jar *
In the terminal in the root directory of the project do the following command:
Windows
javac -cp ".;aicme4j.jar;ai.jar" src\ie\atu\sw\*.java
Mac/Linux
javac -cp ".:aicme4j.jar:ai.jar" src/ie/atu/sw/*.java
This command does the following:
- cp ".;aicme4j.jar;ai.jar" || ".:aicme4j.jar:ai.jar" sets the classpath to include the current directory (.), as well as the aicme4j.jar and ai.jar files. These are necessary as the Java files depend on classes and libraries contained within these JAR files. src\ie\atu\sw*.java tells the Java compiler (javac) to compile all .java files located in the src\ie\atu\sw\ directory.
In the same terminal window as before, do the following:
Windows
java -cp ".;src;aicme4j.jar;ai.jar" ie.atu.sw.Runner
Mac/Linux
java -cp ".:src:aicme4j.jar:ai.jar" ie.atu.sw.Runner
This command sets the classpath to include the compiled classes in the src directory, as well as the external JARs, and then runs the Runner class.