lemmings/LemmingSim.html

66 lines
3.6 KiB
HTML

<!--
Copyright 2016 Harmen de Weerd
Copyright 2017 Johannes Keyser
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Lemmings</title>
<script language="JavaScript" src="mouse.js"></script>
<script language="JavaScript" src="graphics.js"></script>
<script language="JavaScript" src="utils.js"></script>
<script language="JavaScript" src="sensors.js"></script>
<script language="JavaScript" src="lemming_sim_student.js"></script>
<script language="JavaScript" src="matter.js"></script>
<script language="JavaScript" src="pathseg.js"></script>
<script language="JavaScript" src="decomp.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.js"></script>
</head>
<body onload="init();">
<object id="robotbodySVG" type="image/svg+xml" data="robotbody.svg" width=0 ></object>
<canvas id="arenaLemming" width="450" height="450" style="cursor: initial;"></canvas>
<br>
<table border="0" style="float: left; ">
<tbody>
<tr><th colspan="2" align="center">Simulation properties</th><td></td></tr>
<tr><td>Simulation steps: <span id="SimStepLabel"></span></td></tr>
</tr>
<tr><br></tr>
<tr><th colspan="2" align="center">Selected robot info</th></tr>
<tr>
<td colspan="1" align="center">
<canvas id="bayLemming" width="110" height="110" style="border:solid 2px black;"></canvas>
</td>
<td>Sensor values<span id="SensorLabel"></span></td>
</tr>
<tr><th colspan="2" align="center">Robot Display</th></tr>
<tr><td colspan="2" id="bayDisplay"></td></tr>
<tr><th colspan="2">Experiments</th></tr>
<tr><td><label for="robotAmnt">Robot Count</label></td><td><input id="robotAmnt" type="number" value="1" min="0" max="3" /></td></tr>
<tr><td><label for="ffwdtimes">nr of experiments</label></td><td><input id="ffwdtimes" type="number" value="10" min="1" max="20" /></td></tr>
<tr><td><label for="learningRate">robot learning rate</label></td><td><input id="learningRate" type="number" value="0.01" step="0.001"></td></tr>
<tr><td><label for="forgetRate">robot forgetting rate</label></td><td><input id="forgetRate" type="number" value="0.01" step="0.001"></td></tr>
<tr><td><label for="boxFric">box friction</label></td><td><input id="boxFric" type="number" value="0.001" step="0.0005" min=0></td></tr>
<tr><td><label for="boxX">Boxes:</label></td><td><input id="boxX" type="number" value="4" min=1 max=10>x<input id="boxY" type="number" value="4" min=1 max=10></td></tr>
<tr><td><input type="button" value="Restart Slow" onclick="initSimulation(); sim.start()" /><input type="button" value="toggle pause" onclick="sim.toggle()"></td><td><input type="button" value="run experiments" onclick="runExperiments()" /><input type="button" value="clear" onclick="resultsTable.clear()" /></td></tr>
<tr><td></td></tr>
</tbody></table>
<table id="results"></table>
<canvas id="weightschart" width="400" height="400"></canvas>
</body>
</html>