function [ gen_lon, gen_lat ] = florida_cvt_pop ( gen_lon, gen_lat, ...
  pop_lon, pop_lat, pop_cdf )

%*****************************************************************************80
%
%% FLORIDA_CVT_POP estimates a CVT for Florida based on population data.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    05 July 2016
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, real GEN_LON(N), GEN_LAT(N), points to be used as the initial
%    generators.
%
%    Input, real POP_LON(M), POP_LAT(M), the longitude and latitude for
%    the population data points.
%
%    Input, real POP_CDF(M+1), the CDF for the population.
%
%    Output, real GEN_LON(N), GEN_LAT(N), improved estimates of the CVT
%    generators.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'FLORIDA_CVT_POP:\n' );
  fprintf ( 1, '  MATLAB version\n' );
  fprintf ( 1, '  Estimate a centroidal Voronoi tessellation (CVT)\n' );
  fprintf ( 1, '  of Florida, using population data.\n' );
%
%  Destroy all row vectors.
%
  gen_lon = gen_lon ( : );
  gen_lat = gen_lat ( : );
%
%  The N points are are first estimate of the CVT generators.
%
  n = length ( gen_lon );
%
%  Display the points.
%
  filename = '';
  plot_title = 'Initial CVT Generator Estimates';
  florida_point_display ( gen_lon, gen_lat, filename, plot_title );
%
%  Prepare for random sampling.
%
  sample_num = 5000;
  seed = 123456789;

  for step = 1 : 10

    [ cen_lon, cen_lat, seed ] = florida_centroid_pop ( gen_lon, gen_lat, ...
      sample_num, pop_lon, pop_lat, pop_cdf, seed );

    plot_title = sprintf ( 'CVT Step %d', step );
    florida_voronoi_display ( gen_lon, gen_lat, cen_lon, cen_lat, '', plot_title );

    filename = '';
    plot_title = sprintf ( 'Generators after step %d\n', step );
    florida_point_display ( cen_lon, cen_lat, filename, plot_title );

    gen_lon = cen_lon;
    gen_lat = cen_lat;

  end

  return
end
