COMP 2100 Project 3: Queuing System Simulation

Fall 2015

PHASE 1 : Develop and test the event classes and interface

Due: in lab, Thursday 22 October 2015
20 points

PHASE 1 : Develop and Test the event classes and interface

A complex project like this needs to be developed in phases. In the first phase, you will define the event classes and interface and test them using a provided test driver.

Implementation Notes

  1. Here are links to the APIs of the event-related classes: Event, AbstractEvent, ArrivalEvent, DepartureEvent, SimulationReportEvent, and SimulationEndEvent You need to develop all of these from scratch based on their specifications. The priority associated with each type of event is specified by the static fields defined in the Event interface. Outside of the Event interface, you must refer to priorities using these identifiers, not their numeric values.
  2. AbstractEvent does not declare any abstract methods. However it does not declare or define the process() method from Event, thus it is abstract. It does however have a protected constructor that will be used by its subclasses (see next note). It's compareTo() method is critical, as it will be needed to determine queue placement. This is addressed below.
  3. Constructors in the four concrete classes (ArrivalEvent, DepartureEvent, SimulationReportEvent, SimulationEndEvent) will call the AbstractEvent constructor using "super( )" because it is in the superclass.
  4. I am providing you a test driver to test this work. Download this zip file containing EventTest.java. The event test will create ArrivalEvent, DepartureEvent, SimulationReportEvent and SimulationEndEvent objects and place them into a PriorityQueue. It will then remove them from the queue one at a time and compare the removed event with what it expects to see. There are 8 tests in all, and you will receive feedback on any incorrect results along with a pass/fail count.
  5. A PriorityQueue is a queue in which objects are placed in the queue according to a predefined ordering. The objects placed in the queue implement the Comparable interface, and its compareTo() method determines the ordering. Thus, the correct ordering of the events in the queue depends on correct implementation of the compareTo() method in AbstractEvent.
  6. For now, define the process() methods as stubs. These will be completed in the last phase of the project after more classes are added.

Scoring

PointsDescription
2Event.java
10AbstractEvent.java
2ArrivalEvent.java
2DepartureEvent.java
2SimulationReportEvent.java
2SimulationEndEvent.java

To Turn In

Zip your entire Pr3 working folder into a ZIP file with phase1 in its name. Then drop it into your DropBox.
[ COMP 2100 | Peter Sanderson | Math Sciences home page | Otterbein ]

Last updated: 
Peter Sanderson (PSanderson@otterbein.edu)