Skip to content

Parcel Tracker is a JavaFX application designed to simulate a logistics and delivery network. The application visualizes processing facilities on a map, manages the routing of various parcel types (Standard, Tracked, and Medical), and calculates delivery costs based on specific criteria.

Notifications You must be signed in to change notification settings

aliy112005/Parcel-Tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Parcel Tracker Simulation

Overview

Parcel Tracker is a JavaFX application designed to simulate a logistics and delivery network. The application visualizes processing facilities on a map, manages the routing of various parcel types (Standard, Tracked, and Medical), and calculates delivery costs based on specific criteria. It features an animated graphical user interface (GUI) to demonstrate the movement of parcels between facilities.

Features

  • Visual Simulation: Graphical representation of processing facilities and the connections (paths) between them.
  • Animated Deliveries: Specific animations showing parcels moving from sender to recipient across the network.
  • Parcel Prioritization: A priority stack system that processes parcels in a specific order:
    1. Medical Parcels (High Priority)
    2. Tracked Parcels (Medium Priority)
    3. Standard Parcels (Low Priority)
  • Cost Calculation: Dynamic pricing logic based on parcel type:
    • Standard: Based on weight (kg).
    • Tracked: Based on the number of hops/locations visited.
    • Medical: Based on biohazard level.
  • Receipt Generation: Outputs a text file (receipts.txt) summarizing processed deliveries.

Project Structure

Core Logic (org.example.coursework2)

  • Display.java: The main entry point of the application. It handles the JavaFX GUI, animations, and user interaction (buttons).
  • Data.java: Manages data persistence. It reads configuration files (txt and csv), initializes the network map, and sorts parcels into the processing stack.
  • ProcessingFacility.java: Represents a node in the delivery network with X/Y coordinates and a list of neighbor connections.

Parcel Types

  • Parcel.java: The abstract base class defining common attributes (sender, recipient, ID, price).
  • MedicalParcel.java: Handles high-priority biohazard materials. Price increases with biohazard level.
  • TrackedParcel.java: Maintains a history of locations visited. Price increases based on distance/hops.
  • StandardParcel.java: Basic delivery items. Price is calculated based on weight (kg).

Prerequisites

To run this project, you need:

  • Java Development Kit (JDK): Version 17 or higher.
  • JavaFX SDK: Included in the module path.
  • Build Tool: Maven or Gradle (recommended).

Dependencies

This project requires the following libraries defined in module-info.java:

  • javafx.controls, javafx.fxml, javafx.web
  • org.controlsfx.controls
  • com.dlsc.formsfx
  • net.synedra.validatorfx
  • org.kordamp.ikonli.javafx
  • org.kordamp.bootstrapfx.core
  • eu.hansolo.tilesfx
  • com.almasb.fxgl.all

Installation and Setup

  1. Clone the repository:
    git clone <repository-url>
  2. Open in an IDE: IntelliJ IDEA or Eclipse is recommended.
  3. Configure Dependencies: Ensure Maven/Gradle downloads the required libraries listed above.
  4. Data Files: Ensure the following files exist in the root project directory (see Data File Formats below).

Usage

  1. Run the Application: Execute the main method in Display.java.
  2. Control Panel:
    • Start Deliveries / Next Delivery: Click this button to animate the processing of the next parcel in the stack.
    • Print Receipts: Generates a summary of all processed parcels into a text file.
  3. Visualization: Watch as parcel icons (boxes, medical kits, pins) travel along the blue lines connecting the facilities.

Data File Formats

The application relies on three specific text files in the root directory to initialize the simulation.

1. processingFacilities.txt

Defines the coordinates of the facilities.

  • Format: X_Coordinate Y_Coordinate
  • Example:
    50 50
    200 100
    400 300
    

2. connections.txt

Defines the paths between facilities using their generated addresses. Note: Addresses are generated as X<x_coord>Y<y_coord>.

  • Format: Facility1_Address Facility2_Address
  • Example:
    X50Y50 X200Y100
    X200Y100 X400Y300
    

3. parcels.csv

Defines the parcels to be delivered. The format varies by parcel type.

  • Format: SenderAddress,RecipientAddress,Type,ExtraInfo
  • Examples:
    • Standard: X50Y50,X400Y300,Standard,2.5 (Last value is Weight)
    • Medical: X200Y100,X50Y50,Medical,2 (Last value is Biohazard Level)
    • Tracked: X50Y50,X400Y300,Tracked, (Or simply Sender,Recipient)

Outputs

  • receipts.txt: Created after clicking "Print Receipts". It contains details such as Parcel ID, Type, Price, and specific attributes (Weight, Biohazard Level, etc.).

Author

aliy112005 Coursework Project

About

Parcel Tracker is a JavaFX application designed to simulate a logistics and delivery network. The application visualizes processing facilities on a map, manages the routing of various parcel types (Standard, Tracked, and Medical), and calculates delivery costs based on specific criteria.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages