Package com.powsybl.loadflow
Interface LoadFlowProvider
- All Superinterfaces:
PlatformConfigNamedProvider
,Versionable
- All Known Implementing Classes:
AbstractNoSpecificParametersLoadFlowProvider
Service Provider Interface for loadflow implementations.
A loadflow provider is required to implement the main method run(com.powsybl.iidm.network.Network, com.powsybl.computation.ComputationManager, java.lang.String, com.powsybl.loadflow.LoadFlowParameters, com.powsybl.commons.report.ReportNode)
, in charge of actually
running a loadflow and updating the network variant with computed physical values.
It may, additionally, provide methods to support implementation-specific parameters.
Specific parameters should be implemented as an implementation of Extension<LoadFlowParameters>
.
- In order to support JSON serialization for those specific parameters,
implementing
getSpecificParametersSerializer()
is required. - In order to support loading specific parameters from platform configuration,
implementing
loadSpecificParameters(PlatformConfig)
is required.
- Author:
- Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.powsybl.commons.config.PlatformConfigNamedProvider
PlatformConfigNamedProvider.Finder
-
Method Summary
Modifier and TypeMethodDescriptionCreate a `Map` of parameter name / `String` value from implementation-specific parameters.static List<LoadFlowProvider>
findAll()
Get the parameters of the parameters extension associated with this provider.Optional<Class<? extends Extension<LoadFlowParameters>>>
Get specific parameters class.The serializer for implementation-specific parameters, orOptional.empty()
if the implementation does not have any specific parameters, or does not support JSON serialization.loadSpecificParameters
(PlatformConfig config) Reads implementation-specific parameters from platform config, or returnOptional.empty()
if the implementation does not have any specific parameters, or does not support loading from config.loadSpecificParameters
(Map<String, String> properties) Reads implementation-specific parameters from a Map, or returnOptional.empty()
if the implementation does not have any specific parameters, or does not support loading from config.run
(Network network, ComputationManager computationManager, String workingVariantId, LoadFlowParameters parameters, ReportNode reportNode) Run a loadflow on variantworkingVariantId
ofnetwork
delegating external program execution tocomputationManager
if necessary and using loadflow executionparameters
.void
updateSpecificParameters
(Extension<LoadFlowParameters> extension, Map<String, String> properties) Updates implementation-specific parameters from a Map.Methods inherited from interface com.powsybl.commons.config.PlatformConfigNamedProvider
getName, getPlatformConfigName
Methods inherited from interface com.powsybl.commons.Versionable
getName, getVersion
-
Method Details
-
findAll
-
run
CompletableFuture<LoadFlowResult> run(Network network, ComputationManager computationManager, String workingVariantId, LoadFlowParameters parameters, ReportNode reportNode) Run a loadflow on variantworkingVariantId
ofnetwork
delegating external program execution tocomputationManager
if necessary and using loadflow executionparameters
. This method is expected to be stateless so that it can be call simultaneously with different arguments (a different network for instance) without any concurrency issue.- Parameters:
network
- the networkcomputationManager
- a computation manager to external program executionworkingVariantId
- variant id of the networkparameters
- load flow execution parametersreportNode
- the reportNode used for functional logs- Returns:
- a
CompletableFuture
on {@link LoadFlowResult]
-
getSpecificParametersClass
Optional<Class<? extends Extension<LoadFlowParameters>>> getSpecificParametersClass()Get specific parameters class.- Returns:
- The specific parameters class
-
getSpecificParametersSerializer
Optional<ExtensionJsonSerializer> getSpecificParametersSerializer()The serializer for implementation-specific parameters, orOptional.empty()
if the implementation does not have any specific parameters, or does not support JSON serialization.Note that the actual serializer type should be
ExtensionJsonSerializer<LoadFlowParameters, MyParametersExtension>
whereMyParametersExtension
is the specific parameters class.- Returns:
- The serializer for implementation-specific parameters.
-
loadSpecificParameters
Reads implementation-specific parameters from platform config, or returnOptional.empty()
if the implementation does not have any specific parameters, or does not support loading from config.- Returns:
- The specific parameters read from platform config.
-
loadSpecificParameters
Reads implementation-specific parameters from a Map, or returnOptional.empty()
if the implementation does not have any specific parameters, or does not support loading from config.- Returns:
- The specific parameters read from Map.
-
createMapFromSpecificParameters
Create a `Map` of parameter name / `String` value from implementation-specific parameters. If the implementation does not have any specific parameters, `Map` is empty.- Parameters:
extension
- the specific parameters- Returns:
- A `Map` of parameter name / `String` value
-
updateSpecificParameters
void updateSpecificParameters(Extension<LoadFlowParameters> extension, Map<String, String> properties) Updates implementation-specific parameters from a Map. -
getSpecificParameters
Get the parameters of the parameters extension associated with this provider.- Returns:
- the parameters of the parameters extension associated with this provider.
-