AIMA.Core.Environment.EightPuzzle.EightPuzzleBoard.getLocationOf C# (CSharp) Method

getLocationOf() public method

public getLocationOf ( int val ) : XYLocation
val int
return XYLocation
	public XYLocation getLocationOf(int val) {
		int absPos = getPositionOf(val);
		return new XYLocation(getXCoord(absPos), getYCoord(absPos));
	}

Usage Example

        public double h(Object state)
        {
            EightPuzzleBoard board = (EightPuzzleBoard)state;
            int retVal             = 0;

            for (int i = 1; i < 9; i++)
            {
                XYLocation loc = board.getLocationOf(i);
                retVal += evaluateManhattanDistanceOf(i, loc);
            }
            return(retVal);
        }
All Usage Examples Of AIMA.Core.Environment.EightPuzzle.EightPuzzleBoard::getLocationOf