com.powsybl.openrao.data.crac.io.cim.parameters.CimCracCreationParametersConfigLoader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of open-rao-crac-io-cim Show documentation
Show all versions of open-rao-crac-io-cim Show documentation
CRAC creator implementation for CRAC specific to SWE zone format
/*
* Copyright (c) 2022, RTE (http://www.rte-france.com)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package com.powsybl.openrao.data.crac.io.cim.parameters;
import com.powsybl.openrao.data.crac.api.parameters.AbstractAlignedRaCracCreationParameters;
import com.powsybl.openrao.data.crac.api.parameters.CracCreationParameters;
import com.google.auto.service.AutoService;
import com.powsybl.commons.config.ModuleConfig;
import com.powsybl.commons.config.PlatformConfig;
import java.util.Optional;
/**
* @author Baptiste Seguinot {@literal }
*/
@AutoService(CracCreationParameters.ConfigLoader.class)
public class CimCracCreationParametersConfigLoader implements CracCreationParameters.ConfigLoader {
private static final String MODULE_NAME = "cim-crac-creation-parameters";
@Override
public CimCracCreationParameters load(PlatformConfig platformConfig) {
CimCracCreationParameters parameters = new CimCracCreationParameters();
Optional configOptional = platformConfig.getOptionalModuleConfig(MODULE_NAME);
if (configOptional.isPresent()) {
ModuleConfig config = configOptional.get();
parameters.setRangeActionGroupsAsString(config.getStringListProperty("range-action-groups", AbstractAlignedRaCracCreationParameters.getDefaultRaGroupsAsString()));
}
return parameters;
}
@Override
public String getExtensionName() {
return "CimCracCreatorParameters";
}
@Override
public String getCategoryName() {
return "crac-creation-parameters";
}
@Override
public Class super CimCracCreationParameters> getExtensionClass() {
return CimCracCreationParameters.class;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy