Пример #1
0
 public static List <Substation> FindConnectedSubstationsAtVoltageLevel(Substation root, List <Substation> connectedSubstations, NetworkModel model, VoltageLevel baseKv)
 {
     foreach (TransmissionLine transmissionLine in model.TransmissionLines)
     {
         if (transmissionLine.FromNode.BaseKV.InternalID == baseKv.InternalID)
         {
             if (transmissionLine.FromSubstation == root)
             {
                 if (!connectedSubstations.Contains(transmissionLine.ToSubstation))
                 {
                     connectedSubstations.Add(transmissionLine.ToSubstation);
                     List <Substation> subConnectedSubstations = ObservableIsland.FindConnectedSubstationsAtVoltageLevel(transmissionLine.ToSubstation, connectedSubstations, model, baseKv);
                 }
             }
             else if (transmissionLine.ToSubstation == root)
             {
                 if (!connectedSubstations.Contains(transmissionLine.FromSubstation))
                 {
                     connectedSubstations.Add(transmissionLine.FromSubstation);
                     List <Substation> subConnectedSubstations = ObservableIsland.FindConnectedSubstationsAtVoltageLevel(transmissionLine.FromSubstation, connectedSubstations, model, baseKv);
                 }
             }
         }
     }
     return(connectedSubstations);
 }
Пример #2
0
        public bool TryMerge(ObservableIsland island, NetworkModel model)
        {
            TransmissionLine connectingLine = ConnectingLineBetween(island, model);

            if (connectingLine != null)
            {
                m_substations.AddRange(island.Substations);
                return(true);
            }
            return(false);
        }
Пример #3
0
 public TransmissionLine ConnectingLineBetween(ObservableIsland island, NetworkModel model)
 {
     foreach (TransmissionLine transmissionLine in model.TransmissionLines)
     {
         if (Substations.Contains(transmissionLine.FromSubstation) && island.Substations.Contains(transmissionLine.ToSubstation))
         {
             return(transmissionLine);
         }
         else if (island.Substations.Contains(transmissionLine.ToSubstation) && Substations.Contains(transmissionLine.ToSubstation))
         {
             return(transmissionLine);
         }
     }
     return(null);
 }
Пример #4
0
 public static List <Substation> FindConnectedSubstations(Substation root, List <Substation> connectedSubstations, NetworkModel model)
 {
     foreach (TransmissionLine transmissionLine in model.TransmissionLines)
     {
         if (transmissionLine.FromSubstation == root)
         {
             if (!connectedSubstations.Contains(transmissionLine.ToSubstation))
             {
                 connectedSubstations.Add(transmissionLine.ToSubstation);
                 List <Substation> subConnectedSubstations = ObservableIsland.FindConnectedSubstations(transmissionLine.ToSubstation, connectedSubstations, model);
             }
         }
         else if (transmissionLine.ToSubstation == root)
         {
             if (!connectedSubstations.Contains(transmissionLine.FromSubstation))
             {
                 connectedSubstations.Add(transmissionLine.FromSubstation);
                 List <Substation> subConnectedSubstations = ObservableIsland.FindConnectedSubstations(transmissionLine.FromSubstation, connectedSubstations, model);
             }
         }
     }
     return(connectedSubstations);
 }