
com.powsybl.metrix.integration.remedials.Remedial Maven / Gradle / Ivy
The newest version!
/*
* Copyright (c) 2021, 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/.
* SPDX-License-Identifier: MPL-2.0
*/
package com.powsybl.metrix.integration.remedials;
import java.util.ArrayList;
import java.util.List;
/**
* @author Valentin Berthault {@literal }
*/
public class Remedial {
private final int lineFile;
private final String contingency;
private final List constraint;
private final List branchToOpen;
private final List branchToClose;
private final String actions;
public Remedial(int lineFile, String contingency, List constraint, List branchToOpen, List branchToClose, String actions) {
this.lineFile = lineFile;
this.contingency = contingency;
this.constraint = constraint;
this.branchToOpen = branchToOpen;
this.branchToClose = branchToClose;
this.actions = actions;
}
public int getLineFile() {
return lineFile;
}
public String getContingency() {
return contingency;
}
public List getConstraint() {
return constraint;
}
public List getBranchToOpen() {
return branchToOpen;
}
public List getBranchToClose() {
return branchToClose;
}
public String getActions() {
return actions;
}
public final String getNameFromActions() {
List name = new ArrayList<>(); //display branchToOpen ordered then branchToClose ordered
name.addAll(branchToOpen.stream().sorted().toList());
name.addAll(branchToClose.stream().map(action -> "+" + action).sorted().toList());
return String.join(";", name);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy