How 2aa4-w24/a2-rescue-mission-team-110 works
Project Type and Purpose
• This is a Java-based, Maven-built application acting as a “command center” for exploration in the Island game. Its purpose is to interface with the competition arena by processing map files (JSON) and outputting exploration results (JSON, SVG, and transcript logs). A notable detail is that the current strategy “stops exploring as soon as we start” by flying back immediately, so simplicity and safe fallback behavior are key design aspects.
Analysis of the File Structure
• Top-Level Files and Directories:
• Directories like “src/main/java” indicate that the project source is split into logical packages.
• The “maps” directory holds various JSON map files used as input for simulation.
• “outputs” is the destination for generated outputs such as the map image, POI locations, and transcript logs.
• Maven’s “pom.xml” suggests dependency management and standardized build processes.
• Package Structure:
• All Java code is housed under “ca.mcmaster.se2aa4.island.team110”, indicating team-specific implementations.
• The “Aerial” sub-package contains classes like DroneController, DroneHeading, DroneRadar, and DroneScanner—which imply the management of an “aerial” (drone) subsystem that handles scanning or surveying.
• The “Interfaces” package defines abstraction layers (e.g., Controller, JSONResponseParser, Phase, Radar, Scanner) that separate the contract from implementation details, promoting modularity.
• The “Phases” package breaks down various sequential phases (EmergencySite, FindGround, MoveToGround, ReturnHome, iFirstPass, iSecondPass) encapsulating the exploration logic.
• “Records” hold domain-specific data (Battery, Point) used by the functional modules.
• The “Runner” class serves as the entry point or executor that runs the command center when a specific map is passed as an argument.
a. Main Components to Include:
• Command Center (Explorer): Central hub coordinating exploration logic.
• Runner: The driver class that launches the application.
• Aerial Module: Represented by the DroneController and associated classes managing aerial functions (drone heading, radar, and scanner operations).
• Interfaces: Abstract definitions for controllers, phase handling, scanning, and JSON parsing. They indicate the plug-and-play nature of components.
• Phases: Different exploration states (EmergencySite, FindGround, etc.) representing various strategies or behavioral phases during gameplay.
• Data/Configuration Layers: Maps (input JSON), Outputs (results directory) and resource configuration (e.g., log4j2.xml, ruleset.xml).
• External Dependencies: Indicate Maven and potential external libraries/frameworks used (logging framework, JSON parsing libraries).
b. Relationships and Interactions:
• Runner initiates the process by loading a map file from the “maps” directory.
• The Explorer (command center) orchestrates the overall exploration strategy by interacting with the Aerial module and transitioning between the various Phases.
• The Aerial module, interfaced via defined “Interfaces” (e.g., Controller, Scanner, Radar), encapsulates the technical operations such as scanning and radar detection.
• Phases use methods defined in the interfaces to carry out their logic, triggering transitions from one phase to the other (for instance, transitioning from “FindGround” to “ReturnHome”).
• Output generation is done at the end of the exploration, producing files in the “outputs” directory.
c. Architectural Patterns/Design Principles:
• Modular design: Splitting out phases and aerial controls into distinct packages with interfaces.
• Use of Abstraction: Interfaces decouple the implementations from the usage, making it easier to extend or modify functionalities.
• Layered Architecture: Clearly separated modules for input (maps), processing (exploration phases and aerial control), and output (results files).
• Testability: The presence of a comprehensive “src/test” suite hints at unit testing for each significant component.
d. Relevant Technologies:
• Java (main programming language) and Maven (build and dependency management).
• Logging (via log4j2.xml).
• JSON parsing (implied by DefaultJSONResponseParser and JSONResponseParser interfaces).
• SVG generation for map visualization.
Specific Elements
• Clear labels for each component (e.g., “Runner: Application Launcher”, “Explorer: Command Center”).
• Annotations for external resources (e.g., “maps input”, “output files”) and configuration (e.g., “log4j2.xml for logging”).