-
- All Superinterfaces:
com.powsybl.commons.config.PlatformConfigNamedProvider
,com.powsybl.commons.Versionable
public interface LoadFlowProvider extends com.powsybl.commons.Versionable, com.powsybl.commons.config.PlatformConfigNamedProvider
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)
, 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
.- 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
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Deprecated Methods Modifier and Type Method Description static List<LoadFlowProvider>
findAll()
default List<com.powsybl.commons.parameters.Parameter>
getSpecificParameters()
Get the list of the specific parameters.default List<String>
getSpecificParametersNames()
Deprecated.UsegetSpecificParameters()
instead.default Optional<com.powsybl.commons.extensions.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.default Optional<com.powsybl.commons.extensions.Extension<LoadFlowParameters>>
loadSpecificParameters(com.powsybl.commons.config.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.default Optional<com.powsybl.commons.extensions.Extension<LoadFlowParameters>>
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.default CompletableFuture<LoadFlowResult>
run(Network network, ComputationManager computationManager, String workingVariantId, LoadFlowParameters parameters)
Run a loadflow on variantworkingVariantId
ofnetwork
delegating external program execution tocomputationManager
if necessary and using loadflow executionparameters
.default CompletableFuture<LoadFlowResult>
run(Network network, ComputationManager computationManager, String workingVariantId, LoadFlowParameters parameters, com.powsybl.commons.reporter.Reporter reporter)
Run a loadflow on variantworkingVariantId
ofnetwork
delegating external program execution tocomputationManager
if necessary and using loadflow executionparameters
.default void
updateSpecificParameters(com.powsybl.commons.extensions.Extension<LoadFlowParameters> extension, Map<String,String> properties)
Updates implementation-specific parameters from a Map.
-
-
-
Method Detail
-
findAll
static List<LoadFlowProvider> findAll()
-
run
default CompletableFuture<LoadFlowResult> run(Network network, ComputationManager computationManager, String workingVariantId, LoadFlowParameters parameters)
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 parameters- Returns:
- a
CompletableFuture
on {@link LoadFlowResult]
-
run
default CompletableFuture<LoadFlowResult> run(Network network, ComputationManager computationManager, String workingVariantId, LoadFlowParameters parameters, com.powsybl.commons.reporter.Reporter reporter)
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 parametersreporter
- the reporter used for functional logs- Returns:
- a
CompletableFuture
on {@link LoadFlowResult]
-
getSpecificParametersSerializer
default Optional<com.powsybl.commons.extensions.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
default Optional<com.powsybl.commons.extensions.Extension<LoadFlowParameters>> loadSpecificParameters(com.powsybl.commons.config.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.- Returns:
- The specific parameters read from platform config.
-
loadSpecificParameters
default Optional<com.powsybl.commons.extensions.Extension<LoadFlowParameters>> 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.- Returns:
- The specific parameters read from Map.
-
updateSpecificParameters
default void updateSpecificParameters(com.powsybl.commons.extensions.Extension<LoadFlowParameters> extension, Map<String,String> properties)
Updates implementation-specific parameters from a Map.
-
getSpecificParametersNames
@Deprecated default List<String> getSpecificParametersNames()
Deprecated.UsegetSpecificParameters()
instead.Get the list of the specific parameters names.- Returns:
- the list of the specific parameters names.
-
getSpecificParameters
default List<com.powsybl.commons.parameters.Parameter> getSpecificParameters()
Get the list of the specific parameters.- Returns:
- the list of the specific parameters.
-
-