Commit 0d14236f authored by Jakob Schöttl's avatar Jakob Schöttl
Browse files

Refactoring

parent 381c709f
...@@ -44,6 +44,7 @@ public class ScenarioRun implements Runnable { ...@@ -44,6 +44,7 @@ public class ScenarioRun implements Runnable {
private ScenarioFinishedListener finishedListener; private ScenarioFinishedListener finishedListener;
private Simulation simulation; private Simulation simulation;
private ProcessorManager processorManager;
private final Scenario scenario; private final Scenario scenario;
private final ScenarioStore scenarioStore; // contained in scenario, but here for convenience private final ScenarioStore scenarioStore; // contained in scenario, but here for convenience
...@@ -77,13 +78,13 @@ public class ScenarioRun implements Runnable { ...@@ -77,13 +78,13 @@ public class ScenarioRun implements Runnable {
final Random random = modelBuilder.getRandom(); final Random random = modelBuilder.getRandom();
// prepare processors and simulation data writer // prepare processors and simulation data writer
final ProcessorManager processorManager = dataProcessingJsonManager.createProcessorManager(mainModel); processorManager = dataProcessingJsonManager.createProcessorManager(mainModel);
createAndSetOutputDirectory(processorManager); createAndSetOutputDirectory();
scenario.saveToOutputPath(outputPath); scenario.saveToOutputPath(outputPath);
sealAllAttributes(processorManager); sealAllAttributes();
// Run simulation main loop from start time = 0 seconds // Run simulation main loop from start time = 0 seconds
simulation = new Simulation(mainModel, 0, scenarioStore.name, scenarioStore, passiveCallbacks, random, processorManager); simulation = new Simulation(mainModel, 0, scenarioStore.name, scenarioStore, passiveCallbacks, random, processorManager);
...@@ -196,7 +197,7 @@ public class ScenarioRun implements Runnable { ...@@ -196,7 +197,7 @@ public class ScenarioRun implements Runnable {
// Output stuff... // Output stuff...
private void createAndSetOutputDirectory(final ProcessorManager processorManager) { private void createAndSetOutputDirectory() {
try { try {
// Create output directory // Create output directory
Files.createDirectories(outputPath); Files.createDirectories(outputPath);
...@@ -238,7 +239,7 @@ public class ScenarioRun implements Runnable { ...@@ -238,7 +239,7 @@ public class ScenarioRun implements Runnable {
return scenario; return scenario;
} }
public void sealAllAttributes(final ProcessorManager processorManager) { private void sealAllAttributes() {
scenarioStore.sealAllAttributes(); scenarioStore.sealAllAttributes();
processorManager.sealAllAttributes(); processorManager.sealAllAttributes();
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment