Package com.powsybl.security.distributed
Class DistributedSecurityAnalysis
- java.lang.Object
-
- com.powsybl.security.distributed.ExternalSecurityAnalysis
-
- com.powsybl.security.distributed.DistributedSecurityAnalysis
-
- All Implemented Interfaces:
SecurityAnalysis
@Deprecated public class DistributedSecurityAnalysis extends ExternalSecurityAnalysis
Deprecated.Use insteadDistributedSecurityAnalysisExecution
, which clarifies the input data for that kind of execution, and tries to differentiate more between aSecurityAnalysis
and its mode of execution.Security analysis implementation which distributes the work through X executions of the "itools security-analysis" command.- Author:
- Sylvain Leclerc
-
-
Field Summary
-
Fields inherited from class com.powsybl.security.distributed.ExternalSecurityAnalysis
computationManager, config, extensions, network, taskCount
-
-
Constructor Summary
Constructors Constructor Description DistributedSecurityAnalysis(ExternalSecurityAnalysisConfig config, Network network, ComputationManager computationManager, List<String> extensions, int taskCount)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CompletableFuture<SecurityAnalysisResult>
run(String workingVariantId, SecurityAnalysisParameters parameters, ContingenciesProvider contingenciesProvider)
Deprecated.CompletableFuture<SecurityAnalysisResultWithLog>
runWithLog(String workingVariantId, SecurityAnalysisParameters parameters, ContingenciesProvider contingenciesProvider)
Deprecated.To be consistent withSecurityAnalysis.run(String, SecurityAnalysisParameters, ContingenciesProvider)
, this method would also complete exceptionally if there are exceptions thrown.-
Methods inherited from class com.powsybl.security.distributed.ExternalSecurityAnalysis
addInterceptor, buildInput, removeInterceptor
-
-
-
-
Constructor Detail
-
DistributedSecurityAnalysis
public DistributedSecurityAnalysis(ExternalSecurityAnalysisConfig config, Network network, ComputationManager computationManager, List<String> extensions, int taskCount)
Deprecated.
-
-
Method Detail
-
run
public CompletableFuture<SecurityAnalysisResult> run(String workingVariantId, SecurityAnalysisParameters parameters, ContingenciesProvider contingenciesProvider)
Deprecated.- Specified by:
run
in interfaceSecurityAnalysis
- Overrides:
run
in classExternalSecurityAnalysis
-
runWithLog
public CompletableFuture<SecurityAnalysisResultWithLog> runWithLog(String workingVariantId, SecurityAnalysisParameters parameters, ContingenciesProvider contingenciesProvider)
Deprecated.Description copied from interface:SecurityAnalysis
To be consistent withSecurityAnalysis.run(String, SecurityAnalysisParameters, ContingenciesProvider)
, this method would also complete exceptionally if there are exceptions thrown. But the original exception would be wrapped inComputationException
, and those .out/.err log file's contents are be collected in theComputationException
too.try { SecurityAnalysisResultWithLog resultWithLog = securityAnalysis.runWithLog(currentState, parameters, contingenciesProvider).join(); result = resultWithLog.getResult(); } 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; }
- Returns:
-
-