-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
88 lines (87 loc) · 2.8 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Circle Art</title>
<link rel="stylesheet" href="min.css">
<link rel="stylesheet" href="main.css">
</head>
<body>
<!-- All of the Node.js APIs are available in this renderer process. -->
<!-- We are using node <script>document.write(process.versions.node)</script>,
Chromium <script>document.write(process.versions.chrome)</script>,
and Electron <script>document.write(process.versions.electron)</script>. -->
<div class="row">
<div class="col c3">
<label>Population size</label>
<input type="number" id="popSize" value="15">
</div>
<div class="col c3">
<label>Mutation rate</label>
<input type="number" id="mutateRate" value="0.7">
</div>
<div class="col c3">
<label>Crossover rate</label>
<input type="number" id="crossRate" value="0.5">
</div>
<div class="col c3">
<label>Number of generations</label>
<input type="number" id="generations" value="1500">
</div>
</div>
<div class="row">
<div class="col c3">
<label>Number of circles</label>
<input type="number" id="solutionSize" value="150">
</div>
<div class="col c3">
<label>Max circle size</label>
<input type="number" id="maxElemSize" value="10">
</div>
</div>
<button class="btn btn-a btn-sm smooth" id="imageBtn">Open image</button>
<button class="btn btn-b btn-sm smooth" id="startBtn">Start</button>
<button class="btn btn-a btn-sm smooth" id="saveRBtn">Save result</button>
<div>
<img id="img" style="display:none;">
<canvas id="fitness" width="200" height="200" style="display:none;"></canvas>
<div class="row">
<div class="col c4">
<canvas id="canvas" width="200" height="200"></canvas>
</div>
<div class="col c4">
<canvas id="image" width="200" height="200"></canvas>
</div>
</div>
</div>
<table class="table">
<thead>
<th>Statistics</th>
<th>Actual value</th>
</thead>
<tbody>
<tr>
<td>Generation count</td>
<td><span id="actGener"></span></td>
</tr>
<tr>
<td>Max population score</td>
<td><span id="maxScore"></span></td>
</tr>
<tr>
<td>Min population score</td>
<td><span id="minScore"></span></td>
</tr>
<tr>
<td>Average population score</td>
<td><span id="avgScore"></span></td>
</tr>
</tbody>
</table>
<script src="canvas2svg.js"></script>
<script src="common.js"></script>
<script src="fileSaver.js"></script>
<script src="canvas.js"></script>
<script src="nodeGenetic.js"></script>
</body>
</html>