@Override
public void execute() {
// Check whether the configuration of this experiment is meaningful
ExperimentVariables expVars = exp.getExperimentVariables();
if (expVars != null && ExperimentVariables.containsSteerer(expVars)) {
ApplicationLogger
.log(Level.INFO,
"Will not configure experiment, it already contains a steerer variable.");
configWindow.getSelectionTreeSet().generateFactoryCombinations();
return;
}
// TODO add dialog for steerer selection and configuration
ISimSpaceExplorer explorer =
new SimpleSimSpaceExplorer(configWindow.getSelectionTreeSet());
// TODO this should be editable via the GUI
Set<BaseVariable<?>> expModelVars = explorer.getModelVariables();
expModelVars.add(new IntVariable("numOfReactants", 5, 1, 10, 2));
expModelVars.add(new IntVariable("numOfSpecies", 5, 1, 10, 2));
expModelVars.add(new IntVariable("ReactPerSpecies", 2, 1, 5, 1));
// Check whether the experiment is already set up with some other variables
ExperimentVariables newExpVars = new ExperimentVariables();
if (expVars != null) {
newExpVars.setSubLevel(expVars);
}
List<IExperimentSteerer> steerers = new ArrayList<>();
steerers.add(explorer);
newExpVars.addVariable(new ExperimentSteererVariable<>(
"SimSpExSteererVar", IExperimentSteerer.class, explorer,
new SequenceModifier<>(steerers)));
// The steerer's experiment variables are on the lowest level, they shall be
// used for every defined setup
newExpVars.getLowestSubLevel().setSubLevel(
new SteeredExperimentVariables<>(
IExperimentSteerer.class));
exp.setExperimentVariables(newExpVars);
}