public static LoadFlowResultsCompletionParameters load(PlatformConfig platformConfig) { Objects.requireNonNull(platformConfig); return platformConfig.getOptionalModuleConfig("loadflow-results-completion-parameters") .map(config -> { float epsilonX = config.getFloatProperty("epsilon-x", LoadFlowResultsCompletionParameters.EPSILON_X_DEFAULT); boolean applyReactanceCorrection = config.getBooleanProperty("apply-reactance-correction", LoadFlowResultsCompletionParameters.APPLY_REACTANCE_CORRECTION_DEFAULT); return new LoadFlowResultsCompletionParameters(epsilonX, applyReactanceCorrection); }) .orElseGet(() -> new LoadFlowResultsCompletionParameters(LoadFlowResultsCompletionParameters.EPSILON_X_DEFAULT, LoadFlowResultsCompletionParameters.APPLY_REACTANCE_CORRECTION_DEFAULT)); }
public static RedispatcherConfig load() { ModuleConfig config = PlatformConfig.defaultConfig().getModuleConfig("redispatcher"); float redispatchLimitsPercentage = config.getFloatProperty("redispatchLimitsPercentage"); return new RedispatcherConfig(redispatchLimitsPercentage); }
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 WCAConfig load(PlatformConfig platformConfig) { ModuleConfig config = platformConfig.getModuleConfig("wca"); Path xpressHome = config.getPathProperty("xpressHome"); float reducedVariableRatio = config.getFloatProperty("reducedVariableRatio", DEFAULT_REDUCED_VARIABLE_RATIO); boolean debug = config.getBooleanProperty("debug", DEFAULT_DEBUG); boolean exportStates = config.getBooleanProperty("exportStates", DEFAULT_EXPORT_STATE); Set<WCARestrictingThresholdLevel> restrictingThresholdLevels = config.getEnumSetProperty("restrictingThresholdLevels", WCARestrictingThresholdLevel.class, DEFAULT_RESTRICTING_THRESHOLD_LEVELS); float margin = Float.parseFloat(config.getStringProperty("margin", Float.toString(DEFAULT_MARGIN))); boolean ignoreVoltageConstraints = config.getBooleanProperty("ignoreVoltageConstraints", DEFAULT_IGNORE_VOLTAGE_CONSTRAINTS); boolean activateFiltering = config.getBooleanProperty("activateFiltering", DEFAULT_ACTIVATE_FILTERING); WCAPreventiveActionsFilter preventiveActionsFilter = config.getEnumProperty("preventiveActionsFilter", WCAPreventiveActionsFilter.class, DEFAULT_PREVENTIVE_ACTIONS_FILTER); WCAPreventiveActionsOptimizer preventiveActionsOptimizer = config.getEnumProperty("preventiveActionsOptimizer", WCAPreventiveActionsOptimizer.class, DEFAULT_PREVENTIVE_ACTIONS_OPTIMIZER); boolean applyPreventiveActions = config.getBooleanProperty("applyPreventiveActions", DEFAULT_APPLY_PREVENTIVE_ACTIONS); WCACurativeActionsOptimizer curativeActionsOptimizer = config.getEnumProperty("curativeActionsOptimizer", WCACurativeActionsOptimizer.class, DEFAULT_CURATIVE_ACTIONS_OPTIMIZER); float voltageLevelConstraintFilter = Float.parseFloat(config.getStringProperty("voltageLevelConstraintFilter", Float.toString(DEFAULT_VOLTAGE_LEVEL_CONSTRAINTS_FILTER))); Set<Country> countryConstraintFilter = config.getEnumSetProperty("countryConstraintFilter", Country.class, new HashSet<Country>(DEFAULT_COUNTRY_CONSTRAINTS_FILTER)); boolean filterPreventiveActions = config.getBooleanProperty("filterPreventiveActions", DEFAULT_FILTER_PREVENTIVE_ACTIONS); boolean filterCurativeActions = config.getBooleanProperty("filterCurativeActions", DEFAULT_FILTER_CURATIVE_ACTIONS); boolean loosenConstraints = config.getBooleanProperty("loosenConstraints", DEFAULT_LOOOSEN_CONSTRAINTS); return new WCAConfig(xpressHome, reducedVariableRatio, debug, exportStates, restrictingThresholdLevels, margin, ignoreVoltageConstraints, activateFiltering, preventiveActionsFilter, preventiveActionsOptimizer, applyPreventiveActions, curativeActionsOptimizer, voltageLevelConstraintFilter, countryConstraintFilter, filterPreventiveActions, filterCurativeActions, loosenConstraints); }
public static UncertaintiesAnalysisConfig load(PlatformConfig platformConfig) { boolean onlyIntermittentGeneration = DEFAULT_ONLY_INTERMITTENT_GENERATION; float prctRisk = DEFAULT_PRCT_RISK; boolean withBoundaries = DEFAULT_WITH_BOUNDARIES; Set<Country> boundariesFilter = null; boolean debug = false; boolean useMonthlyCache = DEFAULT_USE_MONTHLY_CACHE; if (platformConfig.moduleExists(MODULE_NAME)) { ModuleConfig config = platformConfig.getModuleConfig(MODULE_NAME); onlyIntermittentGeneration = config.getBooleanProperty("onlyIntermittentGeneration", DEFAULT_ONLY_INTERMITTENT_GENERATION); prctRisk = config.getFloatProperty("prctRisk", DEFAULT_PRCT_RISK); withBoundaries = config.getBooleanProperty("withBoundaries", DEFAULT_WITH_BOUNDARIES); boundariesFilter = config.getEnumSetProperty("boundariesFilter", Country.class, null); debug = config.getBooleanProperty("debug", false); useMonthlyCache = config.getBooleanProperty("useMonthlyCache", DEFAULT_USE_MONTHLY_CACHE); } return new UncertaintiesAnalysisConfig(onlyIntermittentGeneration, prctRisk, withBoundaries, boundariesFilter, debug, useMonthlyCache); }
Set<SecurityIndexType> securityIndexes = config.getEnumSetProperty("securityIndexes", SecurityIndexType.class, null); boolean mergeOptimized = config.getBooleanProperty("mergeOptimized", DEFAULT_MERGE_OPTIMIZED); float limitReduction = config.getFloatProperty("limitReduction", DEFAULT_LIMIT_REDUCTION); boolean handleViolationsInN = config.getBooleanProperty("handleViolationsInN", DEFAULT_HANDLE_VIOLATIONS_IN_N); float constraintMargin = config.getFloatProperty("constraintMargin", DEFAULT_CONSTRAINT_MARGIN);
assertEquals(3, module1.getIntProperty("i")); assertEquals(444444444L, module1.getLongProperty("l")); assertEquals(3.3f, module1.getFloatProperty("f"), 0f); assertEquals(3.3, module1.getDoubleProperty("f"), 0); assertTrue(module1.getBooleanProperty("b"));
acmcRegul = config.getStringProperty("ACMCRegul", DEFAULT_ACMC_REGUL); rstPilotGenerators = config.getStringProperty("RSTPilotGenerators", DEFAULT_RST_PILOT_GENERATORS); loadPatternAlpha = config.getFloatProperty("loadPatternAlpha", DEFAULT_LOAD_PATTERN_ALPHA); loadPatternBeta = config.getFloatProperty("loadPatternBeta", DEFAULT_LOAD_PATTERN_BETA); gensPQfilter = config.getBooleanProperty("gensPQfilter", DEFAULT_GENPQFILTER);
assertEquals(1.5f, modConfig.getFloatProperty("f", 1.5f), 0d); assertEquals(2.3f, modConfig.getFloatProperty("d"), 0d);