-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
80 lines (79 loc) · 2.45 KB
/
index.html
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<html>
<head>
<script src="https://unpkg.com/vue"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<link rel="stylesheet" type="text/css" href="https://developer.spotify.com/web-api/static/css/cached.css"/>
</head>
<body>
<div id="app">
<h1>Queue Simulation</h1>
<div class="col-md-3">
<div v-if="!nextArrival" >
<button class="btn btn-primary" v-on:click="simulation">Start</button>
</div>
<div v-if="EventList.length > 0">
<h2>Summary</h2>
<div v-for="summaryGroup in summary">
<div v-for="summaryItem in summaryGroup">
<strong>{{ summaryItem.attribute }}:</strong>
{{ summaryItem.value }}
<br>
</div>
<hr>
</div>
</div>
</div>
<div class="col-md-5">
<div v-if="EventList.length > 0">
<h2>Departure List</h2>
<table>
<tr>
<th>Arrival #</th>
<th>Arrival</th>
<th>Server</th>
<th>Service Begin</th>
<th>Departure</th>
<th>Waiting Time</th>
<th>Service Time</th>
</tr>
<tr v-for="(dept, index) in departures">
<td style="padding:5px">{{ index + 1 }} </td>
<td>{{ dept.arrival.toFixed(2) }}</td>
<td>{{ dept.server }}</td>
<td>{{ dept.serviceBegin.toFixed(2) }}</td>
<td>{{ dept.departure.toFixed(2) }}</td>
<td>{{ (dept.serviceBegin - dept.arrival).toFixed(2) }}</td>
<td>{{ (dept.departure - dept.serviceBegin).toFixed(2) }}</td>
</tr>
</table>
</div>
</div>
<div class="col-md-4">
<div v-if="EventList.length > 0">
<h2>Event List</h2>
<table>
<tr>
<th>Event</th>
<th>Time</th>
<th>Next Arrival</th>
<th>Queue Length</th>
<th>Dept 1</th>
<th>Dept 2</th>
<th>Time in Period</th>
</tr>
<tr v-for="Event in EventList">
<td style="padding:5px">{{ Event.type }}</td>
<td>{{ Event.time.toFixed(2) }}</td>
<td>{{ Event.nextArrival.toFixed(2) }}</td>
<td>{{ Event.queue.length }}</td>
<td><span v-if="Event.servers[0] != null">{{ Event.servers[0].departure.toFixed(2) }}</span><span v-else>NA</span></td>
<td><span v-if="Event.servers[1] != null">{{ Event.servers[1].departure.toFixed(2) }}</span><span v-else>NA</span></td>
<td>{{ parseFloat(Event.timeInPeriod).toFixed(2) }}</td>
</tr>
</table>
</div>
</div>
</div>
<script src="simulation.js"></script>
</body>
</html>