예제 #1
0
 public void Subtract(Hlm_Chewbacca <T> set)
 {
     foreach (T tItem in new List <T>(mp_element_f.Keys))
     {
         if (set.Contains(tItem))
         {
             Remove(tItem);
         }
     }
 }
예제 #2
0
 private IEnumerable <T> EntNext(Stack <T> rgt, Hlm_Chewbacca <T> ohlmtVisited)
 {
     if (dgentNextByPath != null)
     {
         return(dgentNextByPath(rgt));
     }
     if (dgentNextByT != null)
     {
         return(dgentNextByT(rgt.Peek()));
     }
     return(dgentNextByVisited(ohlmtVisited, rgt.Peek()));
 }
예제 #3
0
        private IEnumerable <Stack <T> > FindPathRecursive(Stack <T> rgt, Hlm_Chewbacca <T> ohlmtVisited, int depth, Depthmax depthMax)
        {
            var t = rgt.Peek();

            if (dgfGoal(t))
            {
                depthMax.D = depth;
                yield return(new Stack <T>(rgt));

                yield break;
            }

            if (depth == depthMax.D)
            {
                depthMax.ccut++;
                yield break;
            }

            foreach (var tNext in EntNext(rgt, ohlmtVisited))
            {
                if (ohlmtVisited != null)
                {
                    if (ohlmtVisited.Contains(tNext))
                    {
                        continue;
                    }

                    ohlmtVisited.Add(tNext);
                }

                rgt.Push(tNext);

                foreach (var tSolution in FindPathRecursive(rgt, ohlmtVisited, depth + 1, depthMax))
                {
                    yield return(tSolution);
                }

                if (ohlmtVisited != null)
                {
                    ohlmtVisited.Remove(tNext);
                }
                rgt.Pop();
            }
        }
예제 #4
0
 public void Union(Hlm_Chewbacca <T> set)
 {
     AddRange(set);
 }