/** * Load parameters from platform default config. */ public static SensitivityComputationParameters load() { return load(PlatformConfig.defaultConfig()); }
/** * Load parameters from platform default config. */ public static SecurityAnalysisParameters load() { return load(PlatformConfig.defaultConfig()); }
/** * Loads parameters from the default platform configuration. */ public static LoadFlowParameters load() { return load(PlatformConfig.defaultConfig()); }
public static SimulationDetailedParameters load(String fileName) { SimulationDetailedParameters parameters = null; Path file = PlatformConfig.defaultConfig().getConfigDir().resolve(fileName); if (Files.exists(file)) { parameters = new SimulationDetailedParameters(fileName); try (BufferedReader reader = Files.newBufferedReader(file, StandardCharsets.UTF_8)) { parse(reader, parameters); } catch (IOException e) { throw new UncheckedIOException(e); } } return parameters; }
public Map<String, BoundaryPoint> parseDefault() throws IOException { Path defaultBoundaryPoint = PlatformConfig.defaultConfig().getConfigDir().resolve("BoundaryPoint.xls"); if (!Files.exists(defaultBoundaryPoint)) { throw new PowsyblException("Boundary point sheet " + defaultBoundaryPoint + " not found"); } try (InputStream is = Files.newInputStream(defaultBoundaryPoint)) { return parse(is); } }
@Override public RulesDbClient create(String rulesDbName) { ModuleConfig config = PlatformConfig.defaultConfig().getModuleConfig("local-fs-rules-db"); Path dir = config.getPathProperty("dir").resolve(rulesDbName); try { Files.createDirectories(dir); } catch (IOException e) { throw new RuntimeException(e); } return new LocalFileSystemRulesDbClient(dir); }
private synchronized ModuleConfig getModuleConfig() { if (!init) { if (platformConfig == null) { platformConfig = PlatformConfig.defaultConfig(); } configCache = platformConfig.moduleExists(MODULE_NAME) ? platformConfig.getModuleConfig(MODULE_NAME) : null; init = true; } return configCache; }
private InputStream getTpBoundaryFile(ReadOnlyDataSource dataSource) throws IOException { if (dataSource.exists(TP_BOUNDARY_FILE_NAME)) { LOGGER.debug("Using custom TP boundary file"); return dataSource.newInputStream(TP_BOUNDARY_FILE_NAME); } else { Path path = PlatformConfig.defaultConfig().getConfigDir().resolve(TP_BOUNDARY_FILE_NAME); if (Files.exists(path)) { return Files.newInputStream(path); } else { throw new CIM1Exception("TP boundary file not found"); } } }
@Override public JsonSensitivityFactorsProvider create() { ModuleConfig config = PlatformConfig.defaultConfig().getModuleConfig("json-sensitivity-factors"); Path jsonFile = config.getPathProperty("json-file"); return new JsonSensitivityFactorsProvider(jsonFile); }
public static RedispatcherConfig load() { ModuleConfig config = PlatformConfig.defaultConfig().getModuleConfig("redispatcher"); float redispatchLimitsPercentage = config.getFloatProperty("redispatchLimitsPercentage"); return new RedispatcherConfig(redispatchLimitsPercentage); }
@Override public CsvFileModelicaContingenciesAndActionsDatabaseClient create() { ModuleConfig config = PlatformConfig.defaultConfig().getModuleConfig("csvcontingencydb"); Path csvFile = config.getPathProperty("csvFile"); return new CsvFileModelicaContingenciesAndActionsDatabaseClient(csvFile); }
public static ForecastErrorsDataStorageConfig load() { ModuleConfig config = PlatformConfig.defaultConfig().getModuleConfig("forecastErrorsStorage"); Path forecastErrorsDir = config.getPathProperty("forecastErrorsDir"); return new ForecastErrorsDataStorageConfig(forecastErrorsDir); }
@Override public ContingenciesAndActionsDatabaseClient create() { ModuleConfig config = PlatformConfig.defaultConfig().getModuleConfig("csvcontingencydb"); Path csvFile = config.getPathProperty("csvFile"); return new CsvFileContingenciesAndActionsDatabaseClient(csvFile); }
@Override public GroovyDslContingenciesProvider create() { ModuleConfig config = PlatformConfig.defaultConfig().getModuleConfig("groovy-dsl-contingencies"); Path dslFile = config.getPathProperty("dsl-file"); return new GroovyDslContingenciesProvider(dslFile); }
@Override public ContingenciesAndActionsDatabaseClient create() { ModuleConfig config = PlatformConfig.defaultConfig().getModuleConfig("xmlcontingencydb"); Path xmlFile = config.getPathProperty("xmlFile"); return create(xmlFile); }
public static OfflineUIConfig load() { ModuleConfig config = PlatformConfig.defaultConfig().getModuleConfig("offlineui"); String jmxHost = config.getStringProperty("jmxHost"); int jmxPort = config.getIntProperty("jmxPort"); return new OfflineUIConfig(jmxHost, jmxPort); }
public static MMapOfflineDbConfig load() { ModuleConfig config = PlatformConfig.defaultConfig().getModuleConfig("mmap-offlinedb"); Path directory = config.getPathProperty("directory"); int sampleChunkSize = config.getIntProperty("sampleChunkSize", DEFAULT_SAMPLE_CHUNK_SIZE); int maxSecurityIndexesCount = config.getIntProperty("maxSecurityIndexesCount", DEFAULT_MAX_SECURITY_INDEXES_COUNT); int maxNetworkAttributesCount = config.getIntProperty("maxNetworkAttributesCount", DEFAULT_MAX_NETWORK_ATTRIBUTES_COUNT); return new MMapOfflineDbConfig(directory, sampleChunkSize, maxSecurityIndexesCount, maxNetworkAttributesCount); }
public static MontecarloSamplerConfig load() { ModuleConfig config = PlatformConfig.defaultConfig().getModuleConfig("montecarloSampler"); Path binariesDir = config.getPathProperty("binariesDir"); Path runtimeHomeDir = config.getPathProperty("runtimeHomeDir"); Path tmpDir = config.getPathProperty("tmpDir"); int optionSign = config.getIntProperty("optionSign"); int centering = config.getIntProperty("centering"); Integer fullDependence = config.getOptionalIntegerProperty("full_dependence").orElse(null); boolean copyFEFile = config.getBooleanProperty("copyFEFile", true); boolean debug = config.getBooleanProperty("debug", false); return new MontecarloSamplerConfig(binariesDir, runtimeHomeDir, tmpDir, optionSign, centering, fullDependence, copyFEFile, debug); }
public static synchronized PostContLoadFlowSimConfig load() { ModuleConfig config = PlatformConfig.defaultConfig().getModuleConfig("postcont-loadflow-sim"); Class<? extends LoadFlowFactory> loadFlowFactoryClass = config.getClassProperty("loadFlowFactoryClass", LoadFlowFactory.class); boolean baseCaseConstraintsFiltered = config.getBooleanProperty("baseCaseConstraintsFiltered", false); boolean warnStartActivated = config.getBooleanProperty("warnStartActivated", false); float baseVoltageFilter = config.getFloatProperty("minBaseVoltageFilter", DEFAULT_MIN_BASE_VOLTAGE_FILTER); Security.CurrentLimitType currentLimitType = config.getEnumProperty("currentLimitType", Security.CurrentLimitType.class, DEFAULT_CURRENT_LIMITE_TYPE); float limitReduction = config.getFloatProperty("limitReduction", DEFAULT_LIMIT_REDUCTION); return new PostContLoadFlowSimConfig(loadFlowFactoryClass, baseCaseConstraintsFiltered, warnStartActivated, baseVoltageFilter, currentLimitType, limitReduction); }
public static OfflineWorkflowStartParameters load() { ModuleConfig config = PlatformConfig.defaultConfig().getModuleConfig("offline-default-start-parameters"); int duration = config.getIntProperty("duration", -1); int sampleQueueSize = config.getIntProperty("sampleQueueSize"); int samplingThreads = config.getIntProperty("samplingThreads"); int samplesPerThread = config.getIntProperty("samplesPerThread"); int stateQueueSize = config.getIntProperty("stateQueueSize", -1); int maxProcessedSamples = config.getIntProperty("maxProcessedSamples", -1); return new OfflineWorkflowStartParameters(sampleQueueSize, samplingThreads, samplesPerThread, stateQueueSize, duration, maxProcessedSamples); }