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
- Author:
- Ghiles Abdellah <ghiles.abdellah at rte-france.com>
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected String
protected String
protected final Properties
protected boolean
protected final List<com.powsybl.iidm.network.impl.TerminalExt>
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add an alias to the object.void
void
Add an alias to the object.void
void
allocateVariantArrayElement
(int[] indexes, int sourceIndex) Called to allocate a variant array element.boolean
connect()
boolean
void
deleteVariantArrayElement
(int index) Called to delete a variant array element.boolean
boolean
disconnect
(Predicate<Switch> isSwitchOpenable) void
extendVariantArraySize
(int initVariantArraySize, int number, int sourceIndex) Called to extend the variant array.Get the aliases of the object.getAliasFromType
(String aliasType) Get the alias of the object with a given alias type if it exists.getAliasType
(String alias) Get the alias type of an alias if it exists, an empty optional otherwise.getId()
Get the unique identifier of the object.double
getMaxP()
Get the maximal active power in MW.double
getMinP()
Get the minimal active power in MW.Get the name of the object if it exists.Get the network associated to the object.Return an optional containing the name of the object if it exists.Get the parent network, i.e. the smallest network containing the object.getProperty
(String key) Get property associated to specified key.getProperty
(String key, String defaultValue) Get property associated to specified key, with default value.Get properties key values.Get reactive limits of the generator.<R extends ReactiveLimits>
RgetReactiveLimits
(Class<R> type) double
Get the target active power in MW.double
Get the target reactive power in MVar.com.powsybl.iidm.network.impl.TerminalExt
Get the terminal.List<com.powsybl.iidm.network.impl.TerminalExt>
protected String
boolean
Return true if identifiable has aliases.boolean
Check that this object has some properties.boolean
hasProperty
(String key) Check that this object has property with specified name.boolean
Get the fictitious statusprotected void
move
(com.powsybl.iidm.network.impl.TerminalExt oldTerminal, TopologyPoint oldTopologyPoint, int node, String voltageLevelId) protected void
move
(com.powsybl.iidm.network.impl.TerminalExt oldTerminal, TopologyPoint oldTopologyPoint, String busId, boolean connected) Get a builder to create and associate minimum and maximum reactive limits to this generator.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
void
reduceVariantArraySize
(int number) Called to reduce the variant array.void
remove()
Remove the connectable from the voltage level (dangling switches are kept).void
removeAlias
(String alias) Remove an alias of the object.<E extends Extension<I>>
booleanremoveExtension
(Class<E> type) Remove an extension based on its class type.boolean
removeProperty
(String key) Remove property with specified key.void
setFictitious
(boolean fictitious) Set the fictitious statussetMaxP
(double maxP) Set the maximal active power in MW.setMinP
(double minP) Set the minimal active power in MW.Update object name.setProperty
(String key, String value) Set property value associated to specified key.void
setReactiveLimits
(ReactiveLimits reactiveLimits) setTargetP
(double targetP) Set the target active power in MW.setTargetQ
(double targetQ) Set the target reactive power in MVar.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.Battery
getP0, getQ0, getType, setP0, setQ0
Methods inherited from interface com.powsybl.iidm.network.Connectable
connect, connect, disconnect, disconnect, getTerminals, 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, getNameOrId, getNetwork, getOptionalName, getParentNetwork, getProperty, getProperty, getPropertyNames, hasAliases, hasProperty, hasProperty, isFictitious, removeAlias, removeProperty, setFictitious, setName, setProperty
-
Field Details
-
terminals
-
removed
protected boolean removed -
id
-
name
-
fictitious
protected boolean fictitious -
properties
-
-
Method Details
-
getTypeDescription
-
getTargetP
public double getTargetP()Get the target active power in MW.Depends on the working variant.
- Specified by:
getTargetP
in interfaceBattery
- See Also:
-
setTargetP
Set the target active power in MW.Depends on the working variant.
- Specified by:
setTargetP
in interfaceBattery
- See Also:
-
getTargetQ
public double getTargetQ()Get the target reactive power in MVar.Depends on the working variant.
- Specified by:
getTargetQ
in interfaceBattery
- See Also:
-
setTargetQ
Set the target reactive power in MVar.Depends on the working variant.
- Specified by:
setTargetQ
in interfaceBattery
- See Also:
-
getMinP
public double getMinP()Get the minimal active power in MW. -
setMinP
Set the minimal active power in MW. -
getMaxP
public double getMaxP()Get the maximal active power in MW. -
setMaxP
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
Get reactive limits of the generator.- Specified by:
getReactiveLimits
in interfaceReactiveLimitsHolder
-
setReactiveLimits
-
getReactiveLimits
- Specified by:
getReactiveLimits
in interfaceReactiveLimitsHolder
-
newReactiveCapabilityCurve
Get a builder to create and associate a new reactive capability curve to this generator.- Specified by:
newReactiveCapabilityCurve
in interfaceReactiveLimitsHolder
-
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
-
getNetwork
NetworkImpl getNetwork() -
getTerminals
- Specified by:
getTerminals
in interfaceConnectable<I extends Connectable<I>>
-
getParentNetwork
Description copied from interface:Identifiable
Get the parent network, i.e. the smallest network containing the object.- Specified by:
getParentNetwork
in interfaceIdentifiable<I extends Connectable<I>>
-
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()Description copied from interface:Connectable
Remove the connectable from the voltage level (dangling switches are kept).- Specified by:
remove
in interfaceConnectable<I extends Connectable<I>>
-
notifyUpdate
-
notifyUpdate
-
notifyUpdate
-
notifyUpdate
-
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, TopologyPoint oldTopologyPoint, int node, String voltageLevelId) -
move
protected void move(com.powsybl.iidm.network.impl.TerminalExt oldTerminal, TopologyPoint oldTopologyPoint, String busId, boolean connected) -
connect
public boolean connect()- Specified by:
connect
in interfaceConnectable<I extends Connectable<I>>
-
connect
- Specified by:
connect
in interfaceConnectable<I extends Connectable<I>>
-
disconnect
public boolean disconnect()- Specified by:
disconnect
in interfaceConnectable<I extends Connectable<I>>
-
disconnect
- Specified by:
disconnect
in interfaceConnectable<I extends Connectable<I>>
-
getId
Description copied from interface:Identifiable
Get the unique identifier of the object.- Specified by:
getId
in interfaceIdentifiable<I extends Identifiable<I>>
-
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
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>>
-
setName
Description copied from interface:Identifiable
Update object name.- Specified by:
setName
in interfaceIdentifiable<I extends Identifiable<I>>
- Parameters:
name
- new name of the object (could be null to erase the name)- Returns:
- the object itself
-
getAliases
Description copied from interface:Identifiable
Get the aliases of the object.- Specified by:
getAliases
in interfaceIdentifiable<I extends Identifiable<I>>
-
getAliasType
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
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
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
- Specified by:
addAlias
in interfaceIdentifiable<I extends Identifiable<I>>
-
addAlias
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
- Specified by:
addAlias
in interfaceIdentifiable<I extends Identifiable<I>>
-
removeAlias
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
- Specified by:
getMessageHeader
in interfaceValidable
-
getProperties
-
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
Description copied from interface:Identifiable
Check that this object has property with specified name.- Specified by:
hasProperty
in interfaceIdentifiable<I extends Identifiable<I>>
-
getProperty
Description copied from interface:Identifiable
Get property associated to specified key.- Specified by:
getProperty
in interfaceIdentifiable<I extends Identifiable<I>>
-
getProperty
Description copied from interface:Identifiable
Get property associated to specified key, with default value.- Specified by:
getProperty
in interfaceIdentifiable<I extends Identifiable<I>>
-
setProperty
Description copied from interface:Identifiable
Set property value associated to specified key.- Specified by:
setProperty
in interfaceIdentifiable<I extends Identifiable<I>>
-
removeProperty
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
Description copied from interface:Identifiable
Get properties key values.- Specified by:
getPropertyNames
in interfaceIdentifiable<I extends Identifiable<I>>
-
toString
-
removeExtension
Description copied from interface:Extendable
Remove an extension based on its class type.- Specified by:
removeExtension
in interfaceExtendable<I extends Identifiable<I>>
- Overrides:
removeExtension
in classAbstractExtendable<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
-