Package com.powsybl.security
Interface SecurityAnalysisProvider
-
- All Superinterfaces:
com.powsybl.commons.config.PlatformConfigNamedProvider
,com.powsybl.commons.Versionable
public interface SecurityAnalysisProvider extends com.powsybl.commons.Versionable, com.powsybl.commons.config.PlatformConfigNamedProvider
ASecurityAnalysisProvider
is a power system computation which computes, for aNetwork
, theLimitViolations
on N-situation and the ones caused by a specified list ofContingencies
.Computation results are provided asynchronously as a
SecurityAnalysisResult
.Implementations of that interface may typically rely on an external tool.
Interceptors
might be used to execute client user-specific code on events such as the availability of N-situation results, for example to further customize the results content throughExtensions
.- Author:
- Thomas Adam
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static List<SecurityAnalysisProvider>
findAll()
default Optional<String>
getLoadFlowProviderName()
default List<String>
getSpecificParametersNames()
get the list of the specific parameters names.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<SecurityAnalysisParameters>>
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<SecurityAnalysisParameters>>
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.CompletableFuture<SecurityAnalysisReport>
run(Network network, String workingVariantId, LimitViolationDetector detector, LimitViolationFilter filter, com.powsybl.computation.ComputationManager computationManager, SecurityAnalysisParameters parameters, ContingenciesProvider contingenciesProvider, List<SecurityAnalysisInterceptor> interceptors, List<OperatorStrategy> operatorStrategies, List<Action> actions, List<StateMonitor> monitors, com.powsybl.commons.reporter.Reporter reporter)
Run an asynchronous single security analysis job.default void
updateSpecificParameters(com.powsybl.commons.extensions.Extension<SecurityAnalysisParameters> extension, Map<String,String> properties)
Updates implementation-specific parameters from a Map.
-
-
-
Method Detail
-
findAll
static List<SecurityAnalysisProvider> findAll()
-
run
CompletableFuture<SecurityAnalysisReport> run(Network network, String workingVariantId, LimitViolationDetector detector, LimitViolationFilter filter, com.powsybl.computation.ComputationManager computationManager, SecurityAnalysisParameters parameters, ContingenciesProvider contingenciesProvider, List<SecurityAnalysisInterceptor> interceptors, List<OperatorStrategy> operatorStrategies, List<Action> actions, List<StateMonitor> monitors, com.powsybl.commons.reporter.Reporter reporter)
Run an asynchronous single security analysis job.if there are exceptions thrown. But the original exception would be wrapped in
ComputationException
, and those .out/.err log file's contents are be collected in theComputationException
too.try { SecurityAnalysisResult result = securityAnalysis.run(network, variantId, detector, filter, computationManager, parameters, contingenciesProvider, interceptors).join(); } catch (CompletionException e) { if (e.getCause() instanceof ComputationException) { ComputationException computationException = (ComputationException) e.getCause(); System.out.println("Consume exception..."); computationException.getOutLogs().forEach((name, content) -> { System.out.println("-----" + name + "----"); System.out.println(content); }); computationException.getErrLogs().forEach((name, content) -> { System.out.println("-----" + name + "----"); System.out.println(content); }); } throw e; }
- Parameters:
network
- IIDM network on which the security analysis will be performedworkingVariantId
- network variant ID on which the analysis will be performeddetector
-filter
-computationManager
-parameters
- specific security analysis parameterscontingenciesProvider
- provides list of contingenciesinterceptors
-monitors
- stateMonitor that defines the branch bus and threeWindingsTransformer about which informations will be written after security analysisreporter
- the reporter used for functional logs- Returns:
- a
CompletableFuture
onSecurityAnalysisResult
that gathers security factor values
-
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<SecurityAnalysisParameters, MyParametersExtension>
whereMyParametersExtension
is the specific parameters class.- Returns:
- The serializer for implementation-specific parameters.
-
loadSpecificParameters
default Optional<com.powsybl.commons.extensions.Extension<SecurityAnalysisParameters>> 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<SecurityAnalysisParameters>> 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<SecurityAnalysisParameters> extension, Map<String,String> properties)
Updates implementation-specific parameters from a Map.
-
getLoadFlowProviderName
default Optional<String> getLoadFlowProviderName()
- Returns:
- The name of the loadflow used for the security analysis.
-
-