-
Notifications
You must be signed in to change notification settings - Fork 12
/
index.html
132 lines (117 loc) · 5.24 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
<!DOCTYPE html>
<html>
<head>
<title>Neurobots</title>
<link rel="stylesheet" href="style.css" type="text/css" media="screen">
<script type="text/javascript" src="neurobot.js"></script>
<script type="text/javascript" src="plant.js"></script>
<script type="text/javascript" src="stats.js"></script>
<script type="text/javascript" src="input.js"></script>
<script type="text/javascript" src="sim.js"></script>
</head>
<body onload="init();">
<h1>Neurobots</h1>
<div>
<div id="sidepane">
<p>
<input type="button" value="Start" id="startbutton" onclick="startsim();" disabled>
<input type="button" value="Stop" id="stopbutton" onclick="stopsim();">
<input type="button" value="Reset" onclick="resetsim();">
<input type="button" value="Reset Camera" onclick="resetcam();">
FPS:<span id="fpsspan">0</span>
</p>
<div id="worldopts">
<p><small>
This program simulates small robots, each one is controlled by a recurrent artificial neural network.<br>
They scan their surrounding using low resolution ray casting and this data is fed into the first layer of their neural network.<br>
The output layer of the neural network controls their movement.<br>
Moving decreases the robots power level, when they run out they die. Eating dots gives them new energy.
When they have enough energy they divide. Since the new bot is not an exact copy, they will slowly evolve. Just give it some time.<br>
</small></p>
<h2>Options</h2>
<table>
<tr>
<td><label for="bdepthbox" title="Number of layers in the neural network">Brain size:</label></td>
<td><input type="number" min="2" max="16" value="4" id="bdepthbox" onchange="bdepthchange(this)"></td>
</tr>
<tr>
<td><label for="bsizebox" title="Number of neurons in each layer">Brain complexity:</label></td>
<td><input type="number" min="4" max="16" step="4" value="8" id="bsizebox" onchange="bsizechange(this)"></td>
</tr>
<tr>
<td><label for="worldsizebox">World size:</label></td>
<td><input type="number" min="100" step="100" value="600" id="worldsizebox" onchange="worldsizechange(this)"></td>
</tr>
<tr>
<td><label for="foodratebox">Food respawn delay:</label></td>
<td><input type="number" min="5" max="50" value="10" id="foodratebox" onchange="foodratechange(this)"></td>
</tr>
<tr>
<td><label for="foodareabox">Food respawn area:</label></td>
<td><input type="number" min="100" step="100" value="500" id="foodareabox" onchange="foodareachange(this)"></td>
</tr>
</table>
<h2>Tools</h2>
<p>
<input type="button" value="Add new bot" onclick="addbot();">
<input type="button" value="Select newest bot" onclick="selnewest();">
<input type="button" value="Select best bot" onclick="selbest();"><br>
</p>
</div>
<div id="botstats" style="display:none">
<div>
<h2>Bot info</h2>
<div id="brainscan">
<canvas id="brain" width="160" height="160"></canvas>
</div>
<div>
<table>
<tr><td>Generation:</td><td><span id="botgenspan">0</span></td></tr>
<tr><td>Age:</td><td><span id="botagespan">0</span>/10000</td></tr>
<tr><td>Food level:</td><td><span id="botfoodspan">0</span>/1000</td></tr>
<tr><td>Brain size:</td><td><span id="botdepthspan">0</span></td></tr>
<tr><td>Brain complexity:</td><td><span id="botsizespan">0</span></td></tr>
<tr><td>Mutation rate:</td><td><span id="botratespan">0</span></td></tr>
<tr><td>Children:</td><td><span id="botchildspan">0</span></td></tr>
<tr><td>Dots eaten:</td><td><span id="botdotsspan">0</span></td></tr>
</table>
</div>
</div>
<h2>Brain data</h2>
<p>
<textarea id="braindata" rows="10" wrap="off"></textarea><br>
<input type="button" value="Inject!" onclick="injectbrain();">
<input type="button" value="Save" onclick="savebrain();">
<input id="deletebutton" type="button" value="Delete" onclick="deletebrain()" disabled>
<select id="savename" onchange="listselect( this.value )" disabled><option value="">No saved brains</option></select>
</p>
</div>
</div>
<div id="container">
<canvas id="canvas" width="800" height="600"></canvas>
</div>
</div>
<div id="statistics">
<div id="diagram">
<canvas id="stats" width="500" height="102"></canvas><br>
<small>
<span style="color:#FF0000">Population</span> |
<span style="color:#00FF00">Food</span> |
<span style="color:#0000FF">Age</span> |
<span style="color:#000000">Mutation rate</span>
</small>
</div>
<div>
<table>
<tr><td>Population:</td><td><span id="popspan">0</span></td></tr>
<tr><td>Food count:</td><td><span id="foodspan">0</span></td></tr>
<tr><td>Average age:</td><td><span id="agespan">0</span></td></tr>
<tr><td>Avg. mutation rate:</td><td><span id="ratespan">0</span></td></tr>
</table>
</div>
</div>
<div id="footer">
<p>Neurobots v.1.5.5 by 50m30n3 - <a href="./../">Index</a> - <a href="./help.html" target="_blank">Help</a> - <a href="https://github.com/50m30n3/Neurobots" target="_blank">Source on GitHub</a></p>
</div>
</body>
</html>