Package com.powsybl.iidm.network.util
Class Networks
java.lang.Object
com.powsybl.iidm.network.util.Networks
- Author:
- Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
-
Method Summary
Modifier and TypeMethodDescriptionstatic AbstractReporterContext
allowReporterContextMultiThreadAccess
(AbstractReporterContext reporterContext, boolean allow) Returns aReporterContext
containing the same reporters as the given one, but reconfigured to allow it, or not, to be accessed simultaneously by different threads.static void
dumpVariantId
(Path workingDir, Network network) static void
dumpVariantId
(Path workingDir, String variantId) static void
executeWithReporter
(Network network, Reporter reporter, Runnable runnable) Set aReporter
in the reporter context of the given network, execute a runnable then restore the reporter context.static Terminal
getEquivalentTerminal
(VoltageLevel voltageLevel, int node) Return a terminal for the specified node.getExecutionTags
(Network network) static IntStream
getNodesByBus
(VoltageLevel voltageLevel) Return the list of nodes (N/B topology) for each bus of a the Bus view If a node is not associated to a bus, it is not included in any list.static boolean
isBusValid
(int feederCount) static void
printBalanceSummary
(String title, Network network, Writer writer) static void
printGeneratorsSetpointDiff
(Network network, org.slf4j.Logger logger)
-
Method Details
-
isBusValid
public static boolean isBusValid(int feederCount) -
getExecutionTags
-
dumpVariantId
- Throws:
IOException
-
dumpVariantId
- Throws:
IOException
-
printBalanceSummary
public static void printBalanceSummary(String title, Network network, Writer writer) throws IOException - Throws:
IOException
-
printGeneratorsSetpointDiff
-
getNodesByBus
Return the list of nodes (N/B topology) for each bus of a the Bus view If a node is not associated to a bus, it is not included in any list.- Parameters:
voltageLevel
- The voltage level to traverse- Returns:
- the list of nodes (N/B topology) for each bus of a Bus view
-
getNodes
-
getEquivalentTerminal
Return a terminal for the specified node. If a terminal is attached to the node, return this terminal. Otherwise, this method traverses the topology and return the first equivalent terminal found.- Parameters:
voltageLevel
- The voltage level to traversenode
- The starting node- Returns:
- A terminal for the specified node or null.
-
executeWithReporter
Set aReporter
in the reporter context of the given network, execute a runnable then restore the reporter context.- Parameters:
network
- a networkreporter
- the reporter to userunnable
- the runnable to execute
-
allowReporterContextMultiThreadAccess
public static AbstractReporterContext allowReporterContextMultiThreadAccess(AbstractReporterContext reporterContext, boolean allow) Returns aReporterContext
containing the same reporters as the given one, but reconfigured to allow it, or not, to be accessed simultaneously by different threads. When this option is activated, the reporter context can have a different content for each thread.- Parameters:
reporterContext
- the ReporterContext to reconfigureallow
- allow multi-thread access to the ReporterContext- Returns:
- the reconfigured ReporterContext
-