class ParallelLoadFlowActionSimulator {

    public void run(String script, List<String> contingencyIds) {
        LOGGER.debug("Starting parallel action simulator.");

        ExecutionEnvironment itoolsEnvironment = new ExecutionEnvironment(Collections.emptyMap(), "subTask_", config.isDebug());

        int actualTaskCount = Math.min(taskCount, contingencyIds.size());
        CompletableFuture<SecurityAnalysisResult> future = computationManager.execute(itoolsEnvironment, new SubTaskHandler(actualTaskCount, script, contingencyIds));
        try {
            SecurityAnalysisResult result = future.get();
            resultHandlers.forEach(h -> h.accept(result));
        } catch (Exception e) {
            throw new PowsyblException(e);
        }
    }

    public  ParallelLoadFlowActionSimulator(Network network, ComputationManager cm, int taskCount);
    public  ParallelLoadFlowActionSimulator(Network network, ComputationManager cm, int taskCount, LoadFlowActionSimulatorConfig config,
                                           boolean applyIfSolved, Consumer<SecurityAnalysisResult>... resultHandlers);
    public  ParallelLoadFlowActionSimulator(Network network, ComputationManager cm, int taskCount, LoadFlowActionSimulatorConfig config,
                                           boolean applyIfSolved, List<Consumer<SecurityAnalysisResult>> resultHandlers);

}