diff --git a/org.lflang/src/org/lflang/generator/python/PythonReactorGenerator.java b/org.lflang/src/org/lflang/generator/python/PythonReactorGenerator.java index 4b5549b738..be06af5254 100644 --- a/org.lflang/src/org/lflang/generator/python/PythonReactorGenerator.java +++ b/org.lflang/src/org/lflang/generator/python/PythonReactorGenerator.java @@ -167,10 +167,10 @@ private static String generatePythonClassInstantiation(ReactorInstance instance, CodeBuilder code = new CodeBuilder(); code.pr(PyUtil.reactorRef(instance)+" = _"+className+"("); code.indent(); + // Always add the bank_index + code.pr("_bank_index = "+PyUtil.bankIndex(instance)+","); for (ParameterInstance param : instance.parameters) { - if (param.getName().equals("bank_index")) { - code.pr("_bank_index = "+PyUtil.bankIndex(instance)+","); - } else { + if (!param.getName().equals("bank_index")) { code.pr("_"+param.getName()+"="+PythonParameterGenerator.generatePythonInitializer(param)+","); } }