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 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.Iterable<DanglingLine>
getDanglingLines()
Get all dangling lines.Stream<DanglingLine>
getDanglingLineStream()
Get all dangling lines.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.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.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).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
.-
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, setProperty
-
-
-
-
Method Detail
-
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.
-
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()
Get all dangling lines.
-
getDanglingLineStream
Stream<DanglingLine> getDanglingLineStream()
Get all 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
-
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)
-
-