Esempio n. 1
0
        public List <T> StartNewIteration()
        {
            var      lastIteration = this.LastOrDefault();
            List <T> toNavigate    = new List <T>();

            graphNavigationIteration <T> output = new graphNavigationIteration <T>();

            if (lastIteration != null)
            {
                output.Iteration = lastIteration.Iteration++;

                foreach (T n in lastIteration.Nodes)
                {
                    if (!selected.Contains(n))
                    {
                        selected.Add(n);
                        toNavigate.Add(n);
                    }
                    else
                    {
                    }
                }
            }
            Add(output);
            return(toNavigate);
        }
Esempio n. 2
0
        public graphNavigationIteration <T> StartNewIteration()
        {
            graphNavigationIteration <T> output = new graphNavigationIteration <T>();

            output.Iteration = Iteration++;
            return(output);
        }
Esempio n. 3
0
        public graphNavigationThread(T _start, Boolean _includeStart)
        {
            startNode = _start;


            graphNavigationIteration <T> iteration = new graphNavigationIteration <T>();

            if (_includeStart)
            {
                iteration.Nodes.Add(_start);

                selected.Add(_start);
            }
        }
Esempio n. 4
0
        public graphNavigationIteration <T> RunIteration(graphNavigationThread <T> thread)
        {
            var   lastIteration = thread.LastOrDefault();
            Int32 i             = 0;

            graphNavigationIteration <T> newIteration = null;
            List <T> toNavigate = null;

            if (lastIteration == null)
            {
                lastIteration = new graphNavigationIteration <T>();
                if (IncludeStartInResult)
                {
                    lastIteration.Nodes.Add(thread.startNode);
                }
                else
                {
                    lastIteration.Nodes.AddRange(Select(thread.startNode));
                }
                thread.Add(lastIteration);
            }

            toNavigate = thread.StartNewIteration();


            /*
             *
             *
             *    newIteration = lastIteration.StartNewIteration();
             *
             *    foreach (T node in lastIteration.Nodes)
             *    {
             *
             *    }
             *
             * }
             *
             * if (i == 0)
             * {
             *
             * }
             */
            lastIteration = newIteration;
            return(newIteration);
        }