Skip to content

Commit

Permalink
Update sensitivity factors provider API (#1623)
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastien Murgey <[email protected]>
  • Loading branch information
murgeyseb authored and miovd committed Feb 5, 2021
1 parent 201c749 commit 5777a24
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,7 @@ public JsonSensitivityFactorsProvider(final InputStream input) {
}

@Override
public List<SensitivityFactor> getFactors(Network network) {
return sensitivityFactors;
}

@Override
public List<SensitivityFactor> getFactors(Network network, String contingencyId) {
public List<SensitivityFactor> getCommonFactors(Network network) {
return sensitivityFactors;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import com.powsybl.iidm.network.Network;

import java.util.Collections;
import java.util.List;

/**
Expand All @@ -18,26 +19,42 @@
* for sensitivity analysis.
* </p>
*
* Sensitivity factors are defined through the combination of a common factors list,
* that must be computed on all states (base case and any contingency) and additional
* ones by state.
*
* @author Sebastien Murgey {@literal <sebastien.murgey at rte-france.com>}
* @see SensitivityFactor
*/
public interface SensitivityFactorsProvider {

/**
* Get the list of factors generated based on the given network
* Get the list of factors that are common to base case and all contingencies,
* generated based on the given network
*
* @param network Base IIDM network of provision method
* @return A list of sensitivity factors
*/
List<SensitivityFactor> getFactors(Network network);
List<SensitivityFactor> getCommonFactors(Network network);

/**
* Get the list of additional factors specific to base case.
*
* @param network Base IIDM network of provision method
* @return A list of sensitivity factors
*/
default List<SensitivityFactor> getAdditionalFactors(Network network) {
return Collections.emptyList();
}

/**
* Get the list of factors generated based on the given network and a contingency
* Get the list of additional factors specific to a given contingency
*
* @param network Base IIDM network of provision method
* @param contingencyId Id of the contingency for which we want the factors. Set to null for base case factors.
* @param contingencyId Id of the contingency for which we want the factors.
* @return A list of sensitivity factors
*/
List<SensitivityFactor> getFactors(Network network, String contingencyId);
default List<SensitivityFactor> getAdditionalFactors(Network network, String contingencyId) {
return Collections.emptyList();
}
}

0 comments on commit 5777a24

Please sign in to comment.