.getCustomRWParams(), SimSystem.getRegistry().createContext()));
setAbsModReaderParams(taskConfig.getModelReaderParams());
}
RunInformation currentResult = null;
List<RunInformation> currentResults = new ArrayList<>();
runInformation.add(currentResults);
reportConfigExecution();
abortCurrentConfig = false;
int replications = taskConfig.allowedReplications(currentResults);
int executedReplications = 0;
while (replications > 0 && executedReplications < replications
&& !abortCurrentConfig) {
IInitializedComputationTask initComputationTask = null;
IComputationTaskConfiguration compTaskConfig = null;
currentTRTI = null;
// Initialise computation task
try {
initComputationTask = init(taskConfig);
currentResult = initComputationTask.getRunInfo();
// Check for premature abort
if (initComputationTask.getComputationTask() != null) {
compTaskConfig = initComputationTask.getComputationTask().getConfig();
} else {
abortCurrentConfig = true;
}
// Notify submitting experiment
IComputationTask run = initComputationTask.getComputationTask();
currentTRTI =
new ComputationTaskRuntimeInformation(compTaskConfig, taskConfig,
run, run != null ? run.getUniqueIdentifier() : null,
currentResult);
} catch (Exception t) {
SimSystem.report(Level.SEVERE,
"Problem in initializing execution task", t);
handleAbort(taskConfig, currentResult, compTaskConfig, t);
} finally {
getExperimentController(taskConfig).computationTaskInitialized(this,
currentTRTI);
}
waitForNotification();
if (runComputationTask) {
executedReplications++;
try {
currentResult = run(initComputationTask, compTaskConfig);
currentResults.add(currentResult);
// Notify that the execution of a single run is done
if (executedReplications == replications) {
replications += taskConfig.allowedReplications(currentResults);
}
currentResult.setJobDone(executedReplications == replications);
} catch (Exception t) {
SimSystem.report(t);
abortCurrentConfig = true;
currentResult = new RunInformation(true);
} finally {
getExperimentController(taskConfig).computationTaskExecuted(this,
currentTRTI, currentResult);
IDataStorage<?> storage = getDataStorage(taskConfig);