-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain3.java
33 lines (25 loc) · 990 Bytes
/
Main3.java
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
import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import cs2030.simulator.Simulator;
class Main3 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// Input: numOfServers, maxQueueLength, numOfCustomers
int numOfServers = sc.nextInt();
int maxQueueLength = sc.nextInt();
int numOfCustomers = sc.nextInt();
List<Double> arrivalTimes = new ArrayList<Double>();
List<Double> serviceTimes = new ArrayList<Double>();
for (int i = 0; i < numOfCustomers; i++) {
arrivalTimes.add(sc.nextDouble());
serviceTimes.add(sc.nextDouble());
}
List<Double> restTimes = new ArrayList<Double>();
for (int i = 0; i < numOfCustomers; i++) {
restTimes.add(sc.nextDouble());
}
Simulator s = new Simulator();
s.simulate(arrivalTimes, serviceTimes, restTimes, numOfServers, maxQueueLength);
}
}