Package com.powsybl.iidm.network.impl
Class VariantManagerImpl
java.lang.Object
com.powsybl.iidm.network.impl.VariantManagerImpl
- All Implemented Interfaces:
VariantManager
- Author:
- Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
-
Method Summary
Modifier and TypeMethodDescriptionvoid
allowVariantMultiThreadAccess
(boolean allow) Allows variants to be accessed simultaneously by different threads.void
cloneVariant
(String sourceVariantId, String targetVariantId) Create a new variant by cloning an existing one.void
cloneVariant
(String sourceVariantId, String targetVariantId, boolean mayOverwrite) Create or overwrite a variant by cloning an existing one.void
cloneVariant
(String sourceVariantId, List<String> targetVariantIds) Create a new variant by cloning an existing one.void
cloneVariant
(String sourceVariantId, List<String> targetVariantIds, boolean mayOverwrite) Create or overwrite a variant by cloning an existing one.int
Get the size of the variant array This size is different from the number of variants that also count unused but not released variants.getVariantId
(int variantIndex) Get the variant id list.Get the working variant.boolean
Get the allowed multithread access state .void
removeVariant
(String variantId) Remove a variant.void
setWorkingVariant
(String variantId) Set the working variant.
-
Method Details
-
getVariantIds
Description copied from interface:VariantManager
Get the variant id list.- Specified by:
getVariantIds
in interfaceVariantManager
- Returns:
- the variant id list
-
getVariantArraySize
public int getVariantArraySize()Get the size of the variant array This size is different from the number of variants that also count unused but not released variants.- Returns:
- the size of the variant array
-
getVariantId
-
getWorkingVariantId
Description copied from interface:VariantManager
Get the working variant.- Specified by:
getWorkingVariantId
in interfaceVariantManager
- Returns:
- the id of the working variant
-
setWorkingVariant
Description copied from interface:VariantManager
Set the working variant.- Specified by:
setWorkingVariant
in interfaceVariantManager
- Parameters:
variantId
- the id of the working variant
-
cloneVariant
Description copied from interface:VariantManager
Create a new variant by cloning an existing one.- Specified by:
cloneVariant
in interfaceVariantManager
- Parameters:
sourceVariantId
- the source variant idtargetVariantId
- the target variant id (the one that will be created)
-
cloneVariant
Description copied from interface:VariantManager
Create or overwrite a variant by cloning an existing one.- Specified by:
cloneVariant
in interfaceVariantManager
- Parameters:
sourceVariantId
- the source variant idtargetVariantId
- the target variant id list (the one that will be created/overwritten)mayOverwrite
- indicates if the target can be overwritten when it already exists
-
cloneVariant
Description copied from interface:VariantManager
Create a new variant by cloning an existing one.- Specified by:
cloneVariant
in interfaceVariantManager
- Parameters:
sourceVariantId
- the source variant idtargetVariantIds
- the target variant id list (the ones that will be created)
-
cloneVariant
public void cloneVariant(String sourceVariantId, List<String> targetVariantIds, boolean mayOverwrite) Description copied from interface:VariantManager
Create or overwrite a variant by cloning an existing one.- Specified by:
cloneVariant
in interfaceVariantManager
- Parameters:
sourceVariantId
- the source variant idtargetVariantIds
- the target variant id list (the ones that will be created/overwritten)mayOverwrite
- indicates if the target can be overwritten when it already exists
-
removeVariant
Description copied from interface:VariantManager
Remove a variant.- Specified by:
removeVariant
in interfaceVariantManager
- Parameters:
variantId
- the id of the variant to remove
-
allowVariantMultiThreadAccess
public void allowVariantMultiThreadAccess(boolean allow) Description copied from interface:VariantManager
Allows variants to be accessed simultaneously by different threads. When this option is activated, the working variant can have a different value for each thread.- Specified by:
allowVariantMultiThreadAccess
in interfaceVariantManager
-
isVariantMultiThreadAccessAllowed
public boolean isVariantMultiThreadAccessAllowed()Description copied from interface:VariantManager
Get the allowed multithread access state .- Specified by:
isVariantMultiThreadAccessAllowed
in interfaceVariantManager
- Returns:
- a boolean to check if the variantManager is allowed to be accessed simulaneously by different threads.
-