
%% max_width
%    determines the maximum width from a current grid, the maximum
%    widht represents the number of levels of subgrids from a given
%    grid.
% inputs:
%   object:Grid - current Grid object
% outputs:
%   m:integer - value representing the maximum width from the
%   current grid.
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function m = max_width(object,width)
temp = [];
for i=1:size(object.cells,2)
    if (~isempty(object.cells(i).subgrid))
        temp = [temp object.cells(i).subgrid.max_width(width+1)];
    else
        temp = [temp width];
    end
    
end
m = max(temp);
end

