Package com.powsybl.ampl.executor
Interface AmplModel
- All Known Implementing Classes:
AbstractAmplModel
public interface AmplModel
Interface to represent an Ampl model to run on a network.
The AMPL must read/write files according to
AmplExporter
/AmplNetworkReader
.
Some customization is available through :
getOutputFilePrefix()
: prefix for the files written by the Ampl executiongetNetworkUpdaterFactory()
: specific applier Factory to select what is modified on the networkgetVariant()
: Ampl variantsgetOutputFormat()
: some information about the format of the output filesgetNetworkDataPrefix()
: the prefix used to every network input files
- Author:
- Nicolas Pierre <[email protected]>
-
Method Summary
Modifier and TypeMethodDescriptionboolean
checkModelConvergence
(Map<String, String> metrics) From the metrics read, tells if the model has converged or not.List<org.apache.commons.lang3.tuple.Pair<String,
InputStream>> int
-
Method Details
-
getModelAsStream
List<org.apache.commons.lang3.tuple.Pair<String,InputStream>> getModelAsStream()- Returns:
- each pair contains the name, and the InputStream of every ampl file of the model (.run .dat .mod)
-
getAmplRunFiles
- Returns:
- the list of the files to run in Ampl (.run files)
-
getOutputFilePrefix
String getOutputFilePrefix() -
getNetworkUpdaterFactory
AmplNetworkUpdaterFactory getNetworkUpdaterFactory() -
getVariant
int getVariant()- Returns:
- network variant to export for the Ampl solve
-
getOutputFormat
OutputFileFormat getOutputFormat() -
getNetworkDataPrefix
String getNetworkDataPrefix() -
getAmplReadableElement
Collection<AmplReadableElement> getAmplReadableElement()- Returns:
- list of
AmplReadableElement
to read after the Ampl run, it implies that the Ampl model outputs these files with the correct format
-
checkModelConvergence
From the metrics read, tells if the model has converged or not.- Parameters:
metrics
- output written by the ampl model- Returns:
true
if the metrics indicates that the ampl converged.- See Also:
-