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 AbstractReportNodeContext
allowReportNodeContextMultiThreadAccess
(AbstractReportNodeContext reportNodeContext, boolean allow) Returns aReportNodeContext
containing the same reportNodes 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
executeWithReportNode
(Network network, ReportNode reportNode, Runnable runnable) Set aReportNode
in the reportNode context of the given network, execute a runnable then restore the reportNode 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.
-
executeWithReportNode
Set aReportNode
in the reportNode context of the given network, execute a runnable then restore the reportNode context.- Parameters:
network
- a networkreportNode
- the reportNode to userunnable
- the runnable to execute
-
allowReportNodeContextMultiThreadAccess
public static AbstractReportNodeContext allowReportNodeContextMultiThreadAccess(AbstractReportNodeContext reportNodeContext, boolean allow) Returns aReportNodeContext
containing the same reportNodes as the given one, but reconfigured to allow it, or not, to be accessed simultaneously by different threads. When this option is activated, the reportNode context can have a different content for each thread.- Parameters:
reportNodeContext
- the ReportNodeContext to reconfigureallow
- allow multi-thread access to the ReportNodeContext- Returns:
- the reconfigured ReportNodeContext
-