Terrain Intelligent Allocation using the A* algorithm.