public void ConstructorTest21()
 {
     global::PathfindingAlgorithms.Algorithms.Astar.Astar astar;
     ManhattanHeuristic s0 = new ManhattanHeuristic();
     StraightAdjacement s1 = new StraightAdjacement();
     astar = this.ConstructorTest((IHeuristic)s0, (IAdjacement)s1);
 }
 public void ProcessTest21202()
 {
     global::PathfindingAlgorithms.Algorithms.Astar.Astar astar;
     IEnumerable<ICell> iEnumerable;
     ManhattanHeuristic s0 = new ManhattanHeuristic();
     StraightAdjacement s1 = new StraightAdjacement();
     astar = AstarFactory.Create((IHeuristic)s0, (IAdjacement)s1);
     ICell[,] iCells = new ICell[1, 1];
     ValueCell s2 = new ValueCell(default(Coordinates), 0);
     iCells[0, 0] = (ICell)s2;
     iEnumerable =
       this.ProcessTest(astar, iCells, default(Coordinates), default(Coordinates));
     Assert.IsNotNull((object)astar);
 }
 public void ProcessTest84701()
 {
     global::PathfindingAlgorithms.Algorithms.Astar.Astar astar;
     IEnumerable<ICell> iEnumerable;
     ManhattanHeuristic s0 = new ManhattanHeuristic();
     StraightAdjacement s1 = new StraightAdjacement();
     astar = AstarFactory.Create((IHeuristic)s0, (IAdjacement)s1);
     ICell[,] iCells = new ICell[1, 3];
     Coordinates s2 = new Coordinates(default(int), 1);
     ValueCell s3 = new ValueCell(default(Coordinates), 0);
     iCells[0, 0] = (ICell)s3;
     Coordinates s5 = new Coordinates(default(int), 1);
     ValueCell s4 = new ValueCell(s5, 0);
     iCells[0, 1] = (ICell)s4;
     Coordinates s7 = new Coordinates(default(int), 2);
     ValueCell s6 = new ValueCell(s7, 0);
     iCells[0, 2] = (ICell)s6;
     iEnumerable = this.ProcessTest(astar, iCells, s2, default(Coordinates));
     Assert.IsNotNull((object)astar);
 }
 public void ConstructorTestThrowsArgumentNullException571()
 {
     global::PathfindingAlgorithms.Algorithms.Astar.Astar astar;
     ManhattanHeuristic s0 = new ManhattanHeuristic();
     astar = this.ConstructorTest((IHeuristic)s0, (IAdjacement)null);
 }
Ejemplo n.º 5
0
        public void ManhettanDistTest()
        {
            var h = new ManhattanHeuristic();
            Coordinates a = new Coordinates(0, 3);
            Coordinates b = new Coordinates(4, 0);
            Coordinates c = new Coordinates(0, 0);

            double ab = h.Heuristic(a, b);
            double ac = h.Heuristic(a, c);
            double bc = h.Heuristic(b, c);

            Assert.AreEqual(7.0, ab, 1e-5, "wrong distance");
            Assert.AreEqual(3.0, ac, 1e-5, "wrong distance");
            Assert.AreEqual(4.0, bc, 1e-5, "wrong distance");
        }