Evolution of Code

Performance Test 1:
reverse(4); // Reverse both motors.
motorSpeed(4,35); // Set both motors speed to 35.
goToAbsolutePosition(175); // Run the AEV to the absolute position of 175 marks.
motorSpeed(4,0); // Set both motors speed to 0.
goFor(1); // Run this for 1 second.
brake(4); // Brake both motors.
goFor(9); // Run this for 9 seconds (braking/coasting to the gate and waiting).
motorSpeed(4,30); // Set both motors speed to 30.
goFor(4); // Run for 4 seconds.
brake(4); // Brake both motors.
Performance Test 2: (Code which led to the final code)
reverse(4); // Reverse both motors.
motorSpeed(4,40); // Set both motors speed to 40.
goToAbsolutePosition(195); // Run the AEV to the absolute position of 195.
motorSpeed(4,0); // Set both motors speed to 0.
goFor(1); // Run this for 1 second.
brake(4); // Brake both motors.
goFor(9); // Run this for 9 seconds (braking/coasting to the gate and waiting).
motorSpeed(4,30); // Set both motors to speed 30.
goFor(6.2); // Run this for 6.2 seconds.
brake(4); // Brake both motors.
goFor(9); // Run this for 9 seconds (braking/coasting to the caboose and waiting).
reverse(4); // Reverse both motors (to run to back to the other side of the track).
motorSpeed(4,45); // Set both motors speed to 45.
goFor(4.5); // Run this for 4.5 seconds.
motorSpeed(4,0); // Set both motors speed to 0.
goFor(1); // Run this for 1 second.
brake(4); // Brake both motors.
goFor(9); // Run this for 9 seconds (braking/coasting to the gate and waiting).
motorSpeed(4,47); // Set both motors to 47.
goFor(2); // Run this for 2 seconds.
brake(4); // Brake both motors.
Final Performance Test:
reverse(4); // Reverse both motors.
motorSpeed(4,40); // Set both motors speed to 40.
goToAbsolutePosition(182); // Run the AEV to the absolute position of 182 marks.
motorSpeed(4,0); // Set both motors to 0.
goFor(1); // Run this for 1 second.
brake(4); // Brake both motors.
goFor(9); // Run the brake for 9 seconds (at the gate).
motorSpeed(4,30); // Set both motors speed to 30.
goFor(5.7); // Run this for 5.7 seconds.
brake(4); // Brake both motors.
goFor(9); // Run the brake for 9 seconds (coasts to caboose, then waits at the end of the track with caboose).
reverse(4); // Reverse both motors (to run back to the other side of the track).
motorSpeed(4,45); // Set both motors to speed 45.
goFor(4.75); // Run this for 4.75 seconds.
motorSpeed(4,0); // Set both motors to 0.
goFor(1); // Run this for 1 second.
brake(4); // Brake both motors.
goFor(9); // Run the brake for 9 seconds (at the gate).
motorSpeed(4,55); // Set both motors at speed 55.
goFor(2.7); // Run this for 2.7 seconds.
motorSpeed(4,0); // Set both motors to o.
goFor(2); // Run for 2 seconds (coast to the end of the track).
brake(4); // Brake both motors (at the end of the track).