AmplNetworkWriter { private void writePhaseTapChanger(TableFormatter formatter, String id, double zb2, double reactance, PhaseTapChanger ptc) throws IOException { int num = mapper.getInt(AmplSubset.TAP_CHANGER_TABLE, id); for (int position = ptc.getLowTapPosition(); position <= ptc.getHighTapPosition(); position++) { PhaseTapChangerStep step = ptc.getStep(position); double x = reactance * (1 + step.getX() / 100) / zb2; formatter.writeCell(variantIndex) .writeCell(num) .writeCell(position - ptc.getLowTapPosition() + 1) .writeCell(step.getRho()) .writeCell(x) .writeCell(Math.toRadians(step.getAlpha())) .writeCell(faultNum) .writeCell(actionNum); } } 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 writePhaseTapChanger() throws IOException { Network network = PhaseShifterTestCaseFactory.create(); MemDataSource dataSource = new MemDataSource(); export(network, dataSource); assertEqualsToRef(dataSource, "_network_ptc", "inputs/ptc-test-case.txt"); }