ConfigurationException {
for (int i = 0; i < 100; i++) {
final FabriRechtScenario scenario = FabriRechtParser.fromJson(
new FileReader("files/test/fabri-recht/lc101.scenario"), 8, 20);
final DynamicPDPTWProblem problem = new DynamicPDPTWProblem(scenario, 123);
problem.addCreator(AddVehicleEvent.class, new Creator<AddVehicleEvent>() {
@Override
public boolean create(Simulator sim, AddVehicleEvent event) {
return sim.register(new Truck(event.vehicleDTO));
}
});
final int iteration = i;
problem.enableUI(new DefaultUICreator(problem, 15) {
@Override
public void createUI(Simulator sim) {
try {
initRenderers();
View.create(sim).with(renderers.toArray(new Renderer[] {}))
.setSpeedUp(speedup).enableAutoClose().enableAutoPlay().show();
} catch (final Throwable e) {
System.err.println("Crash occured at iteration " + iteration);
e.printStackTrace();
throw new RuntimeException("This is the end, resistance is futile.");
}
}
});
problem.simulate();
}
}