private EsgSpecialParameters createEsgSpecialParameters(EurostagEchExportConfig config) { return config.isSpecificCompatibility() ? null : new EsgSpecialParameters(); }
private void writeEch(Path workingDir) throws IOException { try (Writer writer = new OutputStreamWriter(new GZIPOutputStream(Files.newOutputStream(workingDir.resolve(ECH_GZ_FILE_NAME))), StandardCharsets.UTF_8)) { EsgGeneralParameters parameters = new EsgGeneralParameters(); parameters.setTransformerVoltageControl(false); parameters.setSvcVoltageControl(false); parameters.setMaxNumIteration(config.getLfMaxNumIteration()); EsgSpecialParameters specialParameters = null; if (exportConfig.isSpecificCompatibility()) { LOGGER.info("specificCompatibility=true: forces start mode to WARM and write the special parameters section in ech file"); parameters.setStartMode(EsgGeneralParameters.StartMode.WARM_START); specialParameters = new EsgSpecialParameters(); //WARM START: ZMIN_LOW specialParameters.setZmin(EsgSpecialParameters.ZMIN_LOW); } else { parameters.setStartMode(config.isLfWarmStart() ? EsgGeneralParameters.StartMode.WARM_START : EsgGeneralParameters.StartMode.FLAT_START); } EsgNetwork networkEch = eurostagEchExporterFactory.createEchExporter(network, exportConfig, parallelIndexes, dictionary, fakeNodes).createNetwork(parameters); networkModifier.hvLoadModelling(networkEch); new EsgWriter(networkEch, parameters, specialParameters).write(writer, network.getId() + "/" + network.getStateManager().getWorkingStateId()); } if (config.isDebug()) { dictionary.dump(workingDir.resolve("dict.csv")); } }
context.getOutputStream().println("specificCompatibility=true: forces start mode to WARM and write the special parameters section in ech file"); parameters.setStartMode(EsgGeneralParameters.StartMode.WARM_START); specialParameters = new EsgSpecialParameters();