protected double stepDuration = DEFAULT_STEP_DURATION;\r
protected int savePer = 1;\r
\r
- protected HashMap<String, Integer> subscriptionIndexes;\r
+ public HashMap<String, Integer> subscriptionIndexes;\r
protected double[] currentValues; // Current values from FMU. Updated with updateSubscriptions\r
\r
- THashMap<String, TDoubleArrayList> results;\r
+ TDoubleArrayList[] results;\r
\r
public String[] subscription;\r
\r
\r
monitor.subTask("Save results (time = " + time + ")");\r
for(int k = 0; k < subscription.length; k++) {\r
- setResults(time, subscription[k], currentValues[k]);\r
+ setResults(time, k, currentValues[k]);\r
}\r
\r
lastResultTime = time;\r
\r
private double lastResultTime = Double.NaN;\r
\r
- public void setResults(double time, String key, Double value) {\r
- TDoubleArrayList list = results.get(key);\r
+ public void setResults(double time, int index, Double value) {\r
+ TDoubleArrayList list = results[index];\r
if(list == null) {\r
list = new TDoubleArrayList();\r
- results.put(key, list);\r
+ results[index] = list;\r
}\r
if(time == lastResultTime) {\r
list.set(list.size()-1, value);\r
\r
public void clearResults() {\r
lastResultTime = Double.NaN;\r
- results.clear();\r
+ for(int i=0;i<results.length;i++)\r
+ results[i] = null;\r
+ //results.clear();\r
+ }\r
+ \r
+ public void simulateDuration(double duration, boolean useJob) {\r
+ SimulateDurationJob job = new SimulateDurationJob(this, "Simulate steps", duration, useJob);\r
+ if(useJob) job.schedule();\r
+ else job.run(new NullProgressMonitor());\r
}\r
\r
@Override\r
public void simulateDuration(double duration) {\r
- Job job = new SimulateDurationJob(this, "Simulate steps", duration);\r
- // Start the Job\r
- job.schedule();\r
+ simulateDuration(duration, true);\r
}\r
\r
public void refresh() {\r