How dpasca/nnlander works
Project Type and Purpose
• This is a simulation/game project that demonstrates different implementations of neural networks for controlling a lunar lander.
• The README clearly explains that the workshop covers concepts of control systems and neural networks, progressively evolving from manual control (Lander01) to advanced training tasks such as genetic algorithms (Lander04) and reinforcement learning (Lander05).
File Structure
• The top-level includes configuration files (CMakeLists.txt, build scripts), documentation (README files), and workshop requirements.
• The Common folder holds shared components such as Simulation, UI drawing, neural network implementations, and utility functions.
• Several directories (Lander01 through Lander05) are dedicated to different versions of the lunar lander application:
• Lander01: manual control.
• Lander02: basic neural network implementation.
• Lander03: improved neural network with a random training task.
• Lander04: advanced neural network using a genetic algorithm training task.
• Lander05: uses reinforcement learning (REINFORCE-ES) for training.
a. Components:
• Simulation Engine: Represented by components in Common/Simulation.h and SimulationDisplay.h that manage physics, game logic, and rendering.
• Neural Network Components: Represented by Common/SimpleNeuralNet.h along with the specialized training task files in Lander03 (TrainingTaskRandom.h), Lander04 (TrainingTaskGA.h), and Lander05 (TrainingTaskRES.h).
• User Interface / Input Handling: Captured in Common/DrawUI.h and integrated into each LanderXX main program.
• Individual Lander Variants: Each LanderXX directory contains its own main program that ties simulation, neural network, and task-specific logic together.
b. Relationships & Interactions:
• The Common library provides shared functionalities (simulation, UI, neural networks) that are imported by each Lander variant.
• Each variant (Lander01 through Lander05) compiles into an executable where the main loop interacts with the simulation engine and, depending on the variant, applies either manual controls or neural network-based control strategies.
• Data flows from user input or simulation state into the neural network modules (or training algorithms) and then back into simulation (for example, adjusting thrust).
c. Architectural Patterns & Design Principles:
• Modular design: Separation of concerns is evident since shared functionality is isolated in the Common directory.
• Progressive enhancement: Each Lander variant builds upon a common base but adds specific training or control strategies.
• Use of CMake for build management: Indicates a standard configuration-driven build process.
d. Relevant Technologies & Frameworks:
• C++20 standard, CMake (for build configuration), possibly Raylib (as mentioned for fetching visuals/graphics), and custom implementations of Neural Networks, Genetic Algorithms, and Reinforce-ES training.
Specific Elements
• Each major component should have a clear label:
Additional Detail Suggestions
• CMake invoking build scripts (build.sh/build.bat) and generating executables.
• How each Lander variant is independent but shares core simulation and neural network logic which emphasizes modularity.
• The layer structure (Common library vs. variant implementations)
• The relationship between simulation, control logic, and rendering
• The progression of different control methodologies across Lander01 to Lander05.