Class Networks

java.lang.Object
com.powsybl.iidm.network.util.Networks

public final class Networks extends Object
Author:
Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
  • Method Details

    • isBusValid

      public static boolean isBusValid(int feederCount)
    • getExecutionTags

      public static Map<String,String> getExecutionTags(Network network)
    • dumpVariantId

      public static void dumpVariantId(Path workingDir, String variantId) throws IOException
      Throws:
      IOException
    • dumpVariantId

      public static void dumpVariantId(Path workingDir, Network network) throws IOException
      Throws:
      IOException
    • printBalanceSummary

      public static void printBalanceSummary(String title, Network network, Writer writer) throws IOException
      Throws:
      IOException
    • printGeneratorsSetpointDiff

      public static void printGeneratorsSetpointDiff(Network network, org.slf4j.Logger logger)
    • getNodesByBus

      public static Map<String,Set<Integer>> 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.
      Parameters:
      voltageLevel - The voltage level to traverse
      Returns:
      the list of nodes (N/B topology) for each bus of a Bus view
    • getNodes

      public static IntStream getNodes(String busId, VoltageLevel voltageLevel, Function<Terminal,Bus> getBusFromTerminal)
    • getEquivalentTerminal

      public static Terminal getEquivalentTerminal(VoltageLevel voltageLevel, int node)
      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 traverse
      node - The starting node
      Returns:
      A terminal for the specified node or null.
    • executeWithReportNode

      public static void executeWithReportNode(Network network, ReportNode reportNode, Runnable runnable)
      Set a ReportNode in the reportNode context of the given network, execute a runnable then restore the reportNode context.
      Parameters:
      network - a network
      reportNode - the reportNode to use
      runnable - the runnable to execute
    • allowReportNodeContextMultiThreadAccess

      public static AbstractReportNodeContext allowReportNodeContextMultiThreadAccess(AbstractReportNodeContext reportNodeContext, boolean allow)
      Returns a ReportNodeContext 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 reconfigure
      allow - allow multi-thread access to the ReportNodeContext
      Returns:
      the reconfigured ReportNodeContext