}
public static double testConfig (TimingAgent controller, EvaluationOptions options, int seed, int level, boolean paused) {
options.setLevelDifficulty(level);
options.setPauseWorld(paused);
StatisticalSummary ss = test (controller, options, seed);
double averageTimeTaken = controller.averageTimeTaken();
System.out.printf("Difficulty %d score %.4f (avg time %.4f)\n",
level, ss.mean(), averageTimeTaken);
if (averageTimeTaken > 40) {
System.out.println("Maximum allowed average time is 40 ms per time step.\n" +
"Controller disqualified");
System.exit (0);
}
return ss.mean();
}