// Object value = assignments[i].expression.evaluate(env);\r
// assignments[i].target.assign(env, assignments[i].subscripts, value);\r
}\r
- for(Assignment ass : model.initials) {\r
- if(ass.isConstant) continue;\r
- ass.assign(env);\r
-// Object value = ass.expression.evaluate(env);\r
-// ass.target.assign(env, ass.subscripts, value);\r
- }\r
- \r
+\r
if (!started) {\r
+\r
+ for(Assignment ass : model.initials) {\r
+ if(ass.isConstant) continue;\r
+ ass.assign(env);\r
+ }\r
+ \r
for(VariableDeclaration vd : model.variables) {\r
try {\r
for(Argument arg : vd.modification.args) {\r
\r
public void step() {\r
\r
+ System.err.println("step @ " + getTime());\r
+ \r
// printEnvironment();\r
// \r
// new Exception().printStackTrace();\r
public VariableBase base;\r
public IExpression[] subscripts = null;\r
public int line = -1;\r
+ public VariableDeclaration decl = null;\r
\r
public Variable(IFrame frame, String name, IExpression[] subscripts, int line) {\r
base = frame.getBase(name);\r
this.base = base;\r
this.subscripts = subscripts;\r
}\r
- \r
+\r
+ public VariableDeclaration getDeclaration(Model model) {\r
+ if(decl == null) {\r
+ for(VariableDeclaration d : model.variables) {\r
+ if(d.variable.base.name.equals(base.name)) {\r
+ decl = d;\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ return decl;\r
+ \r
+ }\r
+\r
@Override\r
public String toString() {\r
// updated to print the double value as an integer value in subscripts\r