Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
Important Notes Handins:
– For undergraduate students, you may do this assignment as a team of two students
and hand in one submission per team.
– For postgraduate students, you have to do this assignment individually and make
individual submissions.
– All implementations have to be done in C++.
– You need to submit your source code using the web submission system. You should
attach you and your partner’s name and student number in your submission.
– Late submissions will attract a penalty: the maximum mark you can obtain will be
reduced by 25% per day (or part thereof) past the due date or any extension you are
granted.
Marking scheme:
– 20 marks for 10 randomly generated tests (2 marks per test).
If you have any questions, please send them to the student discussion forum. This way you
can all help each other and everyone gets to see the answers.
The assignment
The aim of this assignment is to improve your learning experience in the process scheduling
algorithms. You are required to design an online ticketing system for Coopers Stadium. Specifi-
cally, there are two seat sections: red section for public booking via this system; non-red section
for private booking via hot line. Figure 1 shows the distribution of the seat sections.
In the system, all the customers are grouped into seven priority classes(numbers), ranged
from 1 to 7, according to their loyalty (accumulated points) to this ticketing system. A smaller
priority number indicates a higher priority. All ticketing processes (purchase/cancellation) generated
by a customer are assigned with the same priority number of that customer. To maximise
the system service performance, you are required to implement a scheduling algorithm using
multi-level queue strategy with two queues: a high priority Queue 1 and a low priority Queue
2. Queue 1 has absolute priority over Queue 2. In other words, customer request in Queue 2
will only be processed if there is no customer in Queue 1. There is a threshold (=3) that is
used to determine whether a customer should remain in Queue 1 (priority number ≤ threshold)
or Queue 2 (priority number > threshold). Detailed actions in these two queues are listed below:
Queue 1: This is the high priority queue(priority number ≤ threshold). Customers in this
queue are treated in the way of combined Highest Priority First (HPF) and Weighted Round
Robin (WRR — definition see below) on priority as follows: Select the highest priority customer
1
Figure 1: Stadium Map.
(customers with the same priority are processed in their arrival order), and then process this
customer’s request for a ticket quota of N =
weighted time quantum
5 time units tickets non-preemptively, then
move this customer to the end of (the priority-subqueue of) Queue 1, where
weighted time quantum = (8 customer’s priority number) × 10
1 ticket costs 5 time units to process.
customer’s priority number is the customer’s current priority number.
Weighted Round Robin (WRR): Given n processes P1, P2, . . . , Pn, where process Pi has a weight
wi (1 ≤ i ≤ n), W RR allocates Pi a weighted time quantum of wi time units (i.e. a share of P win i=1 wi
CPU time). In this assignment, to simplify the implementation, a process’ weight
is (8 customer’s priority number), and customer’s priority number is the customer’s current
priority number.