AmplNetworkWriter { private void writeCurrentLimits() throws IOException { try (Writer writer = new OutputStreamWriter(dataSource.newOutputStream("_network_limits", "txt", append), StandardCharsets.UTF_8); TableFormatter formatter = new AmplDatTableFormatter(writer, getTableTitle("Temporary current limits"), AmplConstants.INVALID_FLOAT_VALUE, !append, AmplConstants.LOCALE, new Column(VARIANT), new Column(NUM), new Column("branch"), new Column("side"), new Column("limit (A)"), new Column("accept. duration (s)"), new Column(FAULT), new Column(config.getActionType().getLabel()))) { writeBranchCurrentLimits(formatter); writeThreeWindingsTransformerCurrentLimits(formatter); writeDanglingLineCurrentLimits(formatter); } } AmplNetworkWriter(Network network, int variantIndex, DataSource dataSource, int faultNum, int actionNum,
                             boolean append, StringToIntMapper<AmplSubset> mapper, AmplExportConfig config);  AmplNetworkWriter(Network network, DataSource dataSource, int faultNum, int actionNum,
                             boolean append, StringToIntMapper<AmplSubset> mapper, AmplExportConfig config);  AmplNetworkWriter(Network network, DataSource dataSource, StringToIntMapper<AmplSubset> mapper,
                             AmplExportConfig config);  AmplNetworkWriter(Network network, DataSource dataSource, AmplExportConfig config); static String getTableTitle(Network network, String tableName); void write(); void write(AmplExportContext context);  }
@Test public void writeCurrentLimits() throws IOException { Network network = EurostagTutorialExample1Factory.createWithCurrentLimits(); MemDataSource dataSource = new MemDataSource(); export(network, dataSource); assertEqualsToRef(dataSource, "_network_limits", "inputs/current-limits-test-case.txt"); }