feat: add Lab4
This commit is contained in:
23
Lab1/JoinCounterQueueEvent.java
Normal file
23
Lab1/JoinCounterQueueEvent.java
Normal file
@@ -0,0 +1,23 @@
|
||||
public class JoinCounterQueueEvent extends Event {
|
||||
private Customer customer;
|
||||
private ServiceCounter counter;
|
||||
|
||||
public JoinCounterQueueEvent(double time, Customer customer, ServiceCounter counter) {
|
||||
super(time);
|
||||
this.customer = customer;
|
||||
this.counter = counter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Event[] simulate() {
|
||||
this.counter.joinQueue(customer);
|
||||
return new Event[] {};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("%s: %s joined counter queue (at %s)",
|
||||
super.toString(),
|
||||
this.customer, this.counter);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user