Commit a1ef1358 authored by Nico Mack's avatar Nico Mack

Changes required by implementation of RExecutor

parent b477678d
...@@ -83,6 +83,10 @@ public class Equation { ...@@ -83,6 +83,10 @@ public class Equation {
return mapping; return mapping;
} }
public String getName() {
return name;
}
/** /**
* Allows to isolate this equation. An isolated equation will not notify dependent equations when * Allows to isolate this equation. An isolated equation will not notify dependent equations when
* evaluation entailed changes in results. * evaluation entailed changes in results.
...@@ -170,6 +174,11 @@ public class Equation { ...@@ -170,6 +174,11 @@ public class Equation {
this.scriptExecutor = executor; this.scriptExecutor = executor;
} }
public Executor getExecutor() {
return this.scriptExecutor;
}
/** /**
* Method querying whether the {@link Equation} instance is affected by a change of the * Method querying whether the {@link Equation} instance is affected by a change of the
* {@link Variable} instance and would need to recompute. * {@link Variable} instance and would need to recompute.
......
...@@ -762,17 +762,23 @@ public class EquationSystemBuilder { ...@@ -762,17 +762,23 @@ public class EquationSystemBuilder {
for (Entry<String, LinearEquationSystem> entry : this.equations.entrySet()) { for (Entry<String, LinearEquationSystem> entry : this.equations.entrySet()) {
String equationName = entry.getKey(); String equationName = entry.getKey();
LinearEquationSystem equation = entry.getValue(); LinearEquationSystem system = entry.getValue();
if (equationImports.containsKey(equationName)) { if (equationImports.containsKey(equationName)) {
this.defaultExecutor.resolve(equationImports.get(equationName)); Equation equation = system.getEquation(equationName);
if (equation != null) {
Executor executor = equation.getExecutor();
executor.resolve(equationImports.get(equationName));
} else {
this.defaultExecutor.resolve(equationImports.get(equationName));
}
} }
for (Declaration declaration : this.equationParameters.get(equationName)) { for (Declaration declaration : this.equationParameters.get(equationName)) {
String identifier = declaration.getIdentifier(); String identifier = declaration.getIdentifier();
if (this.resultDependencies.containsKey(identifier)) { if (this.resultDependencies.containsKey(identifier)) {
for (String nestedEquationName : this.resultDependencies.get(identifier)) { for (String nestedEquationName : this.resultDependencies.get(identifier)) {
equation.nestSystem(this.equations.get(nestedEquationName)); system.nestSystem(this.equations.get(nestedEquationName));
} }
} }
} }
...@@ -785,7 +791,7 @@ public class EquationSystemBuilder { ...@@ -785,7 +791,7 @@ public class EquationSystemBuilder {
LOGGER.warn(message); LOGGER.warn(message);
throw new EquationSystemException(message); throw new EquationSystemException(message);
} }
this.rootEquations.put(identifier, equation); this.rootEquations.put(identifier, system);
} }
} }
} }
......
Markdown is supported
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