-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLeave.java
More file actions
32 lines (26 loc) · 717 Bytes
/
Leave.java
File metadata and controls
32 lines (26 loc) · 717 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
class Leave extends Event {
private static final int PRIORITY = 6;
Leave(Shop shop, Customer customer, double time) {
super(shop, customer, time);
}
public int getPriority() {
return PRIORITY;
}
@Override
public Event getNextEvent(Shop shop) {
return this;
}
@Override
public int getServerId() {
return 0;
}
@Override
public ImList<Double> updateStatistics(ImList<Double> statistics) {
double numLeft = statistics.get(2) + 1;
return statistics.set(2, numLeft);
}
@Override
public String toString() {
return String.format("%.3f ",this.time) + customer.toString() + " leaves";
}
}