function astar_test()
% Michael Otte 
% University of Colorado at Boulder
% this function can be used to test an Astar algorithm in Matlab

% map paramiters
Rows = 100;      % the number of rows in the map
Cols = 100;      % the number of columns in the map
max_cost = 11;   % the cost in the map will range from 1 to max_cost
x = 40;          % hill factor (this changes the radius of a cost hill)

% start and goal
start_row = 20;
start_col = 10;

goal_row = 70;
goal_col = 90;

% create random map
map = random_map(Rows,Cols,x,max_cost);

% put a wall of high cost in the middle
map = fill_map(map, 50,55,30,70,max_cost);

% My path from start to goal 
[my_path_rows my_path_cols] = my_astar(map,[start_row start_col],[goal_row goal_col]);

% Your path from start to goal 
[path_rows path_cols] = astar(map,[start_row start_col],[goal_row goal_col]);



% display your path in red
% the robot is the green dot
% the goal is the 'X'
% for cost, white is good and black is bad
draw_path(map, path_rows, path_cols, [start_row start_col], [goal_row goal_col],'red');

% display my path in red
% note: empty map here keeps your path from being erased
draw_path([], my_path_rows, my_path_cols, [start_row start_col], [goal_row goal_col],'blue');