COMP 2100 Project 3: Queuing System Simulation
Fall 2015
PHASE 3 : Develop and test the Server class
Due: in lab, Thursday 5 November 2015
20 points
PHASE 3 : Develop and Test the Server class
A complex project like this needs to be developed in phases. In the third phase, you will define
a class to represent a server for the simulation framework and test it using a provided test driver.
Implementation Notes
- Here is a ZIP file that contains a folder of files you will need for development and testing of
Server: phase3.zip
- The ZIP file contains an extended version of the Simulation class
that contains a test driver for the Server class. It also contains
the WaitingLine test driver but the call to it has been commented
out.
- I am providing a stubbed-in version of the Server class (click for API). Your solution
will build on it.
- NOTE: Although the main Project 3 page includes the pseudo-code algorithms
Simplified Algorithm for Customer Requesting the Server and
Simplified Algorithm for Customer Releasing the Server, the
code you write for the request() and release() methods will
not strictly adhere to those algorithms. The code you write should follow the Server
API and the Implementation Notes below. The pseudo-code will come in handy in a
later phase when we implement the arrival and departure events.
- The Server class will require at least two significant instance variables:
- a WeightedStatistic object to gather server utilization data, and
- a Statistic object to gather service time data
These variables will be updated within the request() and release() methods.
- The request() method is used to assign a customer to the server. When this happens,
the utilization statistic needs to be collected since the server's busy/idle status changes.
The simulation clock time also needs to be put into the customer's timestamp.
- The release() method is used to release a customer from the server. When this happens,
the utilization statistic needs to be collected since the server's busy/idle status is about to change.
The service time statistic also needs to be collected since the customer's service is now over. Details below.
- Service time is calculated by subtracting the customer's timestamp (time
it successfully requested the server, obtained from the customer object) from
the simulation clock time when it is released. This can obviously only be
collected at the time of release.
- Utilization, collected upon both successful request and release, is more
difficult to collect than service time. It is a weighted statistic, therefore
every utilization sample also has an associated weight. For utilization, the
sample value is 0 if the server is transitioning from idle to busy (successful
request), and 1 if the server is transitioning from busy to idle (successful
release). The weight here represents time, just as it did for the
queue length statistic in Phase 2. To correctly collect the utilization, you
need to compute the length of simulation time for which the server was busy
or idle. The technique for doing this is similar to the technique you applied
in Phase 2 to collect the queue length statistic. .
- The main() method in the Simulation class contains code to test Server methods.
To run the tests, compile and run Simulation.java.
Scoring
Points | Description |
8 | the request() method |
8 | the release() method |
4 | everything else |
To Turn In
Zip your entire Pr3 working folder into a ZIP file with phase3 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)