Solved CMSC 204 – Project2  Warehouse Order Processing Simulation Fall 2025

$45.00

Original Work ?

Download Details:

  • Name: Project2-fi6yzp.zip
  • Type: zip
  • Size: 4.25 MB

Category: Tags: , , , , You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

Description

5/5 - (1 vote)

In this project, you will simulate a warehouse order processing system using a priority queue and a stack. Orders arrive at the warehouse one per minute and are shipped according to the following rules:

  1. Earliest deadline first (orders must ship before or on their deadline to be on time).
  2. If deadlines are tied, the earliest arrival is shipped first.

Only one order can be shipped per minute. If an order ships after its deadline, it is considered late and must be pushed onto a returns stack for further processing.

This simulation will continue until all orders have been released and shipped.

 

Learning Objectives

 

  • Implement generic priority queue and stack data structures using a regular array as the internal data structure.
  • Apply object-oriented programming principles in a multi-class project.
  • Work with comparators to control ordering in a priority queue.
  • Simulate a time-based event-driven system.
  • Practice unit testing with JUnit.

 

Project Requirements

 

  • The generic priority queue and stack data structures must be implemented using a regular array as the internal data structure. Use of ArrayList, LinkedList, PriorityQueue, or other Java Collections will result in no credit.
  • The simulation starts at minute 0.
  • Each minute:
  1. A single order is released into the system and stamped with the current minute as its arrival time.
  2. The highest-priority order is shipped.
  3. If shipped after its deadline, the order is added to the returns stack.
  • The simulation ends when there are no more orders to release and the priority queue is empty.

 

Provided Classes

You will receive the following starter code:

  • Interfaces
  • PriorityQueueADT<T> – Defines the required priority queue operations.
  • StackADT<T> – Defines the required stack operations.
  • SimulationInterface – Defines the simulation control methods.

 

  • Public JUnit Tests
  • java – Tests the minimum requirements of the project.
  • java – Tests for your priority queue implementation.
  • java – Tests for your stack implementation.
  • java – Tests for your order comparator logic.
  • java – Basic tests for your simulation logic.
  • Mini GUI (provided)

WarehouseSwingApp.java – A small Java Swing GUI that demonstrates the simulation visually.

 

How to change which orders the GUI loads:

Open WarehouseSwingApp.java and edit the createSampleOrders() method. Replace the array contents with your own orders (one order is released per minute in the given array order).

 

Required Classes

 

You must implement:

  1. MyPriorityQueue<T> – Implements PriorityQueueADT<T> using a Comparator<T> for enqueuing orders based on their priority.
  2. MyStack<T> – Implements StackADT<T>.
  3. WarehouseSimulation – Implements SimulationInterface.
  4. Order – Represents a warehouse order with an order id, arrival time and deadline.

With a parameterized constructor to set the order id and deadline, setArrivalMinute, getArrivalMinute and getDeadlineMinute.

  1. OrderComparator – Implements Comparator<Order> to compare orders by deadline, then arrival time.

 

Note: You may add any additional fields/methods to your classes.

 

 

Testing Notes

The provided GFA (Good Faith Attempt) JUnit tests represent the minimum requirements to validate the basic functionality of your project. If the project due date has passed, your submission must pass these tests in order to be considered for course credit.
In addition to the GFA tests, any GUI code and public JUnit tests are provided to assist with basic verification of your implementation. However, these do not cover all functionality. You are expected to design and run additional tests to ensure the full correctness and robustness of your project.

 

 

Sample GUI Run

 

Initial GUI                                                                             After clicking Load Sample button

 

 

 

 

 

 

 

 

 

After Clicking Auto Run, you should see logs similar to:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Deliverables

 

Before submitting your project, ensure your code is free of syntax errors. Submissions that do not compile will receive zero points.

 

Design Documents UML and/or Pseudo-Code

 

Implementation Only submit files that you have created or modified, do not submit unmodified files that were provided in the project download. Place all your .java files inside a src folder. Include the entire doc folder with Javadoc for your own classes.

 

Summary Write-Up A 2-3 paragraph write-up (eg.LearningExperience.doc)

 

Submission Packaging

You will submit two compressed .zip files:

Main Project Files All student created or modified project files and data:

Filename LastNameFirstName_AssignmentX.zip

src/ directory containing .java files created or modified by the student

doc/ directory containing student created Javadoc files

LearningExperience.doc reflection and write-up

Design Documents all design related documents

 

MOSS files Only the student created or modified source code files

Filename LastNameFirstName_AssignmentX_Moss.zip

source files only the .java files created or modified by the student

 

Grading Rubric

Criteria Points
Priority Queue Implementation 35%
Stack Implementation 25%
Order and Comparator Implementation 10%
Simulation Implementation 30%
JUnit student-written tests -5%
Design and Reflection write-up -10%
Code style, documentation, and Javadoc (If not provided). -5%