function cvt_corn_test ( alg, it_max )

%*****************************************************************************80
%
%% cvt_corn_test() tests cvt_corn().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    18 December 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer ALG: specifies the algorithm to use.
%    1 = update circle + disk together.
%    2 = update circle only, then update disk only.
%    3 = update circle only, then update circle + disk together.
%
%    integer IT_MAX: the maximum number of iterations.
%
%  Local:
%
%    integer IT: the current iteration index.
%
%    integer NB, the number of boundary points.
%
%    integer NI, the number of interior points.
%
%    integer NP, the total number of points.
%
%    integer NS, the number of sample points.
%
%    integer P_TYPE(NP): the "type" of each generator.
%    1, the point is constrained to the boundary of the disk.
%    2, the point is constrained to the disk.
%
%    real P_XY(2,NP): the location of the generators.
%
%    real PR_BUD, the probability that a boundary point will bud.
%
%    real PR_BUD_ANGULAR, the probability that a boundary point bud
%    will be constrained to the boundary.
%
%    real R: the radius of the circle that represents the corn kernel.
%
%    real R_MAX: the radius of the plot region.
%
  addpath ( '../cvt_corn' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'cvt_corn_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  cvt_corn() simulates the growth of a corn kernel.\n' );

  if ( nargin < 1 )
    alg = 1;
  end

  if ( nargin < 2 )
    it_max = 40;
  end
%
%  Set parameters to default values.
%
  [ nb, ni, np, ns, pr_bud, pr_bud_angular, r ] = parameter_initialize ( );
%
%  Call the simulator.
%
  cvt_corn ( alg, it_max, nb, ni, np, ns, pr_bud, pr_bud_angular, r );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'cvt_corn_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../cvt_corn' );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  t = now;
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

