Package com.powsybl.iidm.network.impl
Class BatteryImpl
- java.lang.Object
-
- com.powsybl.commons.extensions.AbstractExtendable<I>
-
- com.powsybl.iidm.network.impl.BatteryImpl
-
- All Implemented Interfaces:
Extendable<Battery>
,Battery
,Connectable<Battery>
,Identifiable<Battery>
,MultiVariantObject
,Injection<Battery>
,ReactiveLimitsHolder
,Validable
public class BatteryImpl extends AbstractExtendable<I> implements Battery
- Author:
- Ghiles Abdellah
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
fictitious
protected String
id
protected String
name
protected Properties
properties
protected List<com.powsybl.iidm.network.impl.TerminalExt>
terminals
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAlias(String alias)
Add an alias to the object.void
addAlias(String alias, boolean ensureAliasUnicity)
void
addAlias(String alias, String aliasType)
Add an alias to the object.void
addAlias(String alias, String aliasType, boolean ensureAliasUnicity)
void
allocateVariantArrayElement(int[] indexes, int sourceIndex)
Called to allocate a variant array element.void
deleteVariantArrayElement(int index)
Called to delete a variant array element.void
extendVariantArraySize(int initVariantArraySize, int number, int sourceIndex)
Called to extend the variant array.Set<String>
getAliases()
Get the aliases of the object.Optional<String>
getAliasFromType(String aliasType)
Get the alias of the object with a given alias type if it exists.Optional<String>
getAliasType(String alias)
Get the alias type of an alias if it exists, an empty optional otherwise.String
getId()
Get the unique identifier of the object.double
getMaxP()
Get the maximal active power in MW.String
getMessageHeader()
double
getMinP()
Get the minimal active power in MW.String
getNameOrId()
Get the name of the object if it exists.com.powsybl.iidm.network.impl.NetworkImpl
getNetwork()
Get the network associated to the object.Optional<String>
getOptionalName()
Return an optional containing the name of the object if it exists.double
getP0()
Get the constant active power in MW.Properties
getProperties()
Get properties associated to the object.String
getProperty(String key)
Get property associated to specified key.String
getProperty(String key, String defaultValue)
Get property associated to specified key, with default value.Set<String>
getPropertyNames()
Get properties key values.double
getQ0()
Get the constant reactive power in MVar.ReactiveLimits
getReactiveLimits()
Get reactive limits of the generator.<R extends ReactiveLimits>
RgetReactiveLimits(Class<R> type)
com.powsybl.iidm.network.impl.TerminalExt
getTerminal()
Get the terminal.List<com.powsybl.iidm.network.impl.TerminalExt>
getTerminals()
protected String
getTypeDescription()
boolean
hasAliases()
Return true if identifiable has aliases.boolean
hasProperty()
Check that this object has some properties.boolean
hasProperty(String key)
Check that this object has property with specified name.boolean
isFictitious()
Get the fictitious statusprotected void
move(com.powsybl.iidm.network.impl.TerminalExt oldTerminal, String oldConnectionInfo, int node, String voltageLevelId)
protected void
move(com.powsybl.iidm.network.impl.TerminalExt oldTerminal, String oldConnectionInfo, String busId, boolean connected)
MinMaxReactiveLimitsAdder
newMinMaxReactiveLimits()
Get a builder to create and associate minimum and maximum reactive limits to this generator.ReactiveCapabilityCurveAdder
newReactiveCapabilityCurve()
Get a builder to create and associate a new reactive capability curve to this generator.protected void
notifyUpdate(String attribute, Object oldValue, Object newValue)
protected void
notifyUpdate(String attribute, String variantId, Object oldValue, Object newValue)
protected void
notifyUpdate(Supplier<String> attribute, Object oldValue, Object newValue)
protected void
notifyUpdate(Supplier<String> attribute, String variantId, Object oldValue, Object newValue)
void
reduceVariantArraySize(int number)
Called to reduce the variant array.void
remove(boolean removeDanglingSwitches)
Remove the connectable from the voltage level.void
removeAlias(String alias)
Remove an alias of the object.boolean
removeProperty(String key)
Remove property with specified key.void
setFictitious(boolean fictitious)
Set the fictitious statusBattery
setMaxP(double maxP)
Set the maximal active power in MW.Battery
setMinP(double minP)
Set the minimal active power in MW.I
setName(String name)
Battery
setP0(double p0)
Set the constant active power in MW.String
setProperty(String key, String value)
Set property value associated to specified key.Battery
setQ0(double q0)
Set the constant reactive power in MVar.void
setReactiveLimits(ReactiveLimits reactiveLimits)
String
toString()
-
Methods inherited from class com.powsybl.commons.extensions.AbstractExtendable
addExtension, getExtension, getExtensionByName, getExtensions, getImplementationName, removeExtension
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.powsybl.iidm.network.Connectable
getTerminals, remove, remove
-
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
-
-
-
-
Field Detail
-
terminals
protected final List<com.powsybl.iidm.network.impl.TerminalExt> terminals
-
id
protected final String id
-
name
protected String name
-
fictitious
protected boolean fictitious
-
properties
protected final Properties properties
-
-
Method Detail
-
getTypeDescription
protected String getTypeDescription()
-
getP0
public double getP0()
Get the constant active power in MW.Depends on the working variant.
- Specified by:
getP0
in interfaceBattery
- See Also:
VariantManager
-
setP0
public Battery setP0(double p0)
Set the constant active power in MW.Depends on the working variant.
- Specified by:
setP0
in interfaceBattery
- See Also:
VariantManager
-
getQ0
public double getQ0()
Get the constant reactive power in MVar.Depends on the working variant.
- Specified by:
getQ0
in interfaceBattery
- See Also:
VariantManager
-
setQ0
public Battery setQ0(double q0)
Set the constant reactive power in MVar.Depends on the working variant.
- Specified by:
setQ0
in interfaceBattery
- See Also:
VariantManager
-
getMinP
public double getMinP()
Get the minimal active power in MW.
-
setMinP
public Battery setMinP(double minP)
Set the minimal active power in MW.
-
getMaxP
public double getMaxP()
Get the maximal active power in MW.
-
setMaxP
public Battery setMaxP(double maxP)
Set the maximal active power in MW.
-
getTerminal
public com.powsybl.iidm.network.impl.TerminalExt getTerminal()
Get the terminal.- Specified by:
getTerminal
in interfaceInjection<Battery>
-
getReactiveLimits
public ReactiveLimits getReactiveLimits()
Get reactive limits of the generator.- Specified by:
getReactiveLimits
in interfaceReactiveLimitsHolder
-
setReactiveLimits
public void setReactiveLimits(ReactiveLimits reactiveLimits)
-
getReactiveLimits
public <R extends ReactiveLimits> R getReactiveLimits(Class<R> type)
- Specified by:
getReactiveLimits
in interfaceReactiveLimitsHolder
-
newReactiveCapabilityCurve
public ReactiveCapabilityCurveAdder newReactiveCapabilityCurve()
Get a builder to create and associate a new reactive capability curve to this generator.- Specified by:
newReactiveCapabilityCurve
in interfaceReactiveLimitsHolder
-
newMinMaxReactiveLimits
public MinMaxReactiveLimitsAdder newMinMaxReactiveLimits()
Get a builder to create and associate minimum and maximum reactive limits to this generator.- Specified by:
newMinMaxReactiveLimits
in interfaceReactiveLimitsHolder
-
extendVariantArraySize
public void extendVariantArraySize(int initVariantArraySize, int number, int sourceIndex)
Called to extend the variant array.- Specified by:
extendVariantArraySize
in interfaceMultiVariantObject
- Parameters:
initVariantArraySize
- initial variant array sizenumber
- number of element to addsourceIndex
- the variant index to use to initialize new variants
-
reduceVariantArraySize
public void reduceVariantArraySize(int number)
Called to reduce the variant array.- Specified by:
reduceVariantArraySize
in interfaceMultiVariantObject
- Parameters:
number
- number of element to remove
-
allocateVariantArrayElement
public void allocateVariantArrayElement(int[] indexes, int sourceIndex)
Called to allocate a variant array element. All new variants will be initialize using values of the variant sourceIndex.- Specified by:
allocateVariantArrayElement
in interfaceMultiVariantObject
- Parameters:
indexes
- the indexes of the variant array to allocatesourceIndex
- the variant index to use to initialize new variants
-
setName
public I setName(String name)
-
getTerminals
public List<com.powsybl.iidm.network.impl.TerminalExt> getTerminals()
- Specified by:
getTerminals
in interfaceConnectable<I extends Connectable<I>>
-
getNetwork
public com.powsybl.iidm.network.impl.NetworkImpl getNetwork()
Description copied from interface:Identifiable
Get the network associated to the object.- Specified by:
getNetwork
in interfaceIdentifiable<I extends Connectable<I>>
-
remove
public void remove(boolean removeDanglingSwitches)
Description copied from interface:Connectable
Remove the connectable from the voltage level.- Specified by:
remove
in interfaceConnectable<I extends Connectable<I>>
- Parameters:
removeDanglingSwitches
- if true, also remove dangling switches in addition to isolated nodes
-
notifyUpdate
protected void notifyUpdate(Supplier<String> attribute, Object oldValue, Object newValue)
-
notifyUpdate
protected void notifyUpdate(Supplier<String> attribute, String variantId, Object oldValue, Object newValue)
-
notifyUpdate
protected void notifyUpdate(String attribute, String variantId, Object oldValue, Object newValue)
-
deleteVariantArrayElement
public void deleteVariantArrayElement(int index)
Description copied from interface:MultiVariantObject
Called to delete a variant array element.- Specified by:
deleteVariantArrayElement
in interfaceMultiVariantObject
- Parameters:
index
- the index of the variant array to delete
-
move
protected void move(com.powsybl.iidm.network.impl.TerminalExt oldTerminal, String oldConnectionInfo, int node, String voltageLevelId)
-
move
protected void move(com.powsybl.iidm.network.impl.TerminalExt oldTerminal, String oldConnectionInfo, String busId, boolean connected)
-
getId
public String getId()
Description copied from interface:Identifiable
Get the unique identifier of the object.- Specified by:
getId
in interfaceIdentifiable<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 interfaceIdentifiable<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 interfaceIdentifiable<I extends Identifiable<I>>
-
getAliases
public Set<String> getAliases()
Description copied from interface:Identifiable
Get the aliases of the object.- Specified by:
getAliases
in interfaceIdentifiable<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 interfaceIdentifiable<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 interfaceIdentifiable<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 aPowsyblException
- Specified by:
addAlias
in interfaceIdentifiable<I extends Identifiable<I>>
-
addAlias
public void addAlias(String alias, boolean ensureAliasUnicity)
- Specified by:
addAlias
in interfaceIdentifiable<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 aPowsyblException
If a given non null type already has an associated alias for this object, throw aPowsyblException
- Specified by:
addAlias
in interfaceIdentifiable<I extends Identifiable<I>>
-
addAlias
public void addAlias(String alias, String aliasType, boolean ensureAliasUnicity)
- Specified by:
addAlias
in interfaceIdentifiable<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 aPowsyblException
- Specified by:
removeAlias
in interfaceIdentifiable<I extends Identifiable<I>>
-
hasAliases
public boolean hasAliases()
Description copied from interface:Identifiable
Return true if identifiable has aliases.- Specified by:
hasAliases
in interfaceIdentifiable<I extends Identifiable<I>>
-
isFictitious
public boolean isFictitious()
Description copied from interface:Identifiable
Get the fictitious status- Specified by:
isFictitious
in interfaceIdentifiable<I extends Identifiable<I>>
-
setFictitious
public void setFictitious(boolean fictitious)
Description copied from interface:Identifiable
Set the fictitious status- Specified by:
setFictitious
in interfaceIdentifiable<I extends Identifiable<I>>
-
getMessageHeader
public String getMessageHeader()
- Specified by:
getMessageHeader
in interfaceValidable
-
getProperties
public Properties getProperties()
Description copied from interface:Identifiable
Get properties associated to the object.- Specified by:
getProperties
in interfaceIdentifiable<I extends Identifiable<I>>
-
hasProperty
public boolean hasProperty()
Description copied from interface:Identifiable
Check that this object has some properties.- Specified by:
hasProperty
in interfaceIdentifiable<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 interfaceIdentifiable<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 interfaceIdentifiable<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 interfaceIdentifiable<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 interfaceIdentifiable<I extends Identifiable<I>>
-
removeProperty
public boolean removeProperty(String key)
Description copied from interface:Identifiable
Remove property with specified key.- Specified by:
removeProperty
in interfaceIdentifiable<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 interfaceIdentifiable<I extends Identifiable<I>>
-
-