How majiro-dev/avaj-launcher works
Project Identification
• Project Type: A Java-based aircraft simulation program.
• Purpose: To simulate the behavior of various aircraft (balloon, jet, and helicopter) under dynamic weather conditions using object-oriented design and design patterns.
Main Components
a. Input/Output:
• Input: Scenario files (located in the "scenarios" directory) which define simulation parameters.
• Output: Simulation logs written to "simulation.txt" (generated by the application).
b. Core Simulation Engine (Launcher):
• The Launcher class (in sources/Launcher.java) acts as the entry point that initializes the simulation.
c. Aircraft and Weather Elements:
• Aircraft Entities: Represented by classes like Aircraft, Baloon, Helicopter, and JetPlane. All implement the Flyable interface.
• Weather Tower: Managed through WeatherTower (in sources/WeatherTower.java) that interacts with aircraft; the WeatherTower uses the Observer pattern to notify aircraft of weather changes.
• Tower: This might serve as a base or manager for controlling aircraft notifications.
• Weather Provider: A singleton pattern component (in sources/WeatherProvider.java) that gives the current weather conditions.
d. Factory and Design Patterns:
• AircraftFactory (in sources/AircraftFactory.java): Implements the Factory pattern for creating various types of aircraft.
• The Observer pattern is used between the WeatherTower and each aircraft implementing Flyable.
• The Singleton pattern is applied in the WeatherProvider and possibly in the factory to ensure central control.
e. Supporting Data Structures:
• Coordinates (in sources/Coordinates.java): Likely used to store and manage positions for aircraft.
Relationships and Flow
• The created aircraft (Baloon, Helicopter, JetPlane) register themselves with the WeatherTower (via the Observer pattern).
• WeatherTower, which relies on a WeatherProvider (Singleton), periodically updates the weather.
• The simulation results are logged, showing interactions and status updates in an output file.