Skip to content

nestchao/Pilots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Malaysia Airlines Flight Network

This is a command-line application that allows users to manage and search for flight routes within Malaysia. Users can add or remove airports and flight routes, view the entire flight network, and find the shortest flight path between two airports.

Features

  • View Airports: Display a list of all available airports.
  • Manage Airports: Add or remove airports (vertices) from the network.
  • Manage Routes: Add or remove flight routes (edges) between airports.
  • Find Shortest Path: Utilizes Breadth-First Search (BFS) to find the shortest flight path between two selected airports.
  • Search Routes: Search for all available flight routes from a specific airport.

Getting Started

Prerequisites

Installation

  1. Download and Extract the Project Zip File: Right-click the zip file and select Extract All (Windows) or Extract Here (Linux/macOS). After extraction, you will see an additional folder created (DSA_ASSIGNEMENT/DSA_ASSIGNEMENT/). Open the inner folder that contains src/, Json/, and lib/ directories. This is the correct project root.

  2. Open in Visual Studio Code: Open VS Code Go to File → Open Folder. Select the extracted folder that directly contains the src/ folder.

Configuration

The project is pre-configured to run in Visual Studio Code. The launch.json file is set up to launch the application.

The project uses the gson-2.13.1.jar library for JSON data handling, which is located in the lib/ directory. Make sure your VS Code Java project settings correctly reference this library.

Manual Library Configuration

If the library is not automatically detected, you can manually configure it by following these steps:

  1. Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on macOS).

  2. Type "Explorer: Focus on Java Projects View" and select it.

  3. In the "Referenced Libraries" section, click the "Add" button.

  4. Navigate to the lib/ directory and select the gson-2.13.1.jar file.

  5. This will add the library to your project's classpath. You should see an entry in your .vscode/settings.json file similar to this:

    "java.project.referencedLibraries": [
        "lib/gson-2.13.1.jar"
    ]

Usage

  1. Run the application by opening the src/Main.java file and pressing F5 or by using the "Run and Debug" panel in VS Code.

  2. The main menu will be displayed in the terminal, providing the following options:

    • [1] Create Graph: Allows you to add or remove airports and flight routes.
    • [2] Search for an Airport: Lets you search for all available routes from a specific airport.
    • [3] View Malaysia Flight Network: Finds and displays the shortest path between two airports.
    • [0] Exit: Exits the application.

Data

The flight route data is stored in Json/route.json. This file contains a map of airports and their direct connections. The application reads from and writes to this file to manage the flight network.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages