Ejemplo n.º 1
0
 public SpaceCube(int x, int y, int z, double sideLength, SpaceCube goal)
 {
     this.x          = x;
     this.y          = y;
     this.z          = z;
     this.sideLength = sideLength;
     this.goal       = goal;
 }
Ejemplo n.º 2
0
        public double Cost(IVertex ai, IVertex bi)
        {
            SpaceCube a = (SpaceCube)ai;
            SpaceCube b = (SpaceCube)bi;
            // Cubes must be ajacent!!
            int dist = Math.Abs(a.x - b.x) + Math.Abs(a.y - b.y) + Math.Abs(a.z - b.z); // Distance from a to b

            return(sideLength * Math.Sqrt(dist));
        }
Ejemplo n.º 3
0
        public override bool Equals(object otherAbstr)
        {
            SpaceCube other = (SpaceCube)otherAbstr;

            return(other.x == x && other.y == y && other.z == z);
        }