-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
134 lines (115 loc) · 4.9 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!DOCTYPE html>
<html>
<head>
<title>NeuroCars</title>
<link rel="icon" type="image/png" href="https://img.icons8.com/ultraviolet/40/000000/brain.png">
<link rel="stylesheet" type="text/css" href="css/index.css">
<link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
<!---Third Party Libs--->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/planck-with-testbed.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.10.2/p5.js" integrity="sha256-UZcJhkL1z2sBS6X+IfDoYsN3G8Cliast0jio7GtJUSc=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script src="js/index.js"></script>
<script src="js/util/mat.js"></script>
<script src="js/util/activations.js"></script>
<script src="js/util/nn.js"></script>
<script src="js/genetics/agent.js"></script>
<script src="js/genetics/geneticsinfo.js"></script>
<script src="js/genetics/population.js"></script>
<script src="js/physics/trackinfo.js"></script>
<script src="js/physics/raycast.js"></script>
<script src="js/physics/car.js"></script>
<script src="js/physics/walls.js"></script>
<script src="js/physics/checkpoints.js"></script>
<script src="js/physics/track.js"></script>
<script src="js/simulation.js"></script>
</head>
<body>
<div id="title">NeuroCars</div>
<div id="description">
NeuroCars is a personal project that demonstrates
<a href="https://en.wikipedia.org/wiki/Neuroevolution" target="_blank">neuroevolution</a>
using <a href="http://piqnt.com/planck.js/" target="_blank">planck.js</a> for physics simulations.
<br>
<br>
In the simulation, self-driving cars contain brains (neural networks) that control their steering while they try to
navigate a track without touching the walls. Input into the brains:
distances to the nearest track wall in 5 directions. Output: whether to turn right, left, or do nothing. After each
iteration, a fitness score is assigned to each bot proportional to
how long they stayed alive and how far they traveled, higher fitness scores make a bot more likely to reproduce.
</div>
<br>
<div id="source"><a href="https://github.com/jhanreg11/NeuroCar" target="_blank">Source code is available here</a></div>
<br>
<div id="simulation-container">
<div id="data-container">
<div id="options">
<div class="option">
<div class="desc">Track:</div>
<select id="track-select">
<option value="0" selected="selected">Track 1 (easy)</option>
<option value="1">Track 2 (hard)</option>
</select>
</div>
<div class="option">
<div class="desc">Training level:</div>
<select id="train-select">
<option value="rand" selected="selected">Start from scratch</option>
<option value="full">Fully-trained model</option>
</select>
</div>
<div class="option">
<div class="desc">Generation Size:</div>
<select id="size-select">
<option value="50">50</option>
<option value="100">100</option>
<option value="150" selected="selected">150</option>
<option value="200">200</option>
</select>
</div>
<div class="option">
<div class="desc">Mutation Rate:</div>
<select id="mut-select">
<option value="0">0</option>
<option value="0.05">0.05</option>
<option value="0.15" selected="selected">0.15</option>
<option value="0.30">0.3</option>
<option value="0.50">0.5</option>
<option value="0.75">0.75</option>
<option value="1">1</option>
</select>
</div>
</div>
<br>
<div id="stats">
<div class="stat">
<div class="desc">Goal:</div>
<div class="data" id="goal">Navigate track to completion.</div>
</div>
<div class="stat">
<div class="desc">Status:</div>
<div class="data" id="status">Not completed.</div>
</div>
<div class="stat">
<div class="desc">Turn time limit:</div>
<div class="data" id="time-limit">15 seconds</div>
</div>
<div class="stat">
<div class="desc">Current generation:</div>
<div class="data" id="generation">0</div>
</div>
<div class="stat">
<div class="desc">Top fitness (all-time):</div>
<div class="data" id="top-fitness">0.00</div>
</div>
<div class="stat">
<div class="desc">Average fitness (current gen):</div>
<div class="data" id="avg-fitness">0.00</div>
</div>
</div>
</div>
<canvas id="stage"></canvas>
</div>
<script src="js/main.js"></script>
</body>
</html>