// to be implemented by the developer public override void AgentStep(float[] act) { direction dir = direction.still; if (brain.brainParameters.actionSpaceType == StateType.continuous) { float leftAmount = act[0]; float rightAmount = act[1]; if (leftAmount > 1f) { dir = direction.left; } if (rightAmount > 1f) { dir = direction.right; } if (dir == direction.left) { paddle.Left(); } if (dir == direction.right) { paddle.Right(); } if (done == false) { reward += gm.timerLoss * Time.deltaTime; } } else { var left = (int)act[0]; var right = (int)act[1]; if (left != 0 || right != 0) { if (left > 0) { dir = direction.right; } if (right > 0) { dir = direction.left; } if (dir == direction.left) { paddle.Left(); } if (dir == direction.right) { paddle.Right(); } } if (done == false) { if (done == false) { reward += gm.timerLoss * Time.deltaTime; } } } }