@Override public void run(CommandLine line, ToolRunningContext context) throws Exception { Path caseFile = Paths.get(line.getOptionValue("case-file")); Path outputFolder = Paths.get(line.getOptionValue("output-folder")); Interval histoInterval = Interval.parse(line.getOptionValue("histo-interval")); if (Files.isRegularFile(caseFile)) { System.out.println("loading case " + caseFile); // load the network Network network = Importers.loadNetwork(caseFile); if (network == null) { throw new RuntimeException("Case '" + caseFile + "' not found"); } network.getStateManager().allowStateMultiThreadAccess(true); createMat(network, histoInterval, outputFolder); } else { throw new RuntimeException("Case '" + caseFile + "' is not a valid basecase file"); } }
@Override public void run(CommandLine line, ToolRunningContext context) throws Exception { Path caseFile = Paths.get(line.getOptionValue("case-file")); Path outputFolder = Paths.get(line.getOptionValue("output-folder")); if (Files.isRegularFile(caseFile)) { System.out.println("loading case " + caseFile); // load the network Network network = Importers.loadNetwork(caseFile); if (network == null) { throw new RuntimeException("Case '" + caseFile + "' not found"); } network.getStateManager().allowStateMultiThreadAccess(true); createMat(network, outputFolder); } else if (Files.isDirectory(caseFile)) { Importers.loadNetworks(caseFile, false, network -> { try { createMat(network, outputFolder); } catch (Exception e) { e.printStackTrace(); } }, dataSource -> System.out.println("loading case " + dataSource.getBaseName())); } }
throw new RuntimeException("Case '" + caseFile + "' not found"); network.getStateManager().allowStateMultiThreadAccess(true);
throw new RuntimeException("Case '" + caseFile + "' not found"); network.getStateManager().allowStateMultiThreadAccess(true);
throw new RuntimeException("Case '" + caseFile + "' not found"); network.getStateManager().allowStateMultiThreadAccess(true);
throw new RuntimeException("Case '" + caseFile + "' not found"); network.getStateManager().allowStateMultiThreadAccess(true);
throw new RuntimeException("Case '" + caseFile + "' not found"); network.getStateManager().allowStateMultiThreadAccess(true); network.getStateManager().allowStateMultiThreadAccess(true); String baseStateId = network.getId(); network.getStateManager().cloneState(StateManagerConstants.INITIAL_STATE_ID, baseStateId);
throw new RuntimeException("Case '" + caseFile + "' not found"); network.getStateManager().allowStateMultiThreadAccess(true);
throw new RuntimeException("Case '" + caseFile + "' not found"); network.getStateManager().allowStateMultiThreadAccess(true);
network.getStateManager().allowStateMultiThreadAccess(true); String baseStateId = network.getId(); network.getStateManager().cloneState(StateManagerConstants.INITIAL_STATE_ID, baseStateId);
.collect(Collectors.toSet()); network.getStateManager().allowStateMultiThreadAccess(true); WCAParameters wcaParameters = new WCAParameters(histoInterval, offlineWorkflowId, securityIndexTypes, purityThreshold); ContingenciesAndActionsDatabaseClient contingenciesDb = config.getContingencyDbClientFactoryClass().newInstance().create();
throw new RuntimeException("Case '" + caseFile + "' not found"); network.getStateManager().allowStateMultiThreadAccess(true);
context.network.getStateManager().allowStateMultiThreadAccess(true); context.network.getStateManager().cloneState(StateManagerConstants.INITIAL_STATE_ID, getCaseId(caseNum)); context.network.getStateManager().setWorkingState(getCaseId(caseNum));
network.getStateManager().allowStateMultiThreadAccess(true); network.getStateManager().setWorkingState(StateManagerConstants.INITIAL_STATE_ID);
network.getStateManager().allowStateMultiThreadAccess(true);