Package com.powsybl.security.impl
Class DefaultSecurityAnalysisProvider
java.lang.Object
com.powsybl.security.impl.DefaultSecurityAnalysisProvider
- All Implemented Interfaces:
PlatformConfigNamedProvider
,Versionable
,SecurityAnalysisProvider
@AutoService(SecurityAnalysisProvider.class)
public class DefaultSecurityAnalysisProvider
extends Object
implements SecurityAnalysisProvider
- Author:
- Thomas Adam <tadam at silicom.fr>
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.powsybl.commons.config.PlatformConfigNamedProvider
PlatformConfigNamedProvider.Finder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetName()
Get the name.run
(Network network, String workingVariantId, LimitViolationDetector detector, LimitViolationFilter filter, ComputationManager computationManager, SecurityAnalysisParameters parameters, ContingenciesProvider contingenciesProvider, List<SecurityAnalysisInterceptor> interceptors, List<OperatorStrategy> operatorStrategies, List<Action> actions, List<StateMonitor> monitors, List<LimitReduction> limitReductions, ReportNode reportNode) Run an asynchronous single security analysis job.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.powsybl.commons.config.PlatformConfigNamedProvider
getPlatformConfigName
Methods inherited from interface com.powsybl.security.SecurityAnalysisProvider
getLoadFlowProviderName, getSpecificParametersNames, getSpecificParametersSerializer, loadSpecificParameters, loadSpecificParameters, updateSpecificParameters
-
Constructor Details
-
DefaultSecurityAnalysisProvider
public DefaultSecurityAnalysisProvider()
-
-
Method Details
-
run
public CompletableFuture<SecurityAnalysisReport> run(Network network, String workingVariantId, LimitViolationDetector detector, LimitViolationFilter filter, ComputationManager computationManager, SecurityAnalysisParameters parameters, ContingenciesProvider contingenciesProvider, List<SecurityAnalysisInterceptor> interceptors, List<OperatorStrategy> operatorStrategies, List<Action> actions, List<StateMonitor> monitors, List<LimitReduction> limitReductions, ReportNode reportNode) Description copied from interface:SecurityAnalysisProvider
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; }
- Specified by:
run
in interfaceSecurityAnalysisProvider
- Parameters:
network
- IIDM network on which the security analysis will be performedworkingVariantId
- network variant ID on which the analysis will be performedparameters
- specific security analysis parameterscontingenciesProvider
- provides list of contingenciesmonitors
- stateMonitor that defines the branch bus and threeWindingsTransformer about which informations will be written after security analysislimitReductions
- list of the limit reductions to applyreportNode
- the reportNode used for functional logs- Returns:
- a
CompletableFuture
onSecurityAnalysisResult
that gathers security factor values
-
getName
Description copied from interface:PlatformConfigNamedProvider
Get the name.- Specified by:
getName
in interfacePlatformConfigNamedProvider
- Specified by:
getName
in interfaceVersionable
- Returns:
- the name
-
getVersion
- Specified by:
getVersion
in interfaceVersionable
-