Package com.powsybl.iidm.network
Interface Network
-
- All Superinterfaces:
Container<Network>
,Extendable<Network>
,Identifiable<Network>
- All Known Implementing Classes:
MergingView
public interface Network extends Container<Network>
A power network model.Characteristics
Attribute Type Unit Required Defaut value Description Id String - yes - Unique identifier of the network Name String - yes - Human-readable name of the network CaseDate DateTime - no Now The date of the case ForecastDistance integer - no 0 The number of minutes between the date of the case generation and the date of the case Network n = Network.create("test", "test");
The network is initially created with one variant identified by
VariantManagerConstants.INITIAL_VARIANT_ID
.VariantManager
is responsible for variant management and is accessible from the network thanks togetVariantManager()
.Instances of
Network
are not thread safe except for attributes depending of the variant (always specified in the javadoc) ifVariantManager.allowVariantMultiThreadAccess(boolean)
is set to true.- Author:
- Geoffroy Jamgotchian
- See Also:
NetworkFactory
,VariantManager
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Network.BusBreakerView
A global bus/breaker view of the network.static interface
Network.BusView
A global bus view of the network.static interface
Network.PrettyNetworkFactory
Just being able to name method create et not createNetwork.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
addListener(NetworkListener listener)
static Network
create(String id, String sourceFormat)
Create an empty network using default implementation.Iterable<Battery>
getBatteries()
Get all batteries.Battery
getBattery(String id)
Get a battery.int
getBatteryCount()
Get the battery count.Stream<Battery>
getBatteryStream()
Get all batteries.Branch
getBranch(String branchId)
Get a branchint
getBranchCount()
Get the branch count.Iterable<Branch>
getBranches()
Get all branchesStream<Branch>
getBranchStream()
Get all branchesBusbarSection
getBusbarSection(String id)
Get a busbar section from its id or an alias.int
getBusbarSectionCount()
Get the busbar section count.Iterable<BusbarSection>
getBusbarSections()
Get all busbar sections.Stream<BusbarSection>
getBusbarSectionStream()
Get all busbar sections.Network.BusBreakerView
getBusBreakerView()
Get a bus/breaker view of the network.Network.BusView
getBusView()
Get a bus view of the network.org.joda.time.DateTime
getCaseDate()
Get the date that the network represents.default Connectable<?>
getConnectable(String id)
Get a connectable by its ID or aliasdefault int
getConnectableCount()
Count the connectables of the networkdefault <C extends Connectable>
intgetConnectableCount(Class<C> clazz)
Count the connectables of the network for a given typedefault Iterable<Connectable>
getConnectables()
Get all connectables of the networkdefault <C extends Connectable>
Iterable<C>getConnectables(Class<C> clazz)
Get all connectables of the network for a given typedefault Stream<Connectable>
getConnectableStream()
Get a stream of all connectables of the networkdefault <C extends Connectable>
Stream<C>getConnectableStream(Class<C> clazz)
Get a stream of all connectables of the network for a given typeSet<Country>
getCountries()
Get all countries.int
getCountryCount()
Get the country count.DanglingLine
getDanglingLine(String id)
Get a dangling line.int
getDanglingLineCount()
Get the dangling line count.default Iterable<DanglingLine>
getDanglingLines()
Get all dangling lines.Iterable<DanglingLine>
getDanglingLines(DanglingLineFilter danglingLineFilter)
Get all dangling lines corresponding to given filter.default Stream<DanglingLine>
getDanglingLineStream()
Get all the dangling lines.Stream<DanglingLine>
getDanglingLineStream(DanglingLineFilter danglingLineFilter)
Get the dangling lines corresponding to given filter.int
getForecastDistance()
Get the forecast distance in minutes.Generator
getGenerator(String id)
Get a generator.int
getGeneratorCount()
Get the generator count.Iterable<Generator>
getGenerators()
Get all generators.Stream<Generator>
getGeneratorStream()
Get all generators.HvdcConverterStation<?>
getHvdcConverterStation(String id)
Get an HVDC converter station.int
getHvdcConverterStationCount()
Get HVDC converter stations count.Iterable<HvdcConverterStation<?>>
getHvdcConverterStations()
Get all HVDC converter stations.Stream<HvdcConverterStation<?>>
getHvdcConverterStationStream()
Get all HVDC converter stations.default HvdcLine
getHvdcLine(HvdcConverterStation converterStation)
Get an HVDC line from a converter stationHvdcLine
getHvdcLine(String id)
Get an HVDC line.int
getHvdcLineCount()
Get HVDC lines count.Iterable<HvdcLine>
getHvdcLines()
Get all HVDC lines.Stream<HvdcLine>
getHvdcLineStream()
Get all HVDC lines.Identifiable<?>
getIdentifiable(String id)
Get an equipment by its ID or aliasCollection<Identifiable<?>>
getIdentifiables()
Get all identifiables of the network.default Stream<Identifiable<?>>
getIdentifiableStream(IdentifiableType identifiableType)
LccConverterStation
getLccConverterStation(String id)
Get an LCC converter station.int
getLccConverterStationCount()
Get LCC converter stations count.Iterable<LccConverterStation>
getLccConverterStations()
Get all LCC converter stations.Stream<LccConverterStation>
getLccConverterStationStream()
Get all LCC converter stations.Line
getLine(String id)
Get a AC line.int
getLineCount()
Get the AC line count.Iterable<Line>
getLines()
Get all AC lines.Stream<Line>
getLineStream()
Get all AC lines.Load
getLoad(String id)
Get a load.int
getLoadCount()
Get the load count.Iterable<Load>
getLoads()
Get all loads.Stream<Load>
getLoadStream()
Get all loads.ShuntCompensator
getShuntCompensator(String id)
Get a compensator shunt.int
getShuntCompensatorCount()
Get the shunt count.Iterable<ShuntCompensator>
getShuntCompensators()
Get all compensator shunts.Stream<ShuntCompensator>
getShuntCompensatorStream()
Get all compensator shunts.String
getSourceFormat()
Get the source format.StaticVarCompensator
getStaticVarCompensator(String id)
Get a static var compensator.int
getStaticVarCompensatorCount()
Get the static var compensator count.Iterable<StaticVarCompensator>
getStaticVarCompensators()
Get all static var compensators.Stream<StaticVarCompensator>
getStaticVarCompensatorStream()
Get all static var compensators.Substation
getSubstation(String id)
Get a substation.int
getSubstationCount()
Get the substation count.Iterable<Substation>
getSubstations()
Get all substations.Iterable<Substation>
getSubstations(Country country, String tsoId, String... geographicalTags)
Get substation located in a specific county, TSO and marked with a list of geographical tag.Iterable<Substation>
getSubstations(String country, String tsoId, String... geographicalTags)
Get substation located in a specific county, TSO and marked with a list of geographical tag.Stream<Substation>
getSubstationStream()
Get all substations.Switch
getSwitch(String id)
Get a switch from its id or an alias.int
getSwitchCount()
Get the switch count.Iterable<Switch>
getSwitches()
Get all switches.Stream<Switch>
getSwitchStream()
Get all switches.ThreeWindingsTransformer
getThreeWindingsTransformer(String id)
Get a 3 windings transformer.int
getThreeWindingsTransformerCount()
Get the 3 windings transformer count.Iterable<ThreeWindingsTransformer>
getThreeWindingsTransformers()
Get all 3 windings transformers.Stream<ThreeWindingsTransformer>
getThreeWindingsTransformerStream()
Get all 3 windings transformers.TieLine
getTieLine(String id)
Get a tie line.int
getTieLineCount()
Get the tie line count.Iterable<TieLine>
getTieLines()
Get all tie lines.Stream<TieLine>
getTieLineStream()
Get all tie lines.TwoWindingsTransformer
getTwoWindingsTransformer(String id)
Get a two windings transformer.int
getTwoWindingsTransformerCount()
Get the two windings transformer count.Iterable<TwoWindingsTransformer>
getTwoWindingsTransformers()
Get all two windings transformers.Stream<TwoWindingsTransformer>
getTwoWindingsTransformerStream()
Get all two windings transformers.default IdentifiableType
getType()
Get identifiable type.default ValidationLevel
getValidationLevel()
Return the network validation status.VariantManager
getVariantManager()
Get the variant manager of the network.VoltageLevel
getVoltageLevel(String id)
Get a substation voltage level.int
getVoltageLevelCount()
Get the voltage level count.Iterable<VoltageLevel>
getVoltageLevels()
Get all substation voltage levels.Stream<VoltageLevel>
getVoltageLevelStream()
Get all substation voltage levels.VscConverterStation
getVscConverterStation(String id)
Get an VSC converter station.int
getVscConverterStationCount()
Get VSC converter stations count.Iterable<VscConverterStation>
getVscConverterStations()
Get all VSC converter stations.Stream<VscConverterStation>
getVscConverterStationStream()
Get all VSC converter stations.void
merge(Network other)
Merge with an other network.void
merge(Network... others)
HvdcLineAdder
newHvdcLine()
Get a builder to create a new HVDC line.LineAdder
newLine()
Get a builder to create a new AC line.SubstationAdder
newSubstation()
Get a builder to create a new substation.default ThreeWindingsTransformerAdder
newThreeWindingsTransformer()
Get a builder to create a three windings transformer.TieLineAdder
newTieLine()
Get a builder to create a new AC tie line.default TwoWindingsTransformerAdder
newTwoWindingsTransformer()
Get a builder to create a two windings transformer.default VoltageLevelAdder
newVoltageLevel()
Get a builder to create a new voltage level (without substation).static Network
read(ReadOnlyDataSource dataSource)
static Network
read(ReadOnlyDataSource... dataSources)
static Network
read(ReadOnlyDataSource dataSource, Properties properties)
static Network
read(ReadOnlyDataSource dataSource, Properties properties, Reporter reporter)
static Network
read(String file)
Loads a network from the specified file path, seeread(Path)
.static Network
read(String filename, InputStream data)
Read a network from a raw input stream, trying to guess the format from the specified filename, and using importers and post processors defined as services.static Network
read(String filename, InputStream data, Reporter reporter)
Read a network from a raw input stream, trying to guess the format from the specified filename, and using importers and post processors defined as services.static Network
read(String filename, InputStream data, ComputationManager computationManager)
Read a network from a raw input stream, trying to guess the format from the specified filename, and using importers and post processors defined as services.static Network
read(String filename, InputStream data, ComputationManager computationManager, ImportConfig config, Properties parameters)
Read a network from a raw input stream, trying to guess the format from the specified filename, and using importers and post processors defined as services.static Network
read(String filename, InputStream data, ComputationManager computationManager, ImportConfig config, Properties parameters, ImportersLoader loader)
Read a network from a raw input stream, trying to guess the format from the specified filename.static Network
read(String filename, InputStream data, ComputationManager computationManager, ImportConfig config, Properties parameters, ImportersLoader loader, Reporter reporter)
Read a network from a raw input stream, trying to guess the format from the specified filename.static Network
read(String filename, InputStream data, ComputationManager computationManager, ImportConfig config, Properties parameters, NetworkFactory networkFactory, ImportersLoader loader, Reporter reporter)
Read a network from a raw input stream, trying to guess the format from the specified filename.static Network
read(Path file)
Read a network from the specified file, trying to guess its format, and using importers and post processors defined as services.static Network
read(Path... files)
static Network
read(Path file, ComputationManager computationManager, ImportConfig config, Properties parameters)
Read a network from the specified file, trying to guess its format, and using importers and post processors defined as services.static Network
read(Path file, ComputationManager computationManager, ImportConfig config, Properties parameters, ImportersLoader loader)
Read a network from the specified file, trying to guess its format.static Network
read(Path file, ComputationManager computationManager, ImportConfig config, Properties parameters, ImportersLoader loader, Reporter reporter)
static Network
read(Path file, ComputationManager computationManager, ImportConfig config, Properties parameters, NetworkFactory networkFactory, ImportersLoader loader, Reporter reporter)
Read a network from the specified file, trying to guess its format.static Network
read(List<ReadOnlyDataSource> dataSources)
static Network
read(List<ReadOnlyDataSource> dataSources, Properties properties)
static Network
read(List<ReadOnlyDataSource> dataSources, Properties properties, Reporter reporter)
static void
readAll(Path dir, boolean parallel, ComputationManager computationManager, ImportConfig config, Consumer<Network> consumer)
static void
readAll(Path dir, boolean parallel, ComputationManager computationManager, ImportConfig config, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener)
static void
readAll(Path dir, boolean parallel, ComputationManager computationManager, ImportConfig config, Properties parameters, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener)
static void
readAll(Path dir, boolean parallel, ImportersLoader loader, ComputationManager computationManager, ImportConfig config, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener)
static void
readAll(Path dir, boolean parallel, ImportersLoader loader, ComputationManager computationManager, ImportConfig config, Properties parameters, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener)
static void
readAll(Path dir, boolean parallel, ImportersLoader loader, ComputationManager computationManager, ImportConfig config, Properties parameters, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener, Reporter reporter)
static void
readAll(Path dir, boolean parallel, ImportersLoader loader, ComputationManager computationManager, ImportConfig config, Properties parameters, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener, NetworkFactory networkFactory, Reporter reporter)
static void
readAll(Path dir, boolean parallel, Consumer<Network> consumer)
static void
readAll(Path dir, boolean parallel, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener)
static void
readAll(Path dir, Consumer<Network> consumer)
void
removeListener(NetworkListener listener)
default ValidationLevel
runValidationChecks()
If network is valid, do nothing.
If network not valid, check if each network component is valid.default ValidationLevel
runValidationChecks(boolean throwsException)
If network is valid, do nothing.
If network not valid andthrowsException
istrue
, check if each network component is valid.default ValidationLevel
runValidationChecks(boolean throwsException, Reporter reporter)
If network is valid, do nothing.
If network not valid andthrowsException
istrue
, check if each network component is valid.Network
setCaseDate(org.joda.time.DateTime date)
Set the date that the network represents.Network
setForecastDistance(int forecastDistance)
default Network
setMinimumAcceptableValidationLevel(ValidationLevel validationLevel)
static Network.PrettyNetworkFactory
with(String name)
Get network factory namedname
.default void
write(ExportersLoader loader, String format, Properties parameters, DataSource dataSource)
default void
write(ExportersLoader loader, String format, Properties parameters, DataSource dataSource, Reporter reporter)
Write the network to a given format.default void
write(ExportersLoader loader, String format, Properties parameters, String directory, String basename)
default void
write(ExportersLoader loader, String format, Properties parameters, String directory, String baseName, Reporter reporter)
Write the network to a given format.default void
write(ExportersLoader loader, String format, Properties parameters, Path file)
default void
write(ExportersLoader loader, String format, Properties parameters, Path file, Reporter reporter)
Write the network to a given format.default void
write(String format, Properties parameters, DataSource dataSource)
default void
write(String format, Properties parameters, String directory, String baseName)
default void
write(String format, Properties parameters, Path file)
-
Methods inherited from interface com.powsybl.iidm.network.Container
getContainerType
-
Methods inherited from interface com.powsybl.commons.extensions.Extendable
addExtension, getExtension, getExtensionByName, getExtensions, getImplementationName, newExtension, removeExtension
-
Methods inherited from interface com.powsybl.iidm.network.Identifiable
addAlias, addAlias, addAlias, addAlias, getAliases, getAliasFromType, getAliasType, getId, getName, getNameOrId, getNetwork, getOptionalName, getProperties, getProperty, getProperty, getPropertyNames, hasAliases, hasProperty, hasProperty, isFictitious, removeAlias, removeProperty, setFictitious, setName, setProperty
-
-
-
-
Method Detail
-
read
static Network read(Path file, ComputationManager computationManager, ImportConfig config, Properties parameters, NetworkFactory networkFactory, ImportersLoader loader, Reporter reporter)
Read a network from the specified file, trying to guess its format.- Parameters:
file
- The file to be loaded.computationManager
- A computation manager which may be used by import post-processorsconfig
- The import config, in particular definition of post processorsparameters
- Import-specific parametersnetworkFactory
- Network factoryloader
- Provides the list of available importers and post-processorsreporter
- The reporter used for functional logs- Returns:
- The loaded network
-
read
static Network read(Path file, ComputationManager computationManager, ImportConfig config, Properties parameters, ImportersLoader loader, Reporter reporter)
-
read
static Network read(Path file, ComputationManager computationManager, ImportConfig config, Properties parameters, ImportersLoader loader)
Read a network from the specified file, trying to guess its format.- Parameters:
file
- The file to be loaded.computationManager
- A computation manager which may be used by import post-processorsconfig
- The import config, in particular definition of post processorsparameters
- Import-specific parametersloader
- Provides the list of available importers and post-processors- Returns:
- The loaded network
-
read
static Network read(Path file, ComputationManager computationManager, ImportConfig config, Properties parameters)
Read a network from the specified file, trying to guess its format, and using importers and post processors defined as services.- Parameters:
file
- The file to be loaded.computationManager
- A computation manager which may be used by import post-processorsconfig
- The import config, in particular definition of post processorsparameters
- Import-specific parameters- Returns:
- The loaded network
-
read
static Network read(Path file)
Read a network from the specified file, trying to guess its format, and using importers and post processors defined as services. Import will be performed using import configuration defined in default platform config, and with no importer-specific parameters. Post processors will use the defaultLocalComputationManager
, as defined in default platform config.- Parameters:
file
- The file to be loaded.- Returns:
- The loaded network
-
read
static Network read(String file)
Loads a network from the specified file path, seeread(Path)
.- Parameters:
file
- The file to be loaded.- Returns:
- The loaded network
-
read
static Network read(String filename, InputStream data, ComputationManager computationManager, ImportConfig config, Properties parameters, NetworkFactory networkFactory, ImportersLoader loader, Reporter reporter)
Read a network from a raw input stream, trying to guess the format from the specified filename. Please note that the input stream must be from a simple file, not a zipped one.- Parameters:
filename
- The name of the file to be imported.data
- The raw data from which the network should be loadedcomputationManager
- A computation manager which may be used by import post-processorsconfig
- The import config, in particular definition of post processorsparameters
- Import-specific parametersnetworkFactory
- Network factoryloader
- Provides the list of available importers and post-processorsreporter
- The reporter used for functional logs- Returns:
- The loaded network
-
read
static Network read(String filename, InputStream data, ComputationManager computationManager, ImportConfig config, Properties parameters, ImportersLoader loader, Reporter reporter)
Read a network from a raw input stream, trying to guess the format from the specified filename. Please note that the input stream must be from a simple file, not a zipped one.- Parameters:
filename
- The name of the file to be imported.data
- The raw data from which the network should be loadedcomputationManager
- A computation manager which may be used by import post-processorsconfig
- The import config, in particular definition of post processorsparameters
- Import-specific parametersloader
- Provides the list of available importers and post-processorsreporter
- The reporter used for functional logs- Returns:
- The loaded network
-
read
static Network read(String filename, InputStream data, ComputationManager computationManager, ImportConfig config, Properties parameters, ImportersLoader loader)
Read a network from a raw input stream, trying to guess the format from the specified filename. Please note that the input stream must be from a simple file, not a zipped one.- Parameters:
filename
- The name of the file to be imported.data
- The raw data from which the network should be loadedcomputationManager
- A computation manager which may be used by import post-processorsconfig
- The import config, in particular definition of post processorsparameters
- Import-specific parametersloader
- Provides the list of available importers and post-processors- Returns:
- The loaded network
-
read
static Network read(String filename, InputStream data, ComputationManager computationManager, ImportConfig config, Properties parameters)
Read a network from a raw input stream, trying to guess the format from the specified filename, and using importers and post processors defined as services. Please note that the input stream must be from a simple file, not a zipped one.- Parameters:
filename
- The name of the file to be imported.data
- The raw data from which the network should be loadedcomputationManager
- A computation manager which may be used by import post-processorsconfig
- The import config, in particular definition of post processorsparameters
- Import-specific parameters- Returns:
- The loaded network
-
read
static Network read(String filename, InputStream data, ComputationManager computationManager)
Read a network from a raw input stream, trying to guess the format from the specified filename, and using importers and post processors defined as services. Import will be performed using import configuration defined in default platform config, and with no importer-specific parameters. Please note that the input stream must be from a simple file, not a zipped one.- Parameters:
filename
- The name of the file to be imported.data
- The raw data from which the network should be loadedcomputationManager
- A computation manager which may be used by import post-processors- Returns:
- The loaded network
-
read
static Network read(String filename, InputStream data)
Read a network from a raw input stream, trying to guess the format from the specified filename, and using importers and post processors defined as services. Import will be performed using import configuration defined in default platform config, and with no importer-specific parameters. Post processors will use the defaultLocalComputationManager
, as defined in default platform config. Please note that the input stream must be from a simple file, not a zipped one.- Parameters:
filename
- The name of the file to be imported.data
- The raw data from which the network should be loaded- Returns:
- The loaded network
-
read
static Network read(String filename, InputStream data, Reporter reporter)
Read a network from a raw input stream, trying to guess the format from the specified filename, and using importers and post processors defined as services. Import will be performed using import configuration defined in default platform config, and with no importer-specific parameters. Post processors will use the defaultLocalComputationManager
, as defined in default platform config. Please note that the input stream must be from a simple file, not a zipped one.- Parameters:
filename
- The name of the file to be imported.data
- The raw data from which the network should be loadedreporter
- The reporter used for functional logs- Returns:
- The loaded network
-
read
static Network read(ReadOnlyDataSource dataSource)
-
read
static Network read(ReadOnlyDataSource dataSource, Properties properties)
-
read
static Network read(ReadOnlyDataSource dataSource, Properties properties, Reporter reporter)
-
read
static Network read(ReadOnlyDataSource... dataSources)
-
read
static Network read(List<ReadOnlyDataSource> dataSources)
-
read
static Network read(List<ReadOnlyDataSource> dataSources, Properties properties)
-
read
static Network read(List<ReadOnlyDataSource> dataSources, Properties properties, Reporter reporter)
-
readAll
static void readAll(Path dir, boolean parallel, ImportersLoader loader, ComputationManager computationManager, ImportConfig config, Properties parameters, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener, NetworkFactory networkFactory, Reporter reporter) throws IOException, InterruptedException, ExecutionException
-
readAll
static void readAll(Path dir, boolean parallel, ImportersLoader loader, ComputationManager computationManager, ImportConfig config, Properties parameters, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener, Reporter reporter) throws IOException, InterruptedException, ExecutionException
-
readAll
static void readAll(Path dir, boolean parallel, ImportersLoader loader, ComputationManager computationManager, ImportConfig config, Properties parameters, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener) throws IOException, InterruptedException, ExecutionException
-
readAll
static void readAll(Path dir, boolean parallel, ImportersLoader loader, ComputationManager computationManager, ImportConfig config, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener) throws IOException, InterruptedException, ExecutionException
-
readAll
static void readAll(Path dir, boolean parallel, ComputationManager computationManager, ImportConfig config, Properties parameters, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener) throws IOException, InterruptedException, ExecutionException
-
readAll
static void readAll(Path dir, boolean parallel, ComputationManager computationManager, ImportConfig config, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener) throws IOException, InterruptedException, ExecutionException
-
readAll
static void readAll(Path dir, boolean parallel, ComputationManager computationManager, ImportConfig config, Consumer<Network> consumer) throws IOException, InterruptedException, ExecutionException
-
readAll
static void readAll(Path dir, boolean parallel, Consumer<Network> consumer) throws IOException, InterruptedException, ExecutionException
-
readAll
static void readAll(Path dir, boolean parallel, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener) throws IOException, InterruptedException, ExecutionException
-
readAll
static void readAll(Path dir, Consumer<Network> consumer) throws IOException, InterruptedException, ExecutionException
-
create
static Network create(String id, String sourceFormat)
Create an empty network using default implementation.- Parameters:
id
- id of the networksourceFormat
- source format- Returns:
- an empty network
-
with
static Network.PrettyNetworkFactory with(String name)
Get network factory namedname
.- Parameters:
name
- name of theNetworkFactory
- Returns:
- network factory with the given name
-
getCaseDate
org.joda.time.DateTime getCaseDate()
Get the date that the network represents.
-
setCaseDate
Network setCaseDate(org.joda.time.DateTime date)
Set the date that the network represents.- Throws:
IllegalArgumentException
- if date is null.
-
getForecastDistance
int getForecastDistance()
Get the forecast distance in minutes.Example: 0 for a snapshot, 6*60 to 30*60 for a DACF.
-
setForecastDistance
Network setForecastDistance(int forecastDistance)
-
getSourceFormat
String getSourceFormat()
Get the source format.- Returns:
- the source format
-
getVariantManager
VariantManager getVariantManager()
Get the variant manager of the network.
-
getCountryCount
int getCountryCount()
Get the country count.
-
newSubstation
SubstationAdder newSubstation()
Get a builder to create a new substation.
-
getSubstations
Iterable<Substation> getSubstations()
Get all substations.
-
getSubstationStream
Stream<Substation> getSubstationStream()
Get all substations.
-
getSubstationCount
int getSubstationCount()
Get the substation count.
-
getSubstations
Iterable<Substation> getSubstations(Country country, String tsoId, String... geographicalTags)
Get substation located in a specific county, TSO and marked with a list of geographical tag.- Parameters:
country
- the country, ifnull
there is no filtering on countriestsoId
- the id of the TSO, ifnull
there is no filtering on TSOsgeographicalTags
- a list a geographical tags
-
getSubstations
Iterable<Substation> getSubstations(String country, String tsoId, String... geographicalTags)
Get substation located in a specific county, TSO and marked with a list of geographical tag.- Parameters:
country
- the country name, if empty string, the filtering will be on substations without country, ifnull
there is no filtering on countriestsoId
- the id of the TSO, ifnull
there is no filtering on TSOsgeographicalTags
- a list a geographical tags
-
getSubstation
Substation getSubstation(String id)
Get a substation.- Parameters:
id
- the id or an alias of the substation
-
newVoltageLevel
default VoltageLevelAdder newVoltageLevel()
Get a builder to create a new voltage level (without substation). Note: if this method is not implemented, it will create an intermediary fictitiousSubstation
.
-
getVoltageLevels
Iterable<VoltageLevel> getVoltageLevels()
Get all substation voltage levels.
-
getVoltageLevelStream
Stream<VoltageLevel> getVoltageLevelStream()
Get all substation voltage levels.
-
getVoltageLevelCount
int getVoltageLevelCount()
Get the voltage level count.
-
getVoltageLevel
VoltageLevel getVoltageLevel(String id)
Get a substation voltage level.- Parameters:
id
- the id or an alias of the substation voltage level
-
newLine
LineAdder newLine()
Get a builder to create a new AC line.
-
getBranch
Branch getBranch(String branchId)
Get a branch- Parameters:
branchId
- the id of the branch
-
getBranchCount
int getBranchCount()
Get the branch count.
-
getLineCount
int getLineCount()
Get the AC line count.
-
getTieLineCount
int getTieLineCount()
Get the tie line count.
-
getTieLine
TieLine getTieLine(String id)
Get a tie line.- Parameters:
id
- the id or an alias of the AC line
-
newTieLine
TieLineAdder newTieLine()
Get a builder to create a new AC tie line.
-
newTwoWindingsTransformer
default TwoWindingsTransformerAdder newTwoWindingsTransformer()
Get a builder to create a two windings transformer. Only use if at least one of the transformer's ends does not belong to any substation. Else useSubstation.newTwoWindingsTransformer()
. Note: if this method is not implemented, it will create an intermediary fictitiousSubstation
.
-
getTwoWindingsTransformers
Iterable<TwoWindingsTransformer> getTwoWindingsTransformers()
Get all two windings transformers.
-
getTwoWindingsTransformerStream
Stream<TwoWindingsTransformer> getTwoWindingsTransformerStream()
Get all two windings transformers.
-
getTwoWindingsTransformerCount
int getTwoWindingsTransformerCount()
Get the two windings transformer count.
-
getTwoWindingsTransformer
TwoWindingsTransformer getTwoWindingsTransformer(String id)
Get a two windings transformer.- Parameters:
id
- the id or an alias of the two windings transformer
-
newThreeWindingsTransformer
default ThreeWindingsTransformerAdder newThreeWindingsTransformer()
Get a builder to create a three windings transformer. Only use this builder if at least one of the transformer's ends does not belong to any substation. Else useSubstation.newThreeWindingsTransformer()
. Note: if this method is not implemented, it will create an intermediary fictitiousSubstation
.
-
getThreeWindingsTransformers
Iterable<ThreeWindingsTransformer> getThreeWindingsTransformers()
Get all 3 windings transformers.
-
getThreeWindingsTransformerStream
Stream<ThreeWindingsTransformer> getThreeWindingsTransformerStream()
Get all 3 windings transformers.
-
getThreeWindingsTransformerCount
int getThreeWindingsTransformerCount()
Get the 3 windings transformer count.
-
getThreeWindingsTransformer
ThreeWindingsTransformer getThreeWindingsTransformer(String id)
Get a 3 windings transformer.- Parameters:
id
- the id or an alias of the 3 windings transformer
-
getGeneratorCount
int getGeneratorCount()
Get the generator count.
-
getGenerator
Generator getGenerator(String id)
Get a generator.- Parameters:
id
- the id or an alias of the generator
-
getBatteryCount
int getBatteryCount()
Get the battery count.
-
getBattery
Battery getBattery(String id)
Get a battery.- Parameters:
id
- the id or an alias of the battery
-
getLoadCount
int getLoadCount()
Get the load count.
-
getShuntCompensators
Iterable<ShuntCompensator> getShuntCompensators()
Get all compensator shunts.
-
getShuntCompensatorStream
Stream<ShuntCompensator> getShuntCompensatorStream()
Get all compensator shunts.
-
getShuntCompensatorCount
int getShuntCompensatorCount()
Get the shunt count.
-
getShuntCompensator
ShuntCompensator getShuntCompensator(String id)
Get a compensator shunt.- Parameters:
id
- the id or an alias of the compensator shunt
-
getDanglingLines
Iterable<DanglingLine> getDanglingLines(DanglingLineFilter danglingLineFilter)
Get all dangling lines corresponding to given filter.
-
getDanglingLines
default Iterable<DanglingLine> getDanglingLines()
Get all dangling lines.
-
getDanglingLineStream
Stream<DanglingLine> getDanglingLineStream(DanglingLineFilter danglingLineFilter)
Get the dangling lines corresponding to given filter.
-
getDanglingLineStream
default Stream<DanglingLine> getDanglingLineStream()
Get all the dangling lines.
-
getDanglingLineCount
int getDanglingLineCount()
Get the dangling line count.
-
getDanglingLine
DanglingLine getDanglingLine(String id)
Get a dangling line.- Parameters:
id
- the id or an alias of the dangling line
-
getStaticVarCompensators
Iterable<StaticVarCompensator> getStaticVarCompensators()
Get all static var compensators.
-
getStaticVarCompensatorStream
Stream<StaticVarCompensator> getStaticVarCompensatorStream()
Get all static var compensators.
-
getStaticVarCompensatorCount
int getStaticVarCompensatorCount()
Get the static var compensator count.
-
getStaticVarCompensator
StaticVarCompensator getStaticVarCompensator(String id)
Get a static var compensator.- Parameters:
id
- the id or an alias of the static var compensator
-
getSwitch
Switch getSwitch(String id)
Get a switch from its id or an alias.- Parameters:
id
- id or an alias of the switch- Returns:
- the switch
-
getSwitchCount
int getSwitchCount()
Get the switch count.- Returns:
- the switch count
-
getBusbarSection
BusbarSection getBusbarSection(String id)
Get a busbar section from its id or an alias.- Parameters:
id
- the id or an alias of the busbar section- Returns:
- the busbar section
-
getBusbarSections
Iterable<BusbarSection> getBusbarSections()
Get all busbar sections.- Returns:
- all busbar sections
-
getBusbarSectionStream
Stream<BusbarSection> getBusbarSectionStream()
Get all busbar sections.- Returns:
- all busbar sections
-
getBusbarSectionCount
int getBusbarSectionCount()
Get the busbar section count.- Returns:
- the busbar section count.
-
getHvdcConverterStations
Iterable<HvdcConverterStation<?>> getHvdcConverterStations()
Get all HVDC converter stations.- Returns:
- all HVDC converter stations
-
getHvdcConverterStationStream
Stream<HvdcConverterStation<?>> getHvdcConverterStationStream()
Get all HVDC converter stations.- Returns:
- all HVDC converter stations
-
getHvdcConverterStationCount
int getHvdcConverterStationCount()
Get HVDC converter stations count.- Returns:
- HVDC converter station count
-
getHvdcConverterStation
HvdcConverterStation<?> getHvdcConverterStation(String id)
Get an HVDC converter station.- Parameters:
id
- the id or an alias of the HVDC converter station- Returns:
- the HVDC converter station or null if not found
-
getLccConverterStations
Iterable<LccConverterStation> getLccConverterStations()
Get all LCC converter stations.- Returns:
- all LCC converter stations
-
getLccConverterStationStream
Stream<LccConverterStation> getLccConverterStationStream()
Get all LCC converter stations.- Returns:
- all LCC converter stations
-
getLccConverterStationCount
int getLccConverterStationCount()
Get LCC converter stations count.- Returns:
- LCC converter station count
-
getLccConverterStation
LccConverterStation getLccConverterStation(String id)
Get an LCC converter station.- Parameters:
id
- the id or an alias of the LCC converter station- Returns:
- the LCC converter station or null if not found
-
getVscConverterStations
Iterable<VscConverterStation> getVscConverterStations()
Get all VSC converter stations.- Returns:
- all VSC converter stations
-
getVscConverterStationStream
Stream<VscConverterStation> getVscConverterStationStream()
Get all VSC converter stations.- Returns:
- all VSC converter stations
-
getVscConverterStationCount
int getVscConverterStationCount()
Get VSC converter stations count.- Returns:
- VSC converter station count
-
getVscConverterStation
VscConverterStation getVscConverterStation(String id)
Get an VSC converter station.- Parameters:
id
- the id or an alias of the VSC converter station- Returns:
- the VSC converter station or null if not found
-
getHvdcLineCount
int getHvdcLineCount()
Get HVDC lines count.- Returns:
- HVDC lines count
-
getHvdcLine
HvdcLine getHvdcLine(String id)
Get an HVDC line.- Parameters:
id
- the id or an alias of the HVDC line- Returns:
- the HVDC line or null if not found
-
getHvdcLine
default HvdcLine getHvdcLine(HvdcConverterStation converterStation)
Get an HVDC line from a converter station- Parameters:
converterStation
- a HVDC converter station- Returns:
- the HVDC line or null if not found
-
newHvdcLine
HvdcLineAdder newHvdcLine()
Get a builder to create a new HVDC line.- Returns:
- a builder to create a new HVDC line
-
getIdentifiable
Identifiable<?> getIdentifiable(String id)
Get an equipment by its ID or alias- Parameters:
id
- the id or an alias of the equipment
-
getIdentifiables
Collection<Identifiable<?>> getIdentifiables()
Get all identifiables of the network.- Returns:
- all identifiables of the network
-
getConnectables
default <C extends Connectable> Iterable<C> getConnectables(Class<C> clazz)
Get all connectables of the network for a given type- Parameters:
clazz
- connectable type class- Returns:
- all the connectables of the given type
-
getConnectableStream
default <C extends Connectable> Stream<C> getConnectableStream(Class<C> clazz)
Get a stream of all connectables of the network for a given type- Parameters:
clazz
- connectable type class- Returns:
- a stream of all the connectables of the given type
-
getConnectableCount
default <C extends Connectable> int getConnectableCount(Class<C> clazz)
Count the connectables of the network for a given type- Parameters:
clazz
- connectable type class- Returns:
- the count of all the connectables of the given type
-
getConnectables
default Iterable<Connectable> getConnectables()
Get all connectables of the network- Returns:
- all the connectables
-
getConnectableStream
default Stream<Connectable> getConnectableStream()
Get a stream of all connectables of the network- Returns:
- a stream of all the connectables
-
getConnectable
default Connectable<?> getConnectable(String id)
Get a connectable by its ID or alias- Parameters:
id
- the id or an alias of the equipment
-
getConnectableCount
default int getConnectableCount()
Count the connectables of the network- Returns:
- the count of all the connectables
-
getBusBreakerView
Network.BusBreakerView getBusBreakerView()
Get a bus/breaker view of the network.
-
getBusView
Network.BusView getBusView()
Get a bus view of the network.
-
merge
void merge(Network other)
Merge with an other network. At the end of the merge the other network is empty.- Parameters:
other
- the other network
-
merge
void merge(Network... others)
-
addListener
void addListener(NetworkListener listener)
-
removeListener
void removeListener(NetworkListener listener)
-
getType
default IdentifiableType getType()
Description copied from interface:Identifiable
Get identifiable type.- Specified by:
getType
in interfaceIdentifiable<Network>
- Returns:
- the identifiable type
-
runValidationChecks
default ValidationLevel runValidationChecks()
If network is valid, do nothing.
If network not valid, check if each network component is valid. AValidationException
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.
-
runValidationChecks
default ValidationLevel runValidationChecks(boolean throwsException)
If network is valid, do nothing.
If network not valid andthrowsException
istrue
, check if each network component is valid. AValidationException
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.
-
runValidationChecks
default ValidationLevel runValidationChecks(boolean throwsException, Reporter reporter)
If network is valid, do nothing.
If network not valid andthrowsException
istrue
, check if each network component is valid. AValidationException
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.
-
getValidationLevel
default ValidationLevel getValidationLevel()
Return the network validation status. Do not run any validation check.
-
setMinimumAcceptableValidationLevel
default Network setMinimumAcceptableValidationLevel(ValidationLevel validationLevel)
-
getIdentifiableStream
default Stream<Identifiable<?>> getIdentifiableStream(IdentifiableType identifiableType)
-
write
default void write(ExportersLoader loader, String format, Properties parameters, DataSource dataSource, Reporter reporter)
Write the network to a given format.- Parameters:
format
- the export formatparameters
- some properties to configure the exportdataSource
- data sourcereporter
- the reporter used for functional logs
-
write
default void write(ExportersLoader loader, String format, Properties parameters, DataSource dataSource)
-
write
default void write(String format, Properties parameters, DataSource dataSource)
-
write
default void write(ExportersLoader loader, String format, Properties parameters, Path file, Reporter reporter)
Write the network to a given format.- Parameters:
format
- the export formatparameters
- some properties to configure the exportfile
- the network filereporter
- the reporter used for functional logs
-
write
default void write(ExportersLoader loader, String format, Properties parameters, Path file)
-
write
default void write(String format, Properties parameters, Path file)
-
write
default void write(ExportersLoader loader, String format, Properties parameters, String directory, String baseName, Reporter reporter)
Write the network to a given format.- Parameters:
format
- the export formatparameters
- some properties to configure the exportdirectory
- the output directory where files are generatedbaseName
- a base name for all generated filesreporter
- the reporter used for functional logs
-
write
default void write(ExportersLoader loader, String format, Properties parameters, String directory, String basename)
-
write
default void write(String format, Properties parameters, String directory, String baseName)
-
-