Class SubstationIdMapping


  • public class SubstationIdMapping
    extends Object
    CGMES standard:
    A PowerTransformer is contained in one Substation, but it can connect a Terminal to another different Substation
    A Switch can connect to different voltageLevels

    IIDM Model:
    Ends of transformers need to be in the same substation
    Ends of switches need to be in the same voltageLevel

    Solution:
    CGMES substations that are connected by transformers will be mapped to a single IIDM substation
    CGMES voltageLevels that are connected by switches will be mapped to a single IIDM voltageLevel

    Example:
    We suppose that VL1, VL2, VL3, VL4, VL5, VL6 and VL7 are CGMES voltageLevels,
    Sw23 is a switch connecting voltageLevels VL2 and VL3,
    Sw34 is a switch connecting voltageLevels VL3 and VL4 and
    Sw67 is a switch connecting voltageLevels VL6 and VL7

    Steps:
    Fill voltageLevelAdjacency Map
    Two voltageLevels are adjacent if they are connected by a switch
    The voltageLevelAdjacency Map will include the following records
    (VL1, [])
    (VL2, [VL2, VL3])
    (VL3, [VL2, VL3, VL4])
    (VL4, [VL3, VL4])
    (VL5, [])
    (VL6, [VL6, VL7])
    (VL7, [VL6, VL7])

    For each non-visited VoltageLevel-key of the voltageLevelAdjacency Map all connected voltageLevels will be calculated
    Two voltageLevels are connected if they are adjacent
    (allConnected method)
    All connected VoltageLevels to VL1 will be [VL1]
    All connected VoltageLevels to VL2 will be [VL2, VL3, VL4]
    All connected VoltageLevels to VL5 will be [VL5]
    All connected VoltageLevels to VL6 will be [VL6, VL7]

    So the following voltageLevels should be merged
    [VL2, VL3, VL4] and the representative (IIDM voltageLevel) will be VL2
    [VL6, VL7] and the representative (IIDM voltageLevel) will be VL6

    And finally previous data is recorded in the voltageLevelMapping Map as
    (For each merged voltageLevel a record (merged voltageLevel, representative voltageLevel) is added)
    (VL3, VL2)
    (VL4, VL2)
    (VL7, VL6)

    The voltageLevelMapping Map will be used to assign the IIDM voltageLevel during the conversion process

    The same algorithm is used to identify the substations that should be merged but:
    Two substations are adjacent if there is a transformer between them.
    The two substations associated with two adjacent voltageLevels, are adjacent if they are different substations.

    Author:
    Luma Zamarreño , José Antonio Marqués
    • Constructor Detail

      • SubstationIdMapping

        public SubstationIdMapping​(Context context)
    • Method Detail

      • substationIsMapped

        public boolean substationIsMapped​(String cgmesIdentifier)
      • substationIidm

        public String substationIidm​(String cgmesIdentifier)
      • mergedSubstations

        public Set<String> mergedSubstations​(String cgmesIdentifier)
      • voltageLevelIsMapped

        public boolean voltageLevelIsMapped​(String cgmesIdentifier)
      • voltageLevelIidm

        public String voltageLevelIidm​(String cgmesIdentifier)
      • mergedVoltageLevels

        public Set<String> mergedVoltageLevels​(String cgmesIdentifier)
      • build

        public void build()