Raw code: accumulator simulation
	$simulation = array();
	
	$accumulator = $botParameters['Accumulator capacity'];
	$accumulatorCapacity = $botParameters['Accumulator capacity'];
	$accumulatorRechargeRate = $botParameters['Accumulator capacity'] / $botParameters['Accumulator recharge time'];
	
	$activations = array();
	foreach($botFitting as $fittedId => $fittedModule) {
		if (isset($fittedModule['Accumulator consumption']) and isset($fittedModule['Cycle time'])) {
			for ($i = 0; $i <= 900; $i = $i + $fittedModule['Cycle time']) { // <- round this value to tweak the end result
				@$activations[number_format($i, 1, '.', '')] += $fittedModule['Accumulator consumption'] - ($fittedModule['Accumulator consumption'] * 2);
			}
		}
	}
	
	$accumulatorFailure = false;
	
	for ($i = 0; $i <= 900; $i++) {
		if ($accumulator >= ($accumulator / 2)) { // if accumulator is at/past half
			$b0 = (($accumulatorRechargeRate * 1.5) / ($accumulator / 2)) / -1; // cr * 2 - cr / 2
			$b1 = $accumulatorRechargeRate * 3.5; // cr * 4 - cr / 2
		} else {
			$b0 = (($accumulatorRechargeRate * 1.5) / ($accumulator / 2)) / 1;
			$b1 = $accumulatorRechargeRate / 2;
		}
		$accumulator = bcadd($accumulator, ($b0 * $accumulator) + $b1, 2);
		if ($accumulator > $accumulatorCapacity) {
			$accumulator = $accumulatorCapacity;
		} else {
			$simulation[number_format($i, 1, '.', '')][] = 'Accumulator recharged, now ' . $accumulator . ' AP';
		}
		for ($j = 0; $j <= 0.9; $j = $j + 0.1) {
			if (isset($activations[number_format($i + $j, 1, '.', '')])) {
				$accumulator = bcadd($accumulator, $activations[number_format($i + $j, 1, '.', '')], 2);
				$simulation[number_format($i + $j, 1, '.', '')][] = 'Module activated for ' . @$activations[number_format($i + $j, 1, '.', '')] . ' AP, now ' . $accumulator . ' AP';
			}
			if ($accumulator <= 0) {
				$simulation[number_format($i + $j, 1, '.', '')] = 'Simulation ended, accumulator empty.';
				break;
			}
		}
		if ($accumulator <= 0) {
			$accumulatorFailure = number_format($i + $j, 1, '.', '');
			break;
		}
	}