allEvents = {
const rand = (a, b) => Math.random() * (b - a) + a;
const randc = (c, r) => rand(c - r, c + r);
const nContestants = 20;
const nRounds = 20;
const startSpacing = 2;
const meanDurationPerRound = 2 * 60 / nRounds;
const roundWeights = new Array(nRounds).fill(0).map(() => meanDurationPerRound * randc(1, 0.5));
const now = Date.parse("2020-05-16 12:00");
const events = [];
for (let iContestant = 0; iContestant < nContestants; iContestant++) {
let t0 = iContestant * startSpacing;
const tAll = [t0];
let t = t0;
const speed = randc(1, 0.5);
for (let iRound = 0; iRound < nRounds; iRound++) {
const roundSpeed = speed * randc(1, 0.3);
t = t + roundWeights[iRound] / roundSpeed;
tAll.push(t);
}
events.push(...tAll.map((ti, i) => ({
contestant: iContestant,
checkpoint: i,
timestamp: Math.round(now + ti * 60 * 1000),
})))
}
return events;
}