From 2409ca3131b63b89ef5a5be68353934e88a68296 Mon Sep 17 00:00:00 2001 From: LunnosMp4 Date: Tue, 4 Jul 2023 19:40:40 +0200 Subject: [PATCH 1/2] Fix build error, warning, Change Readme --- README.md | 35 ++++++++++++++++++++++++++++++++++- include/dna.hpp | 2 ++ include/stadium.hpp | 4 ++-- 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a573841..801688e 100644 --- a/README.md +++ b/README.md @@ -1 +1,34 @@ -# AutoRocket \ No newline at end of file +# AutoRocket + +This is a project that uses genetic algorithms to train rockets to reach a target. + +# Installation + +## Prerequisites + +In order to compile this project you will need to: + +- have SFML installed on your system. If you don't know how to do it see this link. +- have CMake installed + +## Compilation + +Then you can clone this repository and run the following commands: + +```bash +mkdir build +cd build +cmake .. +make +``` + +# Commands + +|Command|Action| +|-------|------| +|`E`|Toggle full speed| +|`M`|Toggle manual control| +|`S`|Toggle show just one rocket| +|`N`|Toggle draw neural network| +|`D`|Toggle draw rockets| +|`F`|Toggle draw fitness| \ No newline at end of file diff --git a/include/dna.hpp b/include/dna.hpp index 34dbd4c..097fecb 100644 --- a/include/dna.hpp +++ b/include/dna.hpp @@ -3,7 +3,9 @@ #include #include #include +#include #include "number_generator.hpp" +#include "utils.hpp" constexpr float MAX_RANGE = 10.0f; diff --git a/include/stadium.hpp b/include/stadium.hpp index 6bc5f82..b2d6878 100644 --- a/include/stadium.hpp +++ b/include/stadium.hpp @@ -127,8 +127,8 @@ struct Stadium to_target.y, r.velocity.x * dt, r.velocity.y * dt, - cos(r.angle), - sin(r.angle), + static_cast(cos(r.angle)), + static_cast(sin(r.angle)), r.angular_velocity * dt }; // The actual update From 168d5269d9580c4006d4ab05cfacc0e6dad81df6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Tisseyre?= <86684911+LunnosMp4@users.noreply.github.com> Date: Tue, 4 Jul 2023 19:44:00 +0200 Subject: [PATCH 2/2] Update README.md --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 801688e..9efc707 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,13 @@ This is a project that uses genetic algorithms to train rockets to reach a targe # Installation -## Prerequisites +## Prerequisites In order to compile this project you will need to: + - have [SFML](https://www.sfml-dev.org/index.php) installed on your system. If you don't know how to do it see [this link](https://www.sfml-dev.org/tutorials/2.5/#getting-started). + - have [CMake](https://cmake.org/) installed -- have SFML installed on your system. If you don't know how to do it see this link. -- have CMake installed - -## Compilation +## Compilation Then you can clone this repository and run the following commands: @@ -31,4 +30,4 @@ make |`S`|Toggle show just one rocket| |`N`|Toggle draw neural network| |`D`|Toggle draw rockets| -|`F`|Toggle draw fitness| \ No newline at end of file +|`F`|Toggle draw fitness|