Interface SecurityAnalysisProvider

    • Method Detail

      • run

        default CompletableFuture<SecurityAnalysisReport> run​(Network network,
                                                              String workingVariantId,
                                                              LimitViolationDetector detector,
                                                              LimitViolationFilter filter,
                                                              ComputationManager computationManager,
                                                              SecurityAnalysisParameters parameters,
                                                              ContingenciesProvider contingenciesProvider,
                                                              List<SecurityAnalysisInterceptor> interceptors)
        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 the ComputationException 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 performed
        workingVariantId - network variant ID on which the analysis will be performed
        detector -
        filter -
        computationManager -
        parameters - specific security analysis parameters
        contingenciesProvider - provides list of contingencies
        interceptors -
        Returns:
        a CompletableFuture on SecurityAnalysisResult that gathers security factor values
      • run

        default CompletableFuture<SecurityAnalysisReport> run​(Network network,
                                                              String workingVariantId,
                                                              LimitViolationDetector detector,
                                                              LimitViolationFilter filter,
                                                              ComputationManager computationManager,
                                                              SecurityAnalysisParameters parameters,
                                                              ContingenciesProvider contingenciesProvider,
                                                              List<SecurityAnalysisInterceptor> interceptors,
                                                              List<StateMonitor> monitors)
        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 the ComputationException 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 performed
        workingVariantId - network variant ID on which the analysis will be performed
        detector -
        filter -
        computationManager -
        parameters - specific security analysis parameters
        contingenciesProvider - provides list of contingencies
        interceptors -
        monitors - stateMonitor that defines the branch bus and threeWindingsTransformer about which informations will be written after security analysis
        Returns:
        a CompletableFuture on SecurityAnalysisResult that gathers security factor values