-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AMPL executor #2455
AMPL executor #2455
Conversation
extract modifications to the network Signed-off-by: Nicolas PIERRE <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas PIERRE <nicolas.pierre@artelys.com>
basic AmplConfig and AmplResult Signed-off-by: Nicolas PIERRE <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas PIERRE <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas PIERRE <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas PIERRE <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas PIERRE <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas PIERRE <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
…ustomization Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
ampl-converter/src/main/java/com/powsybl/ampl/converter/AbstractNetworkApplierFactory.java
Outdated
Show resolved
Hide resolved
ampl-converter/src/main/java/com/powsybl/ampl/converter/AbstractNetworkApplierFactory.java
Outdated
Show resolved
Hide resolved
ampl-converter/src/main/java/com/powsybl/ampl/converter/AmplNetworkReader.java
Outdated
Show resolved
Hide resolved
ampl-converter/src/main/java/com/powsybl/ampl/converter/AmplNetworkReader.java
Outdated
Show resolved
Hide resolved
ampl-converter/src/main/java/com/powsybl/ampl/converter/AmplReadableElement.java
Outdated
Show resolved
Hide resolved
ampl-executor/src/test/java/com/powsybl/ampl/executor/DummyAmplModel.java
Outdated
Show resolved
Hide resolved
ampl-executor/src/test/java/com/powsybl/ampl/executor/AmplModelExecutionHandlerTest.java
Outdated
Show resolved
Hide resolved
ampl-executor/src/test/java/com/powsybl/ampl/executor/AmplConfigTest.java
Outdated
Show resolved
Hide resolved
ampl-executor/src/test/java/com/powsybl/ampl/executor/AmplConfigTest.java
Outdated
Show resolved
Hide resolved
* @param networkAmplMapper Mapper to convert {@link com.powsybl.iidm.network.Network} IDs to Ampl IDs | ||
* and vice versa | ||
*/ | ||
void read(Path outputPath, StringToIntMapper<AmplSubset> networkAmplMapper) throws IOException; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure we need to known the file name here? why not just
void read(Path workingDir, StringToIntMapper<AmplSubset> networkAmplMapper) throws IOException
Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
PR can be checked again for merge. @geofjamg |
@@ -0,0 +1,9 @@ | |||
package com.powsybl.ampl.converter; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
licence + author
*/ | ||
public interface AmplNetworkUpdater { | ||
|
||
void applyGenerators(Generator g, int busNum, boolean vregul, double targetV, double targetP, double targetQ, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to updateGenerators?
ampl-executor/pom.xml
Outdated
@@ -0,0 +1,100 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!-- | |||
Copyright (c) 2017, RTE (http://www.rte-france.com) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Year to update
moduleConfig.setStringProperty("homeDir", "/home/test/ampl"); | ||
AmplConfig cfg = AmplConfig.load(platformConfig); | ||
assertEquals("/home/test/ampl", cfg.getAmplHome(), "Error parsing Ampl Home"); | ||
fs.close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you close it with try(...) ?
assertTrue(amplState.isSuccess(), "AmplResult must be OK."); | ||
} | ||
// Test cleaning | ||
fs.close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you close it with try(...) ?
…t, try with ressources Signed-off-by: Nicolas Pierre <nicolas.pierre@artelys.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Kudos, SonarCloud Quality Gate passed! |
Please check if the PR fulfills these requirements (please use
'[x]'
to check the checkboxes, or submit the PR and then click the checkboxes)Does this PR already have an issue describing the problem ? If so, link to this issue using
'#XXX'
and skip the restNot yet, but one might be created.
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
feature
What is the new behavior (if this is a feature change)?
We want to have a flexible way to run a AMPL model on a network and apply the results on the network.
The current interface is :
IAmplModel
to tell how the model works and interface itself with the import/export functions of the ampl-converter moduleAmplModelRunner
See here for use case.