-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
102 lines (88 loc) · 3.46 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<html>
<head>
<!-- Load javascript modules -->
<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/case.js"></script>
<script type="text/javascript" src="scripts/service.js"></script>
<script type="text/javascript" src="scripts/genCases.js"></script>
<script type="text/javascript" src="scripts/genMovements.js"></script>
<script type="text/javascript" src="scripts/simjs-edsim.js"></script>
<script type="text/javascript" src="scripts/ed-sim-0.2.js"></script>
<script src="https://d3js.org/d3.v4.min.js"></script>
<style>
.chart div {
font: 10px sans-serif;
background-color: steelblue;
text-align: left;
padding: 3px;
margin: 1px;
color: white;
}
</style>
<!-- Java script specific to the controls on the webpage -->
<script type="text/javascript">
/* Attaches a function to run the simulation to the run button */
$(function () {
$("#run_simulation").click(function () {
/* Simulation parameters have been moved to ed-sim.js. This commented out code would read values from on-screen form fields
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());
*/
this.disabled=true;
var logFunction = function (msg) {
$(".log").append('<br>' + msg);
}
var results = edSim(logFunction);
var msg = "Simulation Results" /* Parameters have been moved to ed-sim.js. Commented out code would display the values used for simulation
+ "Doctors on duty = " + doctorsOnDuty
+ ", Treatment Time = " + treatmentTime
+ ", Mean Arrival = " + MeanArrival
+ ", Mean triage time = " + triageTime
+ ", Seed = " + Seed
+ ", Sim time = " + Simtime */
+ "<br>"
+ (results.waitPerformance * 100).toPrecision(2)
+ "% seen within four hours."
+ "<br>"
+ "<hr>";
$(".results").append(msg);
});
$("#clear_result").click(function () {
$(".results").html('<a href="" id="clear_results">Clear</a><hr>');
});
});
</script>
</head>
<body>
<div class="form">
<!-- Parameters have been moved to ed-sim.js. Commented out code would provide form fields for changing the simulation parameters
<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>
<div class="chart">
</div>
<div class="log">
</div>
</body>
</html>