public ChebyshevDistanceTests() { vertexFromMock = new Mock <IVertex>(); vertexToMock = new Mock <IVertex>(); coordinateFromMock = new Mock <ICoordinate>(); coordinateToMock = new Mock <ICoordinate>(); chebyshevDistance = new ChebyshevDistance(); }
public void ChebyshevDistanceTests() { var heuristic = new ChebyshevDistance(); var srcPos = new[] { 0, 1 }; var dstPos = new[] { 0, 10 }; var cost = heuristic.GetHeuristic(srcPos, dstPos, 1.0d); Assert.AreEqual(9.0d, cost); }
public void TestDistanceCalc() { ICalculateDistance calc = new ChebyshevDistance(); double[] pos1 = { 0.5, 1.0, 2.5 }; double[] pos2 = { 0.1, 2.0, -2.5 }; Assert.AreEqual(5.0, calc.Calculate(pos1, pos2), 0.001); }