public static synchronized DymolaSimulationConfig load() { if (INSTANCE == null) { ModuleConfig config = PlatformConfig.defaultConfig().getModuleConfig("dymola-simulation"); int numberOfIntervals = config.getIntProperty("numberOfIntervals", 0); double outputInterval = config.getDoubleProperty("outputInterval", 0.0); String method = config.getStringProperty("method", "Lsodar"); double tolerance = config.getDoubleProperty("tolerance", 0.0001); double outputFixedstepSize = config.getDoubleProperty("fixedStepSize", 0.0); INSTANCE = new DymolaSimulationConfig(numberOfIntervals, outputInterval, method, tolerance, outputFixedstepSize); } return INSTANCE; }
public static SimulationParameters load(PlatformConfig platformConfig) { ModuleConfig config = platformConfig.getModuleConfig("simulation-parameters"); double preFaultSimulationStopInstant = config.getDoubleProperty("preFaultSimulationStopInstant"); double faultEventInstant = config.getDoubleProperty("faultEventInstant"); double branchSideOneFaultShortCircuitDuration; double branchSideTwoFaultShortCircuitDuration; if ((config.hasProperty(BRANCH_SIDE_ONE_FAULT_SHORT_CIRCUIT_PROPERTY_NAME)) || (config.hasProperty(BRANCH_SIDE_TWO_FAULT_SHORT_CIRCUIT_PROPERTY_NAME))) { branchSideOneFaultShortCircuitDuration = config.getDoubleProperty(BRANCH_SIDE_ONE_FAULT_SHORT_CIRCUIT_PROPERTY_NAME); branchSideTwoFaultShortCircuitDuration = config.getDoubleProperty(BRANCH_SIDE_TWO_FAULT_SHORT_CIRCUIT_PROPERTY_NAME); if (config.hasProperty(BRANCH_FAULT_SHORT_CIRCUIT_PROPERTY_NAME)) { LOGGER.warn("deprecated property {} is overridden by properties {} and {} ", BRANCH_FAULT_SHORT_CIRCUIT_PROPERTY_NAME, BRANCH_SIDE_ONE_FAULT_SHORT_CIRCUIT_PROPERTY_NAME, BRANCH_SIDE_TWO_FAULT_SHORT_CIRCUIT_PROPERTY_NAME); branchSideOneFaultShortCircuitDuration = config.getDoubleProperty(BRANCH_FAULT_SHORT_CIRCUIT_PROPERTY_NAME); branchSideTwoFaultShortCircuitDuration = branchSideOneFaultShortCircuitDuration; } else { double generatorFaultShortCircuitDuration = config.getDoubleProperty("generatorFaultShortCircuitDuration"); double postFaultSimulationStopInstant = config.getDoubleProperty("postFaultSimulationStopInstant"); double branchShortCircuitDistance = config.getDoubleProperty("branchShortCircuitDistance", DEFAULT_BRANCH_SHORT_CIRCUIT_DISTANCE); double branchFaultResistance = config.getDoubleProperty("branchFaultResistance", DEFAULT_BRANCH_FAULT_RESISTANCE); double branchFaultReactance = config.getDoubleProperty("branchFaultReactance", DEFAULT_BRANCH_FAULT_REACTANCE); double generatorFaultResistance = config.getDoubleProperty("generatorFaultResistance", DEFAULT_GENERATOR_FAULT_RESISTANCE); double generatorFaultReactance = config.getDoubleProperty("generatorFaultReactance", DEFAULT_GENERATOR_FAULT_REACTANCE); String detailedParametersFileName = config.getStringProperty("detailsFileName", null); SimulationDetailedParameters detailedParameters = null;
boolean debug = config.getBooleanProperty("debug", false); Integer checkModule0 = config.getOptionalIntegerProperty("checkModule0").orElse(null); double percpuGaussLoad = config.getDoubleProperty("percpuGaussLoad"); double percpuGaussRes = config.getDoubleProperty("percpuGaussRes"); double correlationGauss = config.getDoubleProperty("correlationGauss"); double tolVar = config.getDoubleProperty("tolvar"); double nMinObsFract = config.getDoubleProperty("Nmin_obs_fract"); Integer nMinObsInterv = config.getOptionalIntegerProperty("Nmin_obs_interv").orElse(null); Integer imputationMeth = config.getOptionalIntegerProperty("imputation_meth").orElse(null); Integer rngSeed = config.getOptionalIntegerProperty("rngSeed").orElse(null); Integer kOutlier = config.getOptionalIntegerProperty("koutlier").orElse(null); double tolerance = config.getDoubleProperty("tolerance"); Integer iterations = config.getOptionalIntegerProperty("iterations").orElse(null); double epsilo = config.getDoubleProperty("epsilo"); Integer conditionalSampling = config.getOptionalIntegerProperty("conditionalSampling").orElse(null); Integer tFlags = config.getOptionalIntegerProperty("tFlags").orElse(null); double histoEstremeQ = config.getDoubleProperty("histo_estremeQ"); double thresGUI = config.getDoubleProperty("thresGUI"); String nats = config.getStringProperty("nats", "All"); double nnz = config.getDoubleProperty("nnz"); Integer unimod = config.getOptionalIntegerProperty("unimod").orElse(null); Integer modoInv = config.getOptionalIntegerProperty("modo_inv").orElse(null); Integer isuniform = config.getOptionalIntegerProperty("isuniform").orElse(null); Integer optGUI = config.getOptionalIntegerProperty("opt_GUI").orElse(null); double pLoadDeterministic = config.getDoubleProperty("Pload_deterministic"); double qLoadDeterministic = config.getDoubleProperty("Qload_deterministic"); double bandUniformPL = config.getDoubleProperty("band_uniformPL");
static LimitViolationFilter load(PlatformConfig platformConfig) { return platformConfig.getOptionalModuleConfig("limit-violation-default-filter") .map(moduleConfig -> { LimitViolationFilter filter = new LimitViolationFilter(); filter.setViolationTypes(moduleConfig.getEnumSetProperty("violationTypes", LimitViolationType.class, DEFAULT_VIOLATION_TYPES)); filter.setMinBaseVoltage(moduleConfig.getDoubleProperty("minBaseVoltage", DEFAULT_MIN_BASE_VOLTAGE)); filter.setCountries(moduleConfig.getEnumSetProperty("countries", Country.class, DEFAULT_COUNTRIES)); return filter; }) .orElseGet(LimitViolationFilter::new); }
public static SamplerWp41Config load() { ModuleConfig config = PlatformConfig.defaultConfig().getModuleConfig("samplerwp41"); Path runtimeHomeDir = config.getPathProperty("runtimeHomeDir"); Path binariesDir = config.getPathProperty("binariesDir", null); Path validationDir = config.getPathProperty("validationDir", null); double ir = config.getDoubleProperty("ir"); double tflag = config.getDoubleProperty("tflag"); Integer rngSeed = config.getOptionalIntegerProperty("rngSeed").orElse(null); int module3Timeout = config.getIntProperty("module3Timeout", MODULE3_DEFAULT_TIMEOUT); int parK = config.getIntProperty("par_k", -1); boolean debug = config.getBooleanProperty("debug", false); return new SamplerWp41Config(binariesDir, runtimeHomeDir, validationDir, ir, tflag, rngSeed, module3Timeout, parK, debug); }
public static ForecastErrorsAnalysisParameters load() { ModuleConfig config = PlatformConfig.defaultConfig().getModuleConfig("fea-parameters"); DateTime baseCaseDate = DateTime.parse(config.getStringProperty("baseCaseDate")); Interval histoInterval = Interval.parse(config.getStringProperty("histoInterval")); String feAnalysisId = config.getStringProperty("feAnalysisId"); double ir = config.getDoubleProperty("ir"); Integer flagPQ = config.getIntProperty("flagPQ"); Integer method = config.getIntProperty("method"); Integer nClusters = config.getIntProperty("nClusters"); double percentileHistorical = config.getDoubleProperty("percentileHistorical"); Integer modalityGaussian = config.getOptionalIntegerProperty("modalityGaussian").orElse(null); Integer outliers = config.getOptionalIntegerProperty("outliers").orElse(null); Integer conditionalSampling = config.getOptionalIntegerProperty("conditionalSampling").orElse(null); Integer nSamples = config.getIntProperty("nSamples"); Set<Country> countries = config.getEnumSetProperty("countries", Country.class, DEFAULT_COUNTRIES); CaseType caseType = config.getEnumProperty("caseType", CaseType.class, DEFAULT_CASE_TYPE); boolean allInjections = config.getBooleanProperty("all-injections", DEFAULT_ALL_INJECTIONS); return new ForecastErrorsAnalysisParameters(baseCaseDate, histoInterval, feAnalysisId, ir, flagPQ, method, nClusters, percentileHistorical, modalityGaussian, outliers, conditionalSampling, nSamples, countries, caseType, allInjections); }
public static OfflineWorkflowCreationParameters load() { ModuleConfig config = PlatformConfig.defaultConfig().getModuleConfig("offline-default-creation-parameters"); Set<Country> countries = config.getEnumSetProperty("countries", Country.class); DateTime baseCaseDate = config.getDateTimeProperty("baseCaseDate"); Interval histoInterval = config.getIntervalProperty("histoInterval"); boolean generationSampled = config.getBooleanProperty("generationSampled", false); boolean boundariesSampled = config.getBooleanProperty("boundariesSampled", false); boolean initTopo = config.getBooleanProperty("initTopo", DEFAULT_INIT_TOPO); double correlationThreshold = config.getDoubleProperty("correlationThreshold", DEFAULT_CORRELATION_THRESHOLD); double probabilityThreshold = config.getDoubleProperty("probabilityThreshold", DEFAULT_PROBABILITY_THRESHOLD); boolean loadFlowTransformerVoltageControlOn = config.getBooleanProperty("loadFlowTransformerVoltageControlOn", DEFAULT_LOAD_FLOW_TRANSFORMER_VOLTAGE_CONTROL_ON); boolean simplifiedWorkflow = config.getBooleanProperty("simplifiedWorkflow", DEFAULT_SIMPLIFIED_WORKFLOW); boolean mergeOptimized = config.getBooleanProperty("mergeOptimized", DEFAULT_MERGE_OPTIMIZED); Set<Country> attributesCountryFilter = config.getEnumSetProperty("attributesCountryFilter", Country.class, DEFAULT_ATTRIBUTES_COUNTRY_FILTER); int attributesMinBaseVoltageFilter = config.getIntProperty("attributesMinBaseVoltageFilter", DEFAULT_ATTRIBUTES_MIN_BASE_VOLTAGE_FILTER); return new OfflineWorkflowCreationParameters(countries, baseCaseDate, histoInterval, generationSampled, boundariesSampled, initTopo, correlationThreshold, probabilityThreshold, loadFlowTransformerVoltageControlOn, simplifiedWorkflow, mergeOptimized, attributesCountryFilter, attributesMinBaseVoltageFilter); } public OfflineWorkflowCreationParameters(Set<Country> countries, DateTime baseCaseDate, Interval histoInterval,
public static synchronized EurostagConfig load(PlatformConfig platformConfig) { ModuleConfig config = platformConfig.getModuleConfig("eurostag"); Path eurostagHomeDir = config.getPathProperty("eurostagHomeDir", null); Path indexesBinDir = config.getPathProperty("indexesBinDir", null); boolean lfNoGeneratorMinMaxQ = config.getBooleanProperty("lfNoGeneratorMinMaxQ", false); int lfTimeout = config.getIntProperty("lfTimeout", LF_DEFAULT_TIMEOUT); int simTimeout = config.getIntProperty("simTimeout", SIM_DEFAULT_TIMEOUT); int idxTimeout = config.getIntProperty("idxTimeout", IDX_DEFAULT_TIMEOUT); int lfMaxNumIteration = config.getIntProperty("lfMaxNumIteration", DEFAULT_LF_MAX_NUM_ITERATION); double minimumStep = config.getDoubleProperty("minimumStep", DEFAULT_MINIMUM_STEP); boolean lfWarmStart = config.getBooleanProperty("lfWarmStart", DEFAULT_LF_WARM_START); boolean useBroadcast = config.getBooleanProperty("useBroadcast", DEFAULT_USE_BROADCAST); boolean ddbCaching = config.getBooleanProperty("ddbCaching", DEFAULT_DDB_CACHING); double minStepAtEndOfStabilization = config.getDoubleProperty("minStepAtEndOfStabilization", DEFAULT_MIN_STEP_AT_END_OF_STABILIZATION); boolean debug = config.getBooleanProperty("debug", false); String eurostagCptCommandName = config.getStringProperty("eurostagCptCommandName", DEFAULT_EUROSTAG_CMD_NAME); return new EurostagConfig(eurostagHomeDir, indexesBinDir, lfNoGeneratorMinMaxQ, lfTimeout, simTimeout, idxTimeout, lfMaxNumIteration, minimumStep, lfWarmStart, useBroadcast, ddbCaching, minStepAtEndOfStabilization, debug, eurostagCptCommandName); }
automatonA56 = config.getBooleanProperty("automatonA56", DEFAULT_AUTOMATON_A56); automatonA17AngularReferenceGenerator = config.getStringProperty("automatonA17AngularReferenceGenerator", DEFAULT_AUTOMATON_A17_REFERENCE_GENERATOR); automatonA17MinimumPhaseDifferenceThreshold = config.getDoubleProperty("automatonA17MinimumPhaseDifferenceThreshold", DEFAULT_AUTOMATON_A17_MINIMUM_PHASE_DIFFERENCE_THRESHOLD); automatonA17MaximumPhaseDifferenceThreshold = config.getDoubleProperty("automatonA17MaximumPhaseDifferenceThreshold", DEFAULT_AUTOMATON_A17_MAXIMUM_PHASE_DIFFERENCE_THRESHOLD); automatonA17ObservationDuration = config.getDoubleProperty("automatonA17ObservationDuration", DEFAULT_AUTOMATON_A17_OBSERVATION_DURATION); automatonA56DetailsFile = automatonA56 ? config.getPathProperty("automatonA56DetailsFile") : config.getPathProperty("automatonA56DetailsFile", null); importExportRST = config.getBooleanProperty("importExportRST", DEFAULT_RST);
assertEquals(444444444L, module1.getLongProperty("l")); assertEquals(3.3f, module1.getFloatProperty("f"), 0f); assertEquals(3.3, module1.getDoubleProperty("f"), 0); assertTrue(module1.getBooleanProperty("b")); assertEquals(fileSystem.getPath("/work/a"), module1.getPathProperty("p"));
assertEquals(2.3d, modConfig.getDoubleProperty("d"), 0d); try { modConfig.getDoubleProperty("d2"); fail(); } catch (Exception ignored) { assertEquals(4.5d, modConfig.getDoubleProperty("d2", 4.5d), 0d);