Package com.powsybl.iidm.mergingview
Class ShuntCompensatorAdapter
- java.lang.Object
-
- com.powsybl.iidm.mergingview.ShuntCompensatorAdapter
-
- All Implemented Interfaces:
Extendable<ShuntCompensator>
,Connectable<ShuntCompensator>
,Identifiable<ShuntCompensator>
,Injection<ShuntCompensator>
,ShuntCompensator
public class ShuntCompensatorAdapter extends Object implements ShuntCompensator
- Author:
- Thomas Adam
-
-
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)
<E extends Extension<I>>
voidaddExtension(Class<? super E> type, E extension)
Add en extension to this extendable object.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.double
getB()
Get the susceptance (in S) of the shunt in its current state i.e. the sum of the sections' susceptances for all sections in service.double
getB(int sectionCount)
Get the susceptance (in S) for a given activated sections count i.e. the sum of the sections' susceptances from 1 to sectionCount.protected I
getDelegate()
<E extends Extension<I>>
EgetExtension(Class<? super E> type)
Get an extension based on its class type.<E extends Extension<I>>
EgetExtensionByName(String name)
Get an extension based on its name.<E extends Extension<I>>
Collection<E>getExtensions()
Get all extensions associated with this extendable object..double
getG()
Get the conductance (in S) of the shunt in its current state i.e. the sum of the sections' conductances for all sections in service.double
getG(int sectionCount)
Get the conductance (in S) for a given activated sections count i.e. the sum of the sections' conductances from 1 to sectionCount.String
getId()
Get the unique identifier of the object.String
getImplementationName()
Returns a name that is used to find matchingExtensionAdderProvider
s when selecting implementations of extensions inExtendable.newExtension(java.lang.Class<B>)
.protected com.powsybl.iidm.mergingview.MergingViewIndex
getIndex()
int
getMaximumSectionCount()
Get the maximum number of sections that can be in serviceShuntCompensatorModel
getModel()
Get the shunt model.<M extends ShuntCompensatorModel>
MgetModel(Class<M> modelType)
ShuntCompensatorModelType
getModelType()
Get the model type of the shunt compensator (linear or non-linear)String
getNameOrId()
Get the name of the object if it exists.MergingView
getNetwork()
Get the network associated to the object.Optional<String>
getOptionalName()
Return an optional containing the name of the object if it exists.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.Terminal
getRegulatingTerminal()
Get the terminal used for regulation.int
getSectionCount()
Get the count of sections in service.double
getTargetDeadband()
Get the shunt compensator's deadband (in kV) used to avoid excessive update of discrete control while regulating.double
getTargetV()
Get the shunt compensator's voltage target in kV if it exists.Terminal
getTerminal()
Get the terminal.List<? extends Terminal>
getTerminals()
ConnectableType
getType()
Get the connectable type.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 statusboolean
isVoltageRegulatorOn()
Get the shunt compensator's regulating status.<E extends Extension<I>,B extends ExtensionAdder<I,E>>
BnewExtension(Class<B> type)
Returns an extensionAdder to build and add an extension for this extendable.void
remove()
Remove the equipment.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.void
setFictitious(boolean fictitious)
Set the fictitious statusString
setProperty(String key, String value)
Set property value associated to specified key.ShuntCompensator
setRegulatingTerminal(Terminal regulatingTerminal)
Set the terminal used for regulation.ShuntCompensator
setSectionCount(int sectionCount)
Change the count of sections in service.ShuntCompensator
setTargetDeadband(double targetDeadband)
Set the shunt compensator's deadband (in kV) used to avoid excessive update of discrete control while regulating.ShuntCompensator
setTargetV(double targetV)
Set the shunt compensator's voltage target in kV.ShuntCompensator
setVoltageRegulatorOn(boolean voltageRegulatorOn)
Set the shunt compensator's regulating status.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.powsybl.iidm.network.Connectable
getTerminals, getType, 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, setFictitious, setProperty
-
Methods inherited from interface com.powsybl.iidm.network.Injection
getTerminal
-
-
-
-
Method Detail
-
getSectionCount
public int getSectionCount()
Description copied from interface:ShuntCompensator
Get the count of sections in service. Please note sections can only be sequentially in service i.e. the first sectionCount sections are in service.It is expected to be greater than one and lesser than or equal to the maximum section count.
Depends on the working variant.
- Specified by:
getSectionCount
in interfaceShuntCompensator
- See Also:
VariantManager
-
getMaximumSectionCount
public int getMaximumSectionCount()
Description copied from interface:ShuntCompensator
Get the maximum number of sections that can be in service- Specified by:
getMaximumSectionCount
in interfaceShuntCompensator
-
setSectionCount
public ShuntCompensator setSectionCount(int sectionCount)
Description copied from interface:ShuntCompensator
Change the count of sections in service. Please note sections can only be sequentially in service i.e. the first sectionCount sections are in service.Depends on the working variant.
- Specified by:
setSectionCount
in interfaceShuntCompensator
- Parameters:
sectionCount
- the number of sections wanted to be put in service- Returns:
- the shunt compensator to chain method calls.
- See Also:
VariantManager
-
getB
public double getB()
Description copied from interface:ShuntCompensator
Get the susceptance (in S) of the shunt in its current state i.e. the sum of the sections' susceptances for all sections in service. Return 0 if no section is in service (disconnected state).- Specified by:
getB
in interfaceShuntCompensator
- See Also:
Depends on the working variant.
,VariantManager
-
getG
public double getG()
Description copied from interface:ShuntCompensator
Get the conductance (in S) of the shunt in its current state i.e. the sum of the sections' conductances for all sections in service. If the conductance of a section in service is undefined, it is considered equal to 0. Return 0 if no section is in service (disconnected state).- Specified by:
getG
in interfaceShuntCompensator
- See Also:
Depends on the working variant.
,VariantManager
-
getB
public double getB(int sectionCount)
Description copied from interface:ShuntCompensator
Get the susceptance (in S) for a given activated sections count i.e. the sum of the sections' susceptances from 1 to sectionCount. Return O if sectionCount is equal to 0 (disconnected state).- Specified by:
getB
in interfaceShuntCompensator
- Parameters:
sectionCount
- count of wanted activated sections. Must be in [0; maximumSectionCount]. Else, throws aValidationException
.
-
getG
public double getG(int sectionCount)
Description copied from interface:ShuntCompensator
Get the conductance (in S) for a given activated sections count i.e. the sum of the sections' conductances from 1 to sectionCount. If the conductance of a section is undefined, it is considered equal to 0. Return 0 if sectionCount is equal to 0 (disconnected state).- Specified by:
getG
in interfaceShuntCompensator
- Parameters:
sectionCount
- count of wanted activated sections. Must be in [0; maximumSectionCount]. Else, throws aValidationException
.
-
getModelType
public ShuntCompensatorModelType getModelType()
Description copied from interface:ShuntCompensator
Get the model type of the shunt compensator (linear or non-linear)- Specified by:
getModelType
in interfaceShuntCompensator
-
getModel
public ShuntCompensatorModel getModel()
Description copied from interface:ShuntCompensator
Get the shunt model.- Specified by:
getModel
in interfaceShuntCompensator
-
getModel
public <M extends ShuntCompensatorModel> M getModel(Class<M> modelType)
- Specified by:
getModel
in interfaceShuntCompensator
-
getRegulatingTerminal
public Terminal getRegulatingTerminal()
Description copied from interface:ShuntCompensator
Get the terminal used for regulation.- Specified by:
getRegulatingTerminal
in interfaceShuntCompensator
-
setRegulatingTerminal
public ShuntCompensator setRegulatingTerminal(Terminal regulatingTerminal)
Description copied from interface:ShuntCompensator
Set the terminal used for regulation. If null is passed as regulating terminal, the regulation is considered local.- Specified by:
setRegulatingTerminal
in interfaceShuntCompensator
-
isVoltageRegulatorOn
public boolean isVoltageRegulatorOn()
Description copied from interface:ShuntCompensator
Get the shunt compensator's regulating status.Depends on the working variant.
- Specified by:
isVoltageRegulatorOn
in interfaceShuntCompensator
- See Also:
VariantManager
-
setVoltageRegulatorOn
public ShuntCompensator setVoltageRegulatorOn(boolean voltageRegulatorOn)
Description copied from interface:ShuntCompensator
Set the shunt compensator's regulating status.Depends on the working variant.
- Specified by:
setVoltageRegulatorOn
in interfaceShuntCompensator
- See Also:
VariantManager
-
getTargetV
public double getTargetV()
Description copied from interface:ShuntCompensator
Get the shunt compensator's voltage target in kV if it exists. Else return NaN.Depends on the working variant.
- Specified by:
getTargetV
in interfaceShuntCompensator
- See Also:
VariantManager
-
setTargetV
public ShuntCompensator setTargetV(double targetV)
Description copied from interface:ShuntCompensator
Set the shunt compensator's voltage target in kV.Depends on the working variant.
- Specified by:
setTargetV
in interfaceShuntCompensator
- See Also:
VariantManager
-
getTargetDeadband
public double getTargetDeadband()
Description copied from interface:ShuntCompensator
Get the shunt compensator's deadband (in kV) used to avoid excessive update of discrete control while regulating. This attribute is necessary only if the shunt compensator is regulating.Depends on the working variant.
- Specified by:
getTargetDeadband
in interfaceShuntCompensator
- See Also:
VariantManager
-
setTargetDeadband
public ShuntCompensator setTargetDeadband(double targetDeadband)
Description copied from interface:ShuntCompensator
Set the shunt compensator's deadband (in kV) used to avoid excessive update of discrete control while regulating. This attribute is necessary only if the shunt compensator is regulating. It must be positive.Depends on the working variant.
- Specified by:
setTargetDeadband
in interfaceShuntCompensator
- See Also:
VariantManager
-
getTerminal
public final Terminal getTerminal()
Description copied from interface:Injection
Get the terminal.- Specified by:
getTerminal
in interfaceInjection<I extends Injection<I>>
-
getType
public final ConnectableType getType()
Description copied from interface:Connectable
Get the connectable type.- Specified by:
getType
in interfaceConnectable<I extends Connectable<I>>
-
getTerminals
public final List<? extends Terminal> getTerminals()
- Specified by:
getTerminals
in interfaceConnectable<I extends Connectable<I>>
-
remove
public final void remove()
Description copied from interface:Connectable
Remove the equipment.- Specified by:
remove
in interfaceConnectable<I extends Connectable<I>>
-
getNetwork
public MergingView getNetwork()
Description copied from interface:Identifiable
Get the network associated to the object.- Specified by:
getNetwork
in interfaceIdentifiable<I extends Identifiable<I>>
-
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>>
-
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>>
-
getPropertyNames
public Set<String> getPropertyNames()
Description copied from interface:Identifiable
Get properties key values.- Specified by:
getPropertyNames
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>>
-
addExtension
public <E extends Extension<I>> void addExtension(Class<? super E> type, E extension)
Description copied from interface:Extendable
Add en extension to this extendable object.- Specified by:
addExtension
in interfaceExtendable<I extends Identifiable<I>>
- Type Parameters:
E
- the extension type- Parameters:
type
- the extension class typeextension
- the extension
-
getExtension
public <E extends Extension<I>> E getExtension(Class<? super E> type)
Description copied from interface:Extendable
Get an extension based on its class type.- Specified by:
getExtension
in interfaceExtendable<I extends Identifiable<I>>
- Type Parameters:
E
- the extension type- Parameters:
type
- the extension class type- Returns:
- the extension mapped to the class type or null if not found
-
getExtensionByName
public <E extends Extension<I>> E getExtensionByName(String name)
Description copied from interface:Extendable
Get an extension based on its name.- Specified by:
getExtensionByName
in interfaceExtendable<I extends Identifiable<I>>
- Parameters:
name
- the extension name- Returns:
- the extension mapped to the name or null if not found
-
removeExtension
public <E extends Extension<I>> boolean removeExtension(Class<E> type)
Description copied from interface:Extendable
Remove an extension based on its class type.- Specified by:
removeExtension
in interfaceExtendable<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
-
getExtensions
public <E extends Extension<I>> Collection<E> getExtensions()
Description copied from interface:Extendable
Get all extensions associated with this extendable object..- Specified by:
getExtensions
in interfaceExtendable<I extends Identifiable<I>>
- Returns:
- all extensions associated to this extendable object.
-
getImplementationName
public String getImplementationName()
Description copied from interface:Extendable
Returns a name that is used to find matchingExtensionAdderProvider
s when selecting implementations of extensions inExtendable.newExtension(java.lang.Class<B>)
. This is meant to be overriden by extendables when multiple implementations exist.- Specified by:
getImplementationName
in interfaceExtendable<I extends Identifiable<I>>
- Returns:
- the name
-
newExtension
public <E extends Extension<I>,B extends ExtensionAdder<I,E>> B newExtension(Class<B> type)
Description copied from interface:Extendable
Returns an extensionAdder to build and add an extension for this extendable.The extension implementation is selected at runtime based on matching the
Extendable.getImplementationName()
of this extendable to theExtensionAdderProvider.getImplementationName()
of a provider. Implementations are loaded with java'sServiceLoader
using the ExtensionAdderProvider interface.- Specified by:
newExtension
in interfaceExtendable<I extends Identifiable<I>>
- Parameters:
type
- The interface of the ExtensionAdder- Returns:
- the adder
-
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>>
-
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>>
-
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>>
-
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, 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>>
-
getDelegate
protected I getDelegate()
-
getIndex
protected com.powsybl.iidm.mergingview.MergingViewIndex getIndex()
-
-