forked from ed-sim/ed-sim-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
77 lines (66 loc) · 2.38 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
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript" src="scripts/sim-0.26.js"></script>
<script type="text/javascript" src="scripts/ed-sim.js"></script>
<script type="text/javascript">
$(function () {
$("#run_simulation").click(function () {
/** var doctorsOnDuty = parseFloat($('[name="doctorsOnDuty"]').val());
var treatmentTime = parseFloat($('[name="treatmentTime"]').val());
var MeanArrival = parseFloat($('[name="MeanArrival"]').val());
var triageTime = parseFloat($('[name="triageTime"]').val());
var Seed = parseFloat($('[name="Seed"]').val());
var Simtime = parseFloat($('[name="Simtime"]').val());
*/
var results = edSim(/*
doctorsOnDuty,
treatmentTime,
MeanArrival,
triageTime,
Seed,
Simtime*/);
var msg = "Simulation Results for [" /*
+ "Doctors on duty = " + doctorsOnDuty
+ ", Treatment Time = " + treatmentTime
+ ", Mean Arrival = " + MeanArrival
+ ", Mean triage time = " + triageTime
+ ", Seed = " + Seed
+ ", Sim time = " + Simtime */
+ "]<br>"
+ "Average time spent at A&E (min) = "
+ results[0].toFixed(4)
+ "<br>Average number of patients in A&E = "
+ results[2].toFixed(4)
+ "<hr>";
$(".results").append(msg);
});
$("#clear_result").click(function () {
$(".results").html('<a href="" id="clear_results">Clear</a><hr>');
});
});
</script>
</head>
<body>
<div class="form">
<!-- <table>
<tr><td>Doctors on duty:
<td><input type="text" name="doctorsOnDuty" value="2.0"/> </tr>
<tr><td>Treatment time (min):
<td><input type="text" name="treatmentTime" value="20"/> </tr>
<tr><td>Mean interval between patient arrivals (min):
<td><input type="text" name="MeanArrival" value="15" /> </tr>
<tr><td>Mean triage time (min):
<td><input type="text" name="triageTime" value="15" /> </tr>
<tr><td>Random number generation seed:
<td><input type="text" name="Seed" value="1234" /> </tr>
<tr><td>Simulation time (min):
<td><input type="text" name="Simtime" value="1440.0"/> </tr>
</table> -->
<input type="button" value="Run Simulation" id="run_simulation"/>
</div>
<div class="results">
<a href="" id="clear_results">Clear</a><hr>
</div>
</body>
</html>