Class NetworkImpl

java.lang.Object
com.powsybl.commons.extensions.AbstractExtendable<I>
com.powsybl.iidm.network.impl.NetworkImpl
All Implemented Interfaces:
Extendable<Network>, Container<Network>, Identifiable<Network>, MultiVariantObject, NetworkExt, VariantManagerHolder, Network, Validable

public class NetworkImpl extends AbstractExtendable<I> implements VariantManagerHolder, MultiVariantObject
Author:
Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
  • Field Details

    • sourceFormat

      protected String sourceFormat
    • id

      protected String id
    • name

      protected String name
    • fictitious

      protected boolean fictitious
    • properties

      protected final Properties properties
  • Method Details

    • getSubnetworks

      public Collection<Network> getSubnetworks()
      Specified by:
      getSubnetworks in interface Network
    • getSubnetwork

      public Network getSubnetwork(String id)
      Specified by:
      getSubnetwork in interface Network
    • getRootNetworkRef

      public RefChain<NetworkImpl> getRootNetworkRef()
      Description copied from interface: NetworkExt
      Return the reference to the root network which is also used within the network elements. This is used to easily update the root network of network elements when merging networks or detaching subnetworks.
      Specified by:
      getRootNetworkRef in interface NetworkExt
    • getListeners

      public NetworkListenerList getListeners()
    • getIndex

      public com.powsybl.iidm.network.impl.NetworkIndex getIndex()
    • getVoltageAngleLimitsIndex

      public Map<String,VoltageAngleLimit> getVoltageAngleLimitsIndex()
    • getVoltageAngleLimit

      public VoltageAngleLimit getVoltageAngleLimit(String id)
      Description copied from interface: Network
      Get voltage angle limit with id
      Specified by:
      getVoltageAngleLimit in interface Network
    • getVoltageAngleLimitsStream

      public Stream<VoltageAngleLimit> getVoltageAngleLimitsStream()
      Description copied from interface: Network
      Get all voltageAngleLimits.
      Specified by:
      getVoltageAngleLimitsStream in interface Network
    • getVoltageAngleLimits

      public Iterable<VoltageAngleLimit> getVoltageAngleLimits()
      Description copied from interface: Network
      Get all voltageAngleLimits.
      Specified by:
      getVoltageAngleLimits in interface Network
    • getNetwork

      public NetworkImpl getNetwork()
      Description copied from interface: Identifiable
      Get the network associated to the object.
      Specified by:
      getNetwork in interface Identifiable<Network>
    • getParentNetwork

      public Network getParentNetwork()
      Description copied from interface: Identifiable
      Get the parent network, i.e. the smallest network containing the object.
      Specified by:
      getParentNetwork in interface Identifiable<Network>
    • getVariantManager

      public VariantManagerImpl getVariantManager()
      Description copied from interface: Network
      Get the variant manager of the network.
      Specified by:
      getVariantManager in interface Network
      Specified by:
      getVariantManager in interface VariantManagerHolder
    • allowReporterContextMultiThreadAccess

      public void allowReporterContextMultiThreadAccess(boolean allow)
      Description copied from interface: Network

      Allows ReporterContext to be accessed simultaneously by different threads.

      When this option is activated, the reporter context can have a different content for each thread.

      Note that to avoid memory leaks when in multi-thread configuration:

      • each reporter pushed in the ReporterContext should be popped in a "finally" section:
         
             network.getReporterContext().pushReporter(reporter);
             try {
                 // code that can throw an exception
             } finally {
                 network.getReporterContext().popReporter();
             }
         
         
      • the context should be set in mono-thread access when multi-threading policy is no more useful.
      Specified by:
      allowReporterContextMultiThreadAccess in interface Network
      Parameters:
      allow - allow multi-thread access to the ReporterContext
    • getReporterContext

      public ReporterContext getReporterContext()
      Description copied from interface: Network
      Get the ReporterContext of the network.
      Specified by:
      getReporterContext in interface Network
    • getVariantIndex

      public int getVariantIndex()
      Specified by:
      getVariantIndex in interface VariantManagerHolder
    • getCountries

      public Set<Country> getCountries()
      Description copied from interface: Network
      Get all countries.
      Specified by:
      getCountries in interface Network
    • getCountryCount

      public int getCountryCount()
      Description copied from interface: Network
      Get the country count.
      Specified by:
      getCountryCount in interface Network
    • newSubstation

      public SubstationAdder newSubstation()
      Description copied from interface: Network
      Get a builder to create a new substation.
      Specified by:
      newSubstation in interface Network
      Returns:
      a builder to create a new substation
    • getSubstations

      public Iterable<Substation> getSubstations()
      Description copied from interface: Network
      Get all substations.
      Specified by:
      getSubstations in interface Network
    • getSubstationStream

      public Stream<Substation> getSubstationStream()
      Description copied from interface: Network
      Get all substations.
      Specified by:
      getSubstationStream in interface Network
    • getSubstationCount

      public int getSubstationCount()
      Description copied from interface: Network
      Get the substation count.
      Specified by:
      getSubstationCount in interface Network
    • getSubstations

      public Iterable<Substation> getSubstations(Country country, String tsoId, String... geographicalTags)
      Description copied from interface: Network
      Get substation located in a specific county, TSO and marked with a list of geographical tag.
      Specified by:
      getSubstations in interface Network
      Parameters:
      country - the country, if null there is no filtering on countries
      tsoId - the id of the TSO, if null there is no filtering on TSOs
      geographicalTags - a list a geographical tags
    • getSubstations

      public Iterable<Substation> getSubstations(String country, String tsoId, String... geographicalTags)
      Description copied from interface: Network
      Get substation located in a specific county, TSO and marked with a list of geographical tag.
      Specified by:
      getSubstations in interface Network
      Parameters:
      country - the country name, if empty string, the filtering will be on substations without country, if null there is no filtering on countries
      tsoId - the id of the TSO, if null there is no filtering on TSOs
      geographicalTags - a list a geographical tags
    • getSubstation

      public com.powsybl.iidm.network.impl.SubstationImpl getSubstation(String id)
      Description copied from interface: Network
      Get a substation.
      Specified by:
      getSubstation in interface Network
      Parameters:
      id - the id or an alias of the substation
    • newVoltageLevel

      public VoltageLevelAdder newVoltageLevel()
      Description copied from interface: Network
      Get a builder to create a new voltage level (without substation). Note: if this method is not implemented, it will create an intermediary fictitious Substation.
      Specified by:
      newVoltageLevel in interface Network
      Returns:
      a builder to create a new voltage level
    • getVoltageLevels

      public Iterable<VoltageLevel> getVoltageLevels()
      Description copied from interface: Network
      Get all substation voltage levels.
      Specified by:
      getVoltageLevels in interface Network
    • getVoltageLevelStream

      public Stream<VoltageLevel> getVoltageLevelStream()
      Description copied from interface: Network
      Get all substation voltage levels.
      Specified by:
      getVoltageLevelStream in interface Network
    • getVoltageLevelCount

      public int getVoltageLevelCount()
      Description copied from interface: Network
      Get the voltage level count.
      Specified by:
      getVoltageLevelCount in interface Network
    • getVoltageLevel

      public com.powsybl.iidm.network.impl.VoltageLevelExt getVoltageLevel(String id)
      Description copied from interface: Network
      Get a substation voltage level.
      Specified by:
      getVoltageLevel in interface Network
      Parameters:
      id - the id or an alias of the substation voltage level
    • newLine

      public com.powsybl.iidm.network.impl.LineAdderImpl newLine()
      Description copied from interface: Network
      Get a builder to create a new AC line.
      Specified by:
      newLine in interface Network
      Returns:
      a builder to create a new line
    • getLines

      public Iterable<Line> getLines()
      Description copied from interface: Network
      Get all AC lines.
      Specified by:
      getLines in interface Network
    • getTieLines

      public Iterable<TieLine> getTieLines()
      Description copied from interface: Network
      Get all tie lines.
      Specified by:
      getTieLines in interface Network
    • getBranch

      public Branch getBranch(String branchId)
      Description copied from interface: Network
      Get a branch
      Specified by:
      getBranch in interface Network
      Parameters:
      branchId - the id of the branch
    • getBranches

      public Iterable<Branch> getBranches()
      Description copied from interface: Network
      Get all branches
      Specified by:
      getBranches in interface Network
    • getBranchStream

      public Stream<Branch> getBranchStream()
      Description copied from interface: Network
      Get all branches
      Specified by:
      getBranchStream in interface Network
    • getBranchCount

      public int getBranchCount()
      Description copied from interface: Network
      Get the branch count.
      Specified by:
      getBranchCount in interface Network
    • getLineStream

      public Stream<Line> getLineStream()
      Description copied from interface: Network
      Get all AC lines.
      Specified by:
      getLineStream in interface Network
    • getTieLineStream

      public Stream<TieLine> getTieLineStream()
      Description copied from interface: Network
      Get all tie lines.
      Specified by:
      getTieLineStream in interface Network
    • getLineCount

      public int getLineCount()
      Description copied from interface: Network
      Get the AC line count.
      Specified by:
      getLineCount in interface Network
    • getTieLineCount

      public int getTieLineCount()
      Description copied from interface: Network
      Get the tie line count.
      Specified by:
      getTieLineCount in interface Network
    • getLine

      public Line getLine(String id)
      Description copied from interface: Network
      Get a AC line.
      Specified by:
      getLine in interface Network
      Parameters:
      id - the id or an alias of the AC line
    • getTieLine

      public TieLine getTieLine(String id)
      Description copied from interface: Network
      Get a tie line.
      Specified by:
      getTieLine in interface Network
      Parameters:
      id - the id or an alias of the AC line
    • newTieLine

      public com.powsybl.iidm.network.impl.TieLineAdderImpl newTieLine()
      Description copied from interface: Network
      Get a builder to create a new AC tie line.
      Specified by:
      newTieLine in interface Network
      Returns:
      a builder to create a new AC tie line
    • getTwoWindingsTransformers

      public Iterable<TwoWindingsTransformer> getTwoWindingsTransformers()
      Description copied from interface: Network
      Get all two windings transformers.
      Specified by:
      getTwoWindingsTransformers in interface Network
    • getTwoWindingsTransformerStream

      public Stream<TwoWindingsTransformer> getTwoWindingsTransformerStream()
      Description copied from interface: Network
      Get all two windings transformers.
      Specified by:
      getTwoWindingsTransformerStream in interface Network
    • getTwoWindingsTransformerCount

      public int getTwoWindingsTransformerCount()
      Description copied from interface: Network
      Get the two windings transformer count.
      Specified by:
      getTwoWindingsTransformerCount in interface Network
    • getTwoWindingsTransformer

      public TwoWindingsTransformer getTwoWindingsTransformer(String id)
      Description copied from interface: Network
      Get a two windings transformer.
      Specified by:
      getTwoWindingsTransformer in interface Network
      Parameters:
      id - the id or an alias of the two windings transformer
    • getThreeWindingsTransformers

      public Iterable<ThreeWindingsTransformer> getThreeWindingsTransformers()
      Description copied from interface: Network
      Get all 3 windings transformers.
      Specified by:
      getThreeWindingsTransformers in interface Network
    • getThreeWindingsTransformerStream

      public Stream<ThreeWindingsTransformer> getThreeWindingsTransformerStream()
      Description copied from interface: Network
      Get all 3 windings transformers.
      Specified by:
      getThreeWindingsTransformerStream in interface Network
    • getThreeWindingsTransformerCount

      public int getThreeWindingsTransformerCount()
      Description copied from interface: Network
      Get the 3 windings transformer count.
      Specified by:
      getThreeWindingsTransformerCount in interface Network
    • getThreeWindingsTransformer

      public ThreeWindingsTransformer getThreeWindingsTransformer(String id)
      Description copied from interface: Network
      Get a 3 windings transformer.
      Specified by:
      getThreeWindingsTransformer in interface Network
      Parameters:
      id - the id or an alias of the 3 windings transformer
    • getOverloadManagementSystems

      public Iterable<OverloadManagementSystem> getOverloadManagementSystems()
      Description copied from interface: Network
      Get all overload management systems.
      Specified by:
      getOverloadManagementSystems in interface Network
    • getOverloadManagementSystemStream

      public Stream<OverloadManagementSystem> getOverloadManagementSystemStream()
      Description copied from interface: Network
      Get all overload management systems.
      Specified by:
      getOverloadManagementSystemStream in interface Network
    • getOverloadManagementSystemCount

      public int getOverloadManagementSystemCount()
      Description copied from interface: Network
      Get the overload management system count.
      Specified by:
      getOverloadManagementSystemCount in interface Network
    • getOverloadManagementSystem

      public OverloadManagementSystem getOverloadManagementSystem(String id)
      Description copied from interface: Network
      Get an overload management system.
      Specified by:
      getOverloadManagementSystem in interface Network
      Parameters:
      id - the id or an alias of the overload management system
    • getGenerators

      public Iterable<Generator> getGenerators()
      Description copied from interface: Network
      Get all generators.
      Specified by:
      getGenerators in interface Network
    • getGeneratorStream

      public Stream<Generator> getGeneratorStream()
      Description copied from interface: Network
      Get all generators.
      Specified by:
      getGeneratorStream in interface Network
    • getGeneratorCount

      public int getGeneratorCount()
      Description copied from interface: Network
      Get the generator count.
      Specified by:
      getGeneratorCount in interface Network
    • getGenerator

      public com.powsybl.iidm.network.impl.GeneratorImpl getGenerator(String id)
      Description copied from interface: Network
      Get a generator.
      Specified by:
      getGenerator in interface Network
      Parameters:
      id - the id or an alias of the generator
    • getBatteries

      public Iterable<Battery> getBatteries()
      Description copied from interface: Network
      Get all batteries.
      Specified by:
      getBatteries in interface Network
    • getBatteryStream

      public Stream<Battery> getBatteryStream()
      Description copied from interface: Network
      Get all batteries.
      Specified by:
      getBatteryStream in interface Network
    • getBatteryCount

      public int getBatteryCount()
      Description copied from interface: Network
      Get the battery count.
      Specified by:
      getBatteryCount in interface Network
    • getBattery

      public BatteryImpl getBattery(String id)
      Description copied from interface: Network
      Get a battery.
      Specified by:
      getBattery in interface Network
      Parameters:
      id - the id or an alias of the battery
    • getLoads

      public Iterable<Load> getLoads()
      Description copied from interface: Network
      Get all loads.
      Specified by:
      getLoads in interface Network
    • getLoadStream

      public Stream<Load> getLoadStream()
      Description copied from interface: Network
      Get all loads.
      Specified by:
      getLoadStream in interface Network
    • getLoadCount

      public int getLoadCount()
      Description copied from interface: Network
      Get the load count.
      Specified by:
      getLoadCount in interface Network
    • getLoad

      public com.powsybl.iidm.network.impl.LoadImpl getLoad(String id)
      Description copied from interface: Network
      Get a load.
      Specified by:
      getLoad in interface Network
      Parameters:
      id - the id or an alias of the load
    • getShuntCompensators

      public Iterable<ShuntCompensator> getShuntCompensators()
      Description copied from interface: Network
      Get all compensator shunts.
      Specified by:
      getShuntCompensators in interface Network
    • getShuntCompensatorStream

      public Stream<ShuntCompensator> getShuntCompensatorStream()
      Description copied from interface: Network
      Get all compensator shunts.
      Specified by:
      getShuntCompensatorStream in interface Network
    • getShuntCompensatorCount

      public int getShuntCompensatorCount()
      Description copied from interface: Network
      Get the shunt count.
      Specified by:
      getShuntCompensatorCount in interface Network
    • getShuntCompensator

      public com.powsybl.iidm.network.impl.ShuntCompensatorImpl getShuntCompensator(String id)
      Description copied from interface: Network
      Get a compensator shunt.
      Specified by:
      getShuntCompensator in interface Network
      Parameters:
      id - the id or an alias of the compensator shunt
    • getDanglingLines

      public Iterable<DanglingLine> getDanglingLines(DanglingLineFilter danglingLineFilter)
      Description copied from interface: Network
      Get all dangling lines corresponding to given filter.
      Specified by:
      getDanglingLines in interface Network
    • getDanglingLineStream

      public Stream<DanglingLine> getDanglingLineStream(DanglingLineFilter danglingLineFilter)
      Description copied from interface: Network
      Get the dangling lines corresponding to given filter.
      Specified by:
      getDanglingLineStream in interface Network
    • getDanglingLineCount

      public int getDanglingLineCount()
      Description copied from interface: Network
      Get the dangling line count.
      Specified by:
      getDanglingLineCount in interface Network
    • getDanglingLine

      public com.powsybl.iidm.network.impl.DanglingLineImpl getDanglingLine(String id)
      Description copied from interface: Network
      Get a dangling line.
      Specified by:
      getDanglingLine in interface Network
      Parameters:
      id - the id or an alias of the dangling line
    • getStaticVarCompensators

      public Iterable<StaticVarCompensator> getStaticVarCompensators()
      Description copied from interface: Network
      Get all static var compensators.
      Specified by:
      getStaticVarCompensators in interface Network
    • getStaticVarCompensatorStream

      public Stream<StaticVarCompensator> getStaticVarCompensatorStream()
      Description copied from interface: Network
      Get all static var compensators.
      Specified by:
      getStaticVarCompensatorStream in interface Network
    • getStaticVarCompensatorCount

      public int getStaticVarCompensatorCount()
      Description copied from interface: Network
      Get the static var compensator count.
      Specified by:
      getStaticVarCompensatorCount in interface Network
    • getStaticVarCompensator

      public com.powsybl.iidm.network.impl.StaticVarCompensatorImpl getStaticVarCompensator(String id)
      Description copied from interface: Network
      Get a static var compensator.
      Specified by:
      getStaticVarCompensator in interface Network
      Parameters:
      id - the id or an alias of the static var compensator
    • getSwitch

      public Switch getSwitch(String id)
      Description copied from interface: Network
      Get a switch from its id or an alias.
      Specified by:
      getSwitch in interface Network
      Parameters:
      id - id or an alias of the switch
      Returns:
      the switch
    • getSwitches

      public Iterable<Switch> getSwitches()
      Description copied from interface: Network
      Get all switches.
      Specified by:
      getSwitches in interface Network
      Returns:
      all switches
    • getSwitchStream

      public Stream<Switch> getSwitchStream()
      Description copied from interface: Network
      Get all switches.
      Specified by:
      getSwitchStream in interface Network
      Returns:
      all switches
    • getSwitchCount

      public int getSwitchCount()
      Description copied from interface: Network
      Get the switch count.
      Specified by:
      getSwitchCount in interface Network
      Returns:
      the switch count
    • getBusbarSection

      public BusbarSection getBusbarSection(String id)
      Description copied from interface: Network
      Get a busbar section from its id or an alias.
      Specified by:
      getBusbarSection in interface Network
      Parameters:
      id - the id or an alias of the busbar section
      Returns:
      the busbar section
    • getBusbarSections

      public Iterable<BusbarSection> getBusbarSections()
      Description copied from interface: Network
      Get all busbar sections.
      Specified by:
      getBusbarSections in interface Network
      Returns:
      all busbar sections
    • getBusbarSectionStream

      public Stream<BusbarSection> getBusbarSectionStream()
      Description copied from interface: Network
      Get all busbar sections.
      Specified by:
      getBusbarSectionStream in interface Network
      Returns:
      all busbar sections
    • getBusbarSectionCount

      public int getBusbarSectionCount()
      Description copied from interface: Network
      Get the busbar section count.
      Specified by:
      getBusbarSectionCount in interface Network
      Returns:
      the busbar section count.
    • getHvdcConverterStation

      public com.powsybl.iidm.network.impl.AbstractHvdcConverterStation<?> getHvdcConverterStation(String id)
      Description copied from interface: Network
      Get an HVDC converter station.
      Specified by:
      getHvdcConverterStation in interface Network
      Parameters:
      id - the id or an alias of the HVDC converter station
      Returns:
      the HVDC converter station or null if not found
    • getHvdcConverterStationCount

      public int getHvdcConverterStationCount()
      Description copied from interface: Network
      Get HVDC converter stations count.
      Specified by:
      getHvdcConverterStationCount in interface Network
      Returns:
      HVDC converter station count
    • getHvdcConverterStations

      public Iterable<HvdcConverterStation<?>> getHvdcConverterStations()
      Description copied from interface: Network
      Get all HVDC converter stations.
      Specified by:
      getHvdcConverterStations in interface Network
      Returns:
      all HVDC converter stations
    • getHvdcConverterStationStream

      public Stream<HvdcConverterStation<?>> getHvdcConverterStationStream()
      Description copied from interface: Network
      Get all HVDC converter stations.
      Specified by:
      getHvdcConverterStationStream in interface Network
      Returns:
      all HVDC converter stations
    • getLccConverterStations

      public Iterable<LccConverterStation> getLccConverterStations()
      Description copied from interface: Network
      Get all LCC converter stations.
      Specified by:
      getLccConverterStations in interface Network
      Returns:
      all LCC converter stations
    • getLccConverterStationStream

      public Stream<LccConverterStation> getLccConverterStationStream()
      Description copied from interface: Network
      Get all LCC converter stations.
      Specified by:
      getLccConverterStationStream in interface Network
      Returns:
      all LCC converter stations
    • getLccConverterStationCount

      public int getLccConverterStationCount()
      Description copied from interface: Network
      Get LCC converter stations count.
      Specified by:
      getLccConverterStationCount in interface Network
      Returns:
      LCC converter station count
    • getLccConverterStation

      public com.powsybl.iidm.network.impl.LccConverterStationImpl getLccConverterStation(String id)
      Description copied from interface: Network
      Get an LCC converter station.
      Specified by:
      getLccConverterStation in interface Network
      Parameters:
      id - the id or an alias of the LCC converter station
      Returns:
      the LCC converter station or null if not found
    • getVscConverterStations

      public Iterable<VscConverterStation> getVscConverterStations()
      Description copied from interface: Network
      Get all VSC converter stations.
      Specified by:
      getVscConverterStations in interface Network
      Returns:
      all VSC converter stations
    • getVscConverterStationStream

      public Stream<VscConverterStation> getVscConverterStationStream()
      Description copied from interface: Network
      Get all VSC converter stations.
      Specified by:
      getVscConverterStationStream in interface Network
      Returns:
      all VSC converter stations
    • getVscConverterStationCount

      public int getVscConverterStationCount()
      Description copied from interface: Network
      Get VSC converter stations count.
      Specified by:
      getVscConverterStationCount in interface Network
      Returns:
      VSC converter station count
    • getVscConverterStation

      public com.powsybl.iidm.network.impl.VscConverterStationImpl getVscConverterStation(String id)
      Description copied from interface: Network
      Get an VSC converter station.
      Specified by:
      getVscConverterStation in interface Network
      Parameters:
      id - the id or an alias of the VSC converter station
      Returns:
      the VSC converter station or null if not found
    • getHvdcLine

      public HvdcLine getHvdcLine(String id)
      Description copied from interface: Network
      Get an HVDC line.
      Specified by:
      getHvdcLine in interface Network
      Parameters:
      id - the id or an alias of the HVDC line
      Returns:
      the HVDC line or null if not found
    • getHvdcLine

      public HvdcLine getHvdcLine(HvdcConverterStation converterStation)
      Description copied from interface: Network
      Get an HVDC line from a converter station
      Specified by:
      getHvdcLine in interface Network
      Parameters:
      converterStation - a HVDC converter station
      Returns:
      the HVDC line or null if not found
    • getHvdcLineCount

      public int getHvdcLineCount()
      Description copied from interface: Network
      Get HVDC lines count.
      Specified by:
      getHvdcLineCount in interface Network
      Returns:
      HVDC lines count
    • getHvdcLines

      public Iterable<HvdcLine> getHvdcLines()
      Description copied from interface: Network
      Get all HVDC lines.
      Specified by:
      getHvdcLines in interface Network
      Returns:
      all HVDC lines
    • getHvdcLineStream

      public Stream<HvdcLine> getHvdcLineStream()
      Description copied from interface: Network
      Get all HVDC lines.
      Specified by:
      getHvdcLineStream in interface Network
      Returns:
      all HVDC lines
    • newHvdcLine

      public HvdcLineAdder newHvdcLine()
      Description copied from interface: Network
      Get a builder to create a new HVDC line.
      Specified by:
      newHvdcLine in interface Network
      Returns:
      a builder to create a new HVDC line
    • getGround

      public Ground getGround(String id)
      Description copied from interface: Network
      Get a ground.
      Specified by:
      getGround in interface Network
      Parameters:
      id - the id or an alias of the ground
    • getGrounds

      public Iterable<Ground> getGrounds()
      Description copied from interface: Network
      Get all grounds.
      Specified by:
      getGrounds in interface Network
    • getGroundStream

      public Stream<Ground> getGroundStream()
      Description copied from interface: Network
      Get all grounds.
      Specified by:
      getGroundStream in interface Network
    • getGroundCount

      public int getGroundCount()
      Description copied from interface: Network
      Get the ground count.
      Specified by:
      getGroundCount in interface Network
    • getIdentifiable

      public Identifiable<?> getIdentifiable(String id)
      Description copied from interface: Network
      * Get an identifiable by its ID or alias
      Specified by:
      getIdentifiable in interface Network
      Parameters:
      id - the id or an alias of the identifiable
    • getIdentifiables

      public Collection<Identifiable<?>> getIdentifiables()
      Description copied from interface: Network
      Get all identifiables of the network.
      Specified by:
      getIdentifiables in interface Network
      Returns:
      all identifiables of the network
    • getConnectables

      public <C extends Connectable> Iterable<C> getConnectables(Class<C> clazz)
      Description copied from interface: Network
      Get all connectables of the network for a given type
      Specified by:
      getConnectables in interface Network
      Parameters:
      clazz - connectable type class
      Returns:
      all the connectables of the given type
    • getConnectableStream

      public <C extends Connectable> Stream<C> getConnectableStream(Class<C> clazz)
      Description copied from interface: Network
      Get a stream of all connectables of the network for a given type
      Specified by:
      getConnectableStream in interface Network
      Parameters:
      clazz - connectable type class
      Returns:
      a stream of all the connectables of the given type
    • getConnectableCount

      public <C extends Connectable> int getConnectableCount(Class<C> clazz)
      Description copied from interface: Network
      Count the connectables of the network for a given type
      Specified by:
      getConnectableCount in interface Network
      Parameters:
      clazz - connectable type class
      Returns:
      the count of all the connectables of the given type
    • getConnectables

      public Iterable<Connectable> getConnectables()
      Description copied from interface: Network
      Get all connectables of the network
      Specified by:
      getConnectables in interface Network
      Returns:
      all the connectables
    • getConnectableStream

      public Stream<Connectable> getConnectableStream()
      Description copied from interface: Network
      Get a stream of all connectables of the network
      Specified by:
      getConnectableStream in interface Network
      Returns:
      a stream of all the connectables
    • getConnectable

      public Connectable<?> getConnectable(String id)
      Description copied from interface: Network
      Get a connectable by its ID or alias
      Specified by:
      getConnectable in interface Network
      Parameters:
      id - the id or an alias of the equipment
    • getConnectableCount

      public int getConnectableCount()
      Description copied from interface: Network
      Count the connectables of the network
      Specified by:
      getConnectableCount in interface Network
      Returns:
      the count of all the connectables
    • newVoltageAngleLimit

      public VoltageAngleLimitAdder newVoltageAngleLimit()
      Description copied from interface: Network
      Get a builder to create a new VoltageAngleLimit.
      Specified by:
      newVoltageAngleLimit in interface Network
    • getBusBreakerView

      public com.powsybl.iidm.network.impl.NetworkImpl.BusBreakerViewImpl getBusBreakerView()
      Description copied from interface: Network
      Get a bus/breaker view of the network.
      Specified by:
      getBusBreakerView in interface Network
    • getBusView

      public com.powsybl.iidm.network.impl.NetworkImpl.BusViewImpl getBusView()
      Description copied from interface: Network
      Get a bus view of the network.
      Specified by:
      getBusView in interface Network
    • extendVariantArraySize

      public void extendVariantArraySize(int initVariantArraySize, int number, int sourceIndex)
      Description copied from interface: MultiVariantObject
      Called to extend the variant array.
      Specified by:
      extendVariantArraySize in interface MultiVariantObject
      Parameters:
      initVariantArraySize - initial variant array size
      number - number of element to add
      sourceIndex - the variant index to use to initialize new variants
    • reduceVariantArraySize

      public void reduceVariantArraySize(int number)
      Description copied from interface: MultiVariantObject
      Called to reduce the variant array.
      Specified by:
      reduceVariantArraySize in interface MultiVariantObject
      Parameters:
      number - number of element to remove
    • deleteVariantArrayElement

      public void deleteVariantArrayElement(int index)
      Description copied from interface: MultiVariantObject
      Called to delete a variant array element.
      Specified by:
      deleteVariantArrayElement in interface MultiVariantObject
      Parameters:
      index - the index of the variant array to delete
    • allocateVariantArrayElement

      public void allocateVariantArrayElement(int[] indexes, int sourceIndex)
      Description copied from interface: MultiVariantObject
      Called to allocate a variant array element. All new variants will be initialize using values of the variant sourceIndex.
      Specified by:
      allocateVariantArrayElement in interface MultiVariantObject
      Parameters:
      indexes - the indexes of the variant array to allocate
      sourceIndex - the variant index to use to initialize new variants
    • createSubnetwork

      public Network createSubnetwork(String subnetworkId, String name, String sourceFormat)
      Description copied from interface: Network
      Create an empty subnetwork in the current network.
      Specified by:
      createSubnetwork in interface Network
      Parameters:
      subnetworkId - id of the subnetwork
      name - subnetwork's name
      sourceFormat - source format
      Returns:
      the created subnetwork
    • detach

      public Network detach()

      Detach the current network (including its subnetworks) from its parent network.

      Note that this operation is destructive: after it the current network's content couldn't be accessed from the parent network anymore.

      The boundary elements, i.e. linking this network to an external voltage level are split if possible.
      A PowsyblException is thrown if some un-splittable boundary elements are detected. This detection is processed before any network modification. So if an un-splittable boundary element is detected, no destructive operation will be done.

      Since NetworkImpl instances are already independent networks, this method throws an IllegalStateException.

      Specified by:
      detach in interface Network
      Returns:
      a fully-independent network corresponding to the current network and its subnetworks.
    • isDetachable

      public boolean isDetachable()

      Check if the current network can be detached from its parent network (with Network.detach()).

      Since NetworkImpl instances are independent networks and can't thus be detached, this method returns false.

      Specified by:
      isDetachable in interface Network
      Returns:
      false
    • getBoundaryElements

      public Set<Identifiable<?>> getBoundaryElements()
      Description copied from interface: Network
      Return all the boundary elements of the current network, i.e. the elements which link or might link this network to an external voltage level.
      Specified by:
      getBoundaryElements in interface Network
      Returns:
      a set containing the boundary elements of the network.
    • isBoundaryElement

      public boolean isBoundaryElement(Identifiable<?> identifiable)
      Description copied from interface: Network
      Check if an identifiable is a boundary element for the current network.
      Specified by:
      isBoundaryElement in interface Network
      Parameters:
      identifiable - the identifiable to check
      Returns:
      True if the identifiable is a boundary element for the current network
    • addListener

      public void addListener(NetworkListener listener)
      Description copied from interface: Network

      Add a listener on the network.

      Specified by:
      addListener in interface Network
      Parameters:
      listener - the listener to add
    • removeListener

      public void removeListener(NetworkListener listener)
      Description copied from interface: Network

      Remove a listener from the network.

      Specified by:
      removeListener in interface Network
      Parameters:
      listener - the listener to remove
    • runValidationChecks

      public ValidationLevel runValidationChecks()
      Description copied from interface: Network
      If network is valid, do nothing.
      If network not valid, check if each network component is valid. A ValidationException is thrown with an explicit message if one network component is not valid.
      If all network components are valid, network validation status is updated to true. Return the network validation status.
      Specified by:
      runValidationChecks in interface Network
    • runValidationChecks

      public ValidationLevel runValidationChecks(boolean throwsException)
      Description copied from interface: Network
      If network is valid, do nothing.
      If network not valid and throwsException is true, check if each network component is valid. A ValidationException is thrown with an explicit message if one network component is not valid.
      If all network components are valid, network validation status is updated to true. Return the network validation status.
      Specified by:
      runValidationChecks in interface Network
    • runValidationChecks

      public ValidationLevel runValidationChecks(boolean throwsException, Reporter reporter)
      Description copied from interface: Network
      If network is valid, do nothing.
      If network not valid and throwsException is true, check if each network component is valid. A ValidationException is thrown with an explicit message if one network component is not valid.
      If all network components are valid, network validation status is updated to true. Return the network validation status.
      Specified by:
      runValidationChecks in interface Network
    • getValidationLevel

      public ValidationLevel getValidationLevel()
      Description copied from interface: Network
      Return the network validation status. Do not run any validation check.
      Specified by:
      getValidationLevel in interface Network
    • setMinimumAcceptableValidationLevel

      public Network setMinimumAcceptableValidationLevel(ValidationLevel validationLevel)
      Specified by:
      setMinimumAcceptableValidationLevel in interface Network
    • getContainerType

      public ContainerType getContainerType()
      Specified by:
      getContainerType in interface Container<Network>
    • getCaseDate

      public ZonedDateTime getCaseDate()
      Description copied from interface: Network
      Get the date that the network represents.
      Specified by:
      getCaseDate in interface Network
    • setCaseDate

      public Network setCaseDate(ZonedDateTime caseDate)
      Description copied from interface: Network
      Set the date that the network represents.
      Specified by:
      setCaseDate in interface Network
    • getForecastDistance

      public int getForecastDistance()
      Description copied from interface: Network
      Get the forecast distance in minutes.

      Example: 0 for a snapshot, 6*60 to 30*60 for a DACF.

      Specified by:
      getForecastDistance in interface Network
    • setForecastDistance

      public Network setForecastDistance(int forecastDistance)
      Specified by:
      setForecastDistance in interface Network
    • getSourceFormat

      public String getSourceFormat()
      Description copied from interface: Network
      Get the source format.
      Specified by:
      getSourceFormat in interface Network
      Returns:
      the source format
    • getTypeDescription

      protected String getTypeDescription()
    • transferExtensions

      protected static void transferExtensions(Network from, Network to)
      Transfer the extensions of a network to another one.
      Parameters:
      from - the network whose extensions must be transferred
      to - the destination network
    • getId

      public String getId()
      Description copied from interface: Identifiable
      Get the unique identifier of the object.
      Specified by:
      getId in interface Identifiable<I extends Identifiable<I>>
    • getOptionalName

      public Optional<String> getOptionalName()
      Description copied from interface: Identifiable
      Return an optional containing the name of the object if it exists. If not, return an empty optional.
      Specified by:
      getOptionalName in interface Identifiable<I extends Identifiable<I>>
    • getNameOrId

      public String getNameOrId()
      Description copied from interface: Identifiable
      Get the name of the object if it exists. If not, get the unique identifier of the object.
      Specified by:
      getNameOrId in interface Identifiable<I extends Identifiable<I>>
    • setName

      public Network setName(String name)
      Description copied from interface: Identifiable
      Update object name.
      Specified by:
      setName in interface Identifiable<I extends Identifiable<I>>
      Parameters:
      name - new name of the object (could be null to erase the name)
      Returns:
      the object itself
    • getAliases

      public Set<String> getAliases()
      Description copied from interface: Identifiable
      Get the aliases of the object.
      Specified by:
      getAliases in interface Identifiable<I extends Identifiable<I>>
    • getAliasType

      public Optional<String> getAliasType(String alias)
      Description copied from interface: Identifiable
      Get the alias type of an alias if it exists, an empty optional otherwise. If the alias does not exist, return an empty optional.
      Specified by:
      getAliasType in interface Identifiable<I extends Identifiable<I>>
    • getAliasFromType

      public Optional<String> getAliasFromType(String aliasType)
      Description copied from interface: Identifiable
      Get the alias of the object with a given alias type if it exists. Else return an empty optional.
      Specified by:
      getAliasFromType in interface Identifiable<I extends Identifiable<I>>
    • addAlias

      public void addAlias(String alias)
      Description copied from interface: Identifiable
      Add an alias to the object. Aliases must be unique in associated Network, and different from any identifiable ID. No alias type is associated to this alias. If the alias already exists (i.e. is not unique) or equals an identifiable ID, throw a PowsyblException
      Specified by:
      addAlias in interface Identifiable<I extends Identifiable<I>>
    • addAlias

      public void addAlias(String alias, boolean ensureAliasUnicity)
      Specified by:
      addAlias in interface Identifiable<I extends Identifiable<I>>
    • addAlias

      public void addAlias(String alias, String aliasType)
      Description copied from interface: Identifiable
      Add an alias to the object. Aliases must be unique in associated Network, and different from any identifiable ID. This alias is associated to a given alias type. If the given alias type is null or empty, no alias type is considered associated to the alias. Only one alias can be associated to a non null given alias type for one object. If the alias already exists (i.e. is not unique) or equals an identifiable ID, throw a PowsyblException If a given non null type already has an associated alias for this object, throw a PowsyblException
      Specified by:
      addAlias in interface Identifiable<I extends Identifiable<I>>
    • addAlias

      public void addAlias(String alias, String aliasType, boolean ensureAliasUnicity)
      Specified by:
      addAlias in interface Identifiable<I extends Identifiable<I>>
    • removeAlias

      public void removeAlias(String alias)
      Description copied from interface: Identifiable
      Remove an alias of the object. If the alias does not exist for this object, throw a PowsyblException
      Specified by:
      removeAlias in interface Identifiable<I extends Identifiable<I>>
    • hasAliases

      public boolean hasAliases()
      Description copied from interface: Identifiable
      Return true if identifiable has aliases.
      Specified by:
      hasAliases in interface Identifiable<I extends Identifiable<I>>
    • isFictitious

      public boolean isFictitious()
      Description copied from interface: Identifiable
      Get the fictitious status
      Specified by:
      isFictitious in interface Identifiable<I extends Identifiable<I>>
    • setFictitious

      public void setFictitious(boolean fictitious)
      Description copied from interface: Identifiable
      Set the fictitious status
      Specified by:
      setFictitious in interface Identifiable<I extends Identifiable<I>>
    • getMessageHeader

      public String getMessageHeader()
      Specified by:
      getMessageHeader in interface Validable
    • getProperties

      public Properties getProperties()
    • hasProperty

      public boolean hasProperty()
      Description copied from interface: Identifiable
      Check that this object has some properties.
      Specified by:
      hasProperty in interface Identifiable<I extends Identifiable<I>>
    • hasProperty

      public boolean hasProperty(String key)
      Description copied from interface: Identifiable
      Check that this object has property with specified name.
      Specified by:
      hasProperty in interface Identifiable<I extends Identifiable<I>>
    • getProperty

      public String getProperty(String key)
      Description copied from interface: Identifiable
      Get property associated to specified key.
      Specified by:
      getProperty in interface Identifiable<I extends Identifiable<I>>
    • getProperty

      public String getProperty(String key, String defaultValue)
      Description copied from interface: Identifiable
      Get property associated to specified key, with default value.
      Specified by:
      getProperty in interface Identifiable<I extends Identifiable<I>>
    • setProperty

      public String setProperty(String key, String value)
      Description copied from interface: Identifiable
      Set property value associated to specified key.
      Specified by:
      setProperty in interface Identifiable<I extends Identifiable<I>>
    • removeProperty

      public boolean removeProperty(String key)
      Description copied from interface: Identifiable
      Remove property with specified key.
      Specified by:
      removeProperty in interface Identifiable<I extends Identifiable<I>>
      Parameters:
      key - the property key
      Returns:
      true if property exists and has been removed, false otherwise
    • getPropertyNames

      public Set<String> getPropertyNames()
      Description copied from interface: Identifiable
      Get properties key values.
      Specified by:
      getPropertyNames in interface Identifiable<I extends Identifiable<I>>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • removeExtension

      public <E extends Extension<I>> boolean removeExtension(Class<E> type)
      Description copied from interface: Extendable
      Remove an extension based on its class type.
      Specified by:
      removeExtension in interface Extendable<I extends Identifiable<I>>
      Overrides:
      removeExtension in class AbstractExtendable<I extends Identifiable<I>>
      Type Parameters:
      E - the extension type
      Parameters:
      type - the extension class type
      Returns:
      true if the extension has been removed false if extension has not been found