-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWait.java
More file actions
33 lines (27 loc) · 835 Bytes
/
Wait.java
File metadata and controls
33 lines (27 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
class Wait extends Event {
private static final int PRIORITY = 5;
Wait(Shop shop, Customer customer, double time) {
super(shop, customer, time);
}
public int getPriority() {
return PRIORITY;
}
@Override
public int getServerId() {
return 0;
}
@Override
public Event getNextEvent(Shop shop) {
double waitingQueueTime = shop.getWaitingQueueTime(customer);
return new Served(shop, customer, waitingQueueTime, shop.getCustomerQueue(customer));
}
@Override
public ImList<Double> updateStatistics(ImList<Double> statistics) {
return statistics;
}
@Override
public String toString() {
return String.format("%.3f ",this.time) + customer.toString() +
" waits at " + shop.getCustomerQueue(customer);
}
}