Пример #1
0
        public Program()
        {
            StateHandler sh  = new StateHandler(RetrieveData());
            char         end = 'F';

            sh.Learn(end);
            Console.WriteLine($"This is all the shortest paths to {end}.");
            int dist = 0;

            foreach (var c in sh.lc)
            {
                Console.WriteLine($"Path of {c} : {sh.GetSequence(c, out dist)} with distance: {dist}");
            }
            //Console.WriteLine($"Path of {start} : {sh.GetSequence(start)}");
        }
Пример #2
0
        public void InitStates(Path[] paths, StateHandler sh)
        {
            actions = new List <Tuple <State, int> >();

            foreach (Path path in paths)
            {
                if (IsRelevant(path))
                {
                    char target = GetTargetLocation(path);
                    if (!Exists(target))
                    {
                        actions.Add(new Tuple <State, int>(sh.GetState(target), path.dist));
                    }
                }
            }
        }