Skip to content

Commit

Permalink
Merge pull request #151 from itesla/wca_domains_preventive_actions
Browse files Browse the repository at this point in the history
WCA: Added preventive actions to 'domains' task input
  • Loading branch information
mathbagu committed Nov 30, 2016
2 parents 0156b5a + 152c057 commit 76b8332
Show file tree
Hide file tree
Showing 14 changed files with 1,204 additions and 1,105 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Copyright (c) 2016, All partners of the iTesla project (http://www.itesla-project.eu/consortium)
* Copyright (c) 2016, RTE (http://www.rte-france.com)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
Expand All @@ -17,20 +18,38 @@ public enum ExportScope {
ONLY_MAIN_CC_AND_CONNECTABLE_GENERATORS_AND_SHUNTS,
ONLY_MAIN_CC_AND_CONNECTABLE_GENERATORS_AND_SHUNTS_AND_ALL_LOADS,
}

public enum ExportActionType {
CURATIVE("curative"),
PREVENTIVE("preventive");

private final String label;

private ExportActionType(String label) {
this.label = label;
}

public String getLabel() {
return label;
}
}

private ExportScope exportScope;

private boolean exportXNodes;

private ExportActionType actionType;

private boolean exportRatioTapChangerVoltageTarget;

public AmplExportConfig(ExportScope exportScope, boolean exportXNodes) {
this(exportScope, exportXNodes, false);
public AmplExportConfig(ExportScope exportScope, boolean exportXNodes, ExportActionType actionType) {
this(exportScope, exportXNodes, actionType, false);
}

public AmplExportConfig(ExportScope exportScope, boolean exportXNodes, boolean exportRatioTapChangerVoltageTarget) {
public AmplExportConfig(ExportScope exportScope, boolean exportXNodes, ExportActionType actionType, boolean exportRatioTapChangerVoltageTarget) {
this.exportScope = exportScope;
this.exportXNodes = exportXNodes;
this.actionType = actionType;
this.exportRatioTapChangerVoltageTarget = exportRatioTapChangerVoltageTarget;
}

Expand All @@ -50,6 +69,10 @@ public void setExportXNodes(boolean exportXNodes) {
this.exportXNodes = exportXNodes;
}

public ExportActionType getActionType() {
return actionType;
}

public boolean isExportRatioTapChangerVoltageTarget() {
return exportRatioTapChangerVoltageTarget;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Copyright (c) 2016, All partners of the iTesla project (http://www.itesla-project.eu/consortium)
* Copyright (c) 2016, RTE (http://www.rte-france.com)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
Expand Down Expand Up @@ -37,7 +38,7 @@ public void export(Network network, Properties parameters, DataSource dataSource
throw new ITeslaException("network is null");
}
try {
new AmplNetworkWriter(network, dataSource, new AmplExportConfig(AmplExportConfig.ExportScope.ONLY_MAIN_CC_AND_CONNECTABLE_GENERATORS_AND_SHUNTS, false)).write();
new AmplNetworkWriter(network, dataSource, new AmplExportConfig(AmplExportConfig.ExportScope.ONLY_MAIN_CC_AND_CONNECTABLE_GENERATORS_AND_SHUNTS, false, AmplExportConfig.ExportActionType.CURATIVE)).write();
} catch (IOException e) {
throw new ITeslaException(e);
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Copyright (c) 2016, All partners of the iTesla project (http://www.itesla-project.eu/consortium)
* Copyright (c) 2016, RTE (http://www.rte-france.com)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
Expand All @@ -26,7 +27,8 @@ public enum AmplSubset implements IntCounter {
TEMPORARY_CURRENT_LIMIT(1),
THREE_WINDINGS_TRANSFO(1),
FAULT(1),
CURATIVE_ACTION(1);
CURATIVE_ACTION(1),
PREVENTIVE_ACTION(1);

private final int initialValue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void write() throws Exception {
Network network = EurostagTutorialExample1Factory.create();

MemDataSource dataSource = new MemDataSource();
new AmplNetworkWriter(network, dataSource, new AmplExportConfig(AmplExportConfig.ExportScope.ALL, true))
new AmplNetworkWriter(network, dataSource, new AmplExportConfig(AmplExportConfig.ExportScope.ALL, true, AmplExportConfig.ExportActionType.CURATIVE))
.write();

assertEqualsToRef(dataSource, "_network_substations", "eurostag-tutorial-example1-substations.txt");
Expand Down

0 comments on commit 76b8332

Please sign in to comment.