making random numbers deterministic

This commit is contained in:
Micho 2013-05-22 12:59:39 +02:00
parent fa281752ef
commit 41a500e8fd
1 changed files with 4 additions and 1 deletions

View File

@ -111,9 +111,12 @@ function mouseDragStop() {
function init() { function init() {
context = $('#canvas')[0].getContext('2d'); context = $('#canvas')[0].getContext('2d');
clients = []; clients = [];
var v = 0.2;
data.matrix.forEach(function (times, index) { data.matrix.forEach(function (times, index) {
clients[index] = { point:undefined, x:0, y:0, r:0, x0:0, y0:0, r0:0, index:index, lastEvent:0, selected:false }; clients[index] = { point:undefined, x:0, y:0, r:0, x0:0, y0:0, r0:0, index:index, lastEvent:0, selected:false };
random[index] = Math.random();
v = 3.999*v*(1-v); // bifurcation
random[index] = v;
}); });
$('#play').click(togglePlay); $('#play').click(togglePlay);