-
Notifications
You must be signed in to change notification settings - Fork 52
Migration guide v6.2.0
ValidationUtil.checkRatioTapChangerRegulation methods take an additional parameter: regulationMode, the regulation mode (note that targetV parameter was also renamed in regulationValue).
Besides, if you have defined your own IIDM implementation, please refer to this section.
If you have defined your own implementation of NetworkListener without inheriting DefaultNetworkListener, you should implement the following methods:
-
void onUpdate(Identifiable<?> identifiable, String attribute, String variantId, Object oldValue, Object newValue)- This method previsouly existed with a default implementation which was removed
void onExtensionCreation(Extension<?> extension)void onExtensionAfterRemoval(Identifiable<?> identifiable, String extensionName)void onExtensionBeforeRemoval(Extension<?> extension)void onExtensionUpdate(Extension<?> extendable, String attribute, Object oldValue, Object newValue)
The SecondaryVoltageControl extension was refactored to use the newly introduced notification system for extensions.
To create a new SecondaryVoltageControl extension, you should now use a builder:
- Before:
SecondaryVoltageControl control = network.newExtension(SecondaryVoltageControlAdder.class)
.addControlZone(new ControlZone("z1",
new PilotPoint(List.of("NLOAD"), 15d),
List.of(new ControlUnit("GEN", false), new ControlUnit("GEN2"))))
.add();- After:
SecondaryVoltageControl control = network.newExtension(SecondaryVoltageControlAdder.class)
.newControlZone()
.withName("z1")
.newPilotPoint()
.withBusbarSectionsOrBusesIds(List.of("NLOAD"))
.withTargetV(15d)
.add()
.newControlUnit()
.withId("GEN")
.withParticipate(false)
.add()
.newControlUnit()
.withId("GEN2")
.add()
.add()
.add();Besides, if you have defined your own IIDM implementation, please refer to this section.
We did it! From this version, we add a check to ensure that when a connectable has temporary loading limits, it has a defined permanent limit. Note that it does not mean that a permanent limit is required for all equipments that could have one. In order to ensure compatibility with previous IIDM version, if the permanent limit is missing, we fix it with a percentage of the lowest (in value) temporary limit, by default 100%. This percentage is configurable at import: for a different value, please use iidm.import.xml.missing-permanent-limit-percentage parameter.
Breaking changes are the following:
ValidationUtil.checkPermanentLimit now takes an additional parameter:
-
Collection<LoadingLimits.TemporaryLimit> temporaryLimits: the temporary limits defined for the sameLoadingLimitsobject.
The readActivePowerLimits, readApparentPowerLimits and readCurrentLimits methods of ConnectableSerDeUtil now take 2 additional parameters:
-
IidmVersion iidmVersion: the IIDM version of the network being deserialized; -
ImportOptions options: the import options to apply when deserializing the network.
Besides, if you have defined your own IIDM implementation, please refer to this section.
When using the default IIDM implementation, at terminal connection/disconnection:
- the
"connection"notifications that were emitted are replaced:- at connection by:
- a
"beginConnect"notification before the connection. ItsoldValuecontains the previous connection state of the terminal; - a
"endConnect"notification after the connection. ItsnewValuecontains the final connection state of the terminal;
- a
- at disconnection by:
- a
"beginDisconnect"notification before the disconnection. ItsoldValuecontainstrueif the terminal was previously disconnected,falseotherwise; - a
"endDisconnect"notification after the disconnection. ItsnewValuecontainstrueif the terminal is now disconnected, false otherwise;
- a
- at connection by:
- the
"connected"notifications are replaced by"connected" + side numbernotifications. The content of theiroldValueandnewValueattributes is unchanged.
Besides, if you have defined your own IIDM implementation, please refer to this section.
Starting from this release, if you wrote your own extensions, you should pay attention in its serialization/deserialization to follow this rule: if a parameter is optional in the XML you should not include the previous if clause:
-
TreeDataWriter::writeOptionalIntAttribute, and then read it withTreeDataReader::readOptionalIntAttribute, -
TreeDataWriter::writeOptionalDoubleAttribute, and then read it withTreeDataReader::readOptionalDoubleAttribute, -
TreeDataWriter::writeOptionalBooleanAttribute, and then read it withTreeDataReader::readOptionalBooleanAttribute.
More generally, the write methods of TreeDataWriter should not be enclosed in a if clause. This is needed to have a compact binary format, where the value is stored without the attribute name. As there are always exceptions, two exceptions to this rule:
- a
TreeDataWriter.writeStartNode()-TreeDataWriter.writeEndNode()code block can be enclosed in aifclause (the start node names are stored in the binary file) - attributes which are written or not based on a previous parameter read can be enclosed in a
ifclause. For instance, the topology kind implies to write either a node or a bus/connectableBus.
Before:
if (shouldBeWritten()) {
writer.writeIntAttribute("attributeX", x);
}
Optional.ofNullable(y).ifPresent(y1 -> writer.writeDoubleAttribute("attributeY", y1));After:
writer.writeOptionalIntAttribute("attributeX", shouldBeWritten() ? x : null);
writer.writeOptionalDoubleAttribute("attributeY", y); // with y nullableTip: You can search the usages of TreeDataWriter and NetworkSerializerContext to find where the serialization/deserialization is implied.
The LineConnectionAction has been removed and replaced by TerminalsConnectionAction. With this new remedial action, we can open or close one Terminal, given by an element id and a side (instance of ThreeSide). The side is optional: in that case, the remedial action means that the terminals of the element will be all opened or all closed. The element can be any connectable (line, transformers, injection, etc.). If the element is a TieLine, terminals refer to the underlying dangling lines' terminals. If the element is a HvdcLine, the terminals refer to the converter stations' terminals. In case of a two-terminal element, remember to use utility method to convert a ThreeSide in a TwoSide if you apply the remedial action on the network.
If you have defined your own IIDM implementation, you should implement the following methods:
-
in your
Networkimplementations:Iterable<OverloadManagementSystem> getOverloadManagementSystems()Stream<OverloadManagementSystem> getOverloadManagementSystemStream()int getOverloadManagementSystemCount()OverloadManagementSystem getOverloadManagementSystem(String id)
-
in your
Substationimplementation:OverloadManagementSystemAdder newOverloadManagementSystem()Iterable<OverloadManagementSystem> getOverloadManagementSystems()Stream<OverloadManagementSystem> getOverloadManagementSystemStream()int getOverloadManagementSystemCount()
If you have defined your own IIDM implementation, you should implement the following methods:
-
in your
Networkimplementations:Iterable<Ground> getGrounds()Stream<Ground> getGroundStream()int getGroundCount()Ground getGround(String id)
-
in your
VoltageLevelimplementation:GroundAdder newGround()Iterable<Ground> getGrounds()Stream<Ground> getGroundStream()int getGroundCount()
-
in your
TopologyVisitorimplementation:void visitGround(Ground connectable)
If you have defined your own IIDM implementation, you should implement the following methods:
-
in your
RatioTapChangerimplementations:RegulationMode getRegulationMode()RatioTapChanger setRegulationMode(RatioTapChanger.RegulationMode regulationMode)double getRegulationValue()RatioTapChanger setRegulationValue(double regulationValue)
-
in your
RatioTapChangerAdderimplementations:RatioTapChangerAdder setRegulationMode(RatioTapChanger.RegulationMode regulationMode)RatioTapChangerAdder setRegulationValue(double regulationValue)
If you have defined your own IIDM implementation, you should implement the following methods:
- In your
PhaseTapChangerandRatioTapChangerimplementations:-
... stepsReplacer().
-
If you have defined your own implementation of the SecondaryVoltageControl extension, you should:
- define custom implementations for
PilotPoint,ControlUnitandControlZone, and their respective adders. The default implementations which were provided were transferred iniidm-implto benefit from the notification system; - remove your implementation of
SecondaryVoltageControlAdder.addControlZone(ControlZone controlZone); - implement
SecondaryVoltageControlAdder.newControlZone().
The easiest way to do it is to can take your inspiration from the implementation classes located in iidm-impl.
If your project defines custom IIDM implementations, you should implement the following methods:
- In
LoadingLimitsAdderimplementations:double getTemporaryLimitValue(String name)int getTemporaryLimitAcceptableDuration(String name)double getLowestTemporaryLimitValue()Collection<String> getTemporaryLimitNames()void removeTemporaryLimit(String name)String getOwnerId()
Starting from this release the four following methods have been added to Connectable interface
boolean connect();
boolean connect(Predicate<Switch> isTypeSwitchToOperate);
boolean disconnect();
boolean disconnect(Predicate<Switch> isSwitchOpenable);Hence, if you have defined your own implementation of Connectable, you need to implement these methods.
Please note that, if your connectable has multiple terminals, you have to connect/disconnect either all of them or none. Your implementation should not connect/disconnect only some of the terminals, to avoid having a connectable only partially connected.
If you have defined your own IIDM implementation, you should implement the following methods:
- in your
Terminalimplementations:ThreeSides getSide()
If you have defined your own IIDM implementation, you should:
-
implement the
OperationalLimitGroupinterface; -
in your
Branchimplementations:- implement the following methods:
Collection<OperationalLimitsGroup> getOperationalLimitsGroups1(); Optional<String> getSelectedOperationalLimitsGroupId1(); Optional<OperationalLimitsGroup> getOperationalLimitsGroup1(String id); Optional<OperationalLimitsGroup> getSelectedOperationalLimitsGroup1(); OperationalLimitsGroup newOperationalLimitsGroup1(String id); void setSelectedOperationalLimitsGroup1(String id); void removeOperationalLimitsGroup1(String id); void cancelSelectedOperationalLimitsGroup1(); Collection<OperationalLimitsGroup> getOperationalLimitsGroups2(); Optional<String> getSelectedOperationalLimitsGroupId2(); Optional<OperationalLimitsGroup> getOperationalLimitsGroup2(String id); Optional<OperationalLimitsGroup> getSelectedOperationalLimitsGroup2(); OperationalLimitsGroup newOperationalLimitsGroup2(String id); void setSelectedOperationalLimitsGroup2(String id); void removeOperationalLimitsGroup2(String id); void cancelSelectedOperationalLimitsGroup2();
- redefine your implementation of the following methods (note that for some of these, default methods are defined in the interface ancestors, you may just have to remove your own implementation):
Optional<CurrentLimits> getCurrentLimits1(); CurrentLimits getNullableCurrentLimits1(); Optional<ActivePowerLimits> getActivePowerLimits1(); ActivePowerLimits getNullableActivePowerLimits1(); Optional<ApparentPowerLimits> getApparentPowerLimits1(); ApparentPowerLimits getNullableApparentPowerLimits1(); CurrentLimitsAdder newCurrentLimits1(); ActivePowerLimitsAdder newActivePowerLimits1(); ApparentPowerLimitsAdder newApparentPowerLimits1(); Optional<CurrentLimits> getCurrentLimits2(); CurrentLimits getNullableCurrentLimits2(); Optional<ActivePowerLimits> getActivePowerLimits2(); ActivePowerLimits getNullableActivePowerLimits2(); Optional<ApparentPowerLimits> getApparentPowerLimits2(); ApparentPowerLimits getNullableApparentPowerLimits2(); CurrentLimitsAdder newCurrentLimits2(); ActivePowerLimitsAdder newActivePowerLimits2(); ApparentPowerLimitsAdder newApparentPowerLimits2();
-
in your
TieLineandThreeWindingsTransformer.Legimplementations:- implement the following methods:
Collection<OperationalLimitsGroup> getOperationalLimitsGroups(); Optional<String> getSelectedOperationalLimitsGroupId(); Optional<OperationalLimitsGroup> getOperationalLimitsGroup(String id); Optional<OperationalLimitsGroup> getSelectedOperationalLimitsGroup(); OperationalLimitsGroup newOperationalLimitsGroup1String id); void setSelectedOperationalLimitsGroup(String id); void removeOperationalLimitsGroup(String id); void cancelSelectedOperationalLimitsGroup();
- redefine your implementation of the following methods (note that for some of these, default methods are defined in the interface ancestors, you may just have to remove your own implementation):
Optional<CurrentLimits> getCurrentLimits(); CurrentLimits getNullableCurrentLimits(); Optional<ActivePowerLimits> getActivePowerLimits(); ActivePowerLimits getNullableActivePowerLimits(); Optional<ApparentPowerLimits> getApparentPowerLimits(); ApparentPowerLimits getNullableApparentPowerLimits(); CurrentLimitsAdder newCurrentLimits(); ActivePowerLimitsAdder newActivePowerLimits(); ApparentPowerLimitsAdder newApparentPowerLimits();