public void startExperiment() {
if (!canStartExperiment()) {
throw new IllegalStateException("Experiment not ready. (in state " + state + ")");
}
final ExperimentRunBuilder builder = ExperimentRun.newInstance();
final List<TelemetryVisualization<? extends Telemetry>> visualizationToUpdate;
lock.lock();
try {
visualizationToUpdate = visualizations;
builder.setFunction(currentExperiment.getFunction());
builder.setMethod(currentExperiment.getMethod());
builder.setSolver(currentExperiment.getSolver());
this.visualizations = new ArrayList<TelemetryVisualization<? extends Telemetry>>();
} finally {
lock.unlock();
}
final Experiment experiment = builder.getExperiment();
Aggregator<Telemetry> aggregator = Consumers.synchronizingAggregatorOf(Telemetry.class, experiment.getSolver().getClass());
// method => aggregator
Producer<? extends Telemetry> broadcast = Consumers.broadcast(experiment.getMethod());