Exemplo n.º 1
0
        public Search(Labyrinth labyrinth, ITarget target, IRelationInterpreter interpreter)
        {
            Next        = Block.None;
            Labyrinth   = labyrinth;
            Target      = target;
            Interpreter = interpreter;

            Distances = GetDistancesArray(Labyrinth.Width, Labyrinth.Height);
            Counts    = new int[Labyrinth.Width, Labyrinth.Height];

            current        = new Block[Labyrinth.Width * Labyrinth.Height];
            CurrentLength  = 0;
            PossibleLength = 0;
        }
Exemplo n.º 2
0
        public Robot(Labyrinth labyrinth)
        {
            Labyrinth = labyrinth;

            toTarget    = true;
            startTarget = new SingleTarget(Block.Origin);

            actual = new ActualInterpreter();
            best   = new BestCaseInterpreter();
            worst  = new WorstCaseInterpreter();

            Brush = Brushes.Blue;

            DriveSearch = new SearchView()
            {
                Labyrinth         = Labyrinth,
                Target            = Labyrinth.Target,
                IsLabyrinthTarget = false,
                Start             = Block.Origin,
                InterpreterType   = RelationInterpreterType.BestCase,
                SearchType        = SearchType.Direct
            };

            BestSearch = new SearchView()
            {
                Labyrinth          = Labyrinth,
                Target             = Labyrinth.Target,
                IsLabyrinthTarget  = true,
                Start              = Block.Origin,
                InterpreterType    = RelationInterpreterType.BestCase,
                SearchType         = SearchType.Direct,
                PossibleRouteColor = Colors.Gold
            };

            WorstSearch = new SearchView()
            {
                Labyrinth          = Labyrinth,
                Target             = Labyrinth.Target,
                IsLabyrinthTarget  = true,
                Start              = Block.Origin,
                InterpreterType    = RelationInterpreterType.WorstCase,
                SearchType         = SearchType.Direct,
                PossibleRouteColor = Colors.Aqua
            };
        }
Exemplo n.º 3
0
 public DirectSearch(Labyrinth labyrinth, ITarget target, IRelationInterpreter interpreter)
     : base(labyrinth, target, interpreter)
 {
 }
Exemplo n.º 4
0
 public BruteForceSearch(Labyrinth labyrinth, ITarget target, IRelationInterpreter interpreter)
     : base(labyrinth, target, interpreter)
 {
 }