From: <dil...@us...> - 2015-03-16 15:25:27
|
Revision: 8041 http://sourceforge.net/p/freeorion/code/8041 Author: dilvish-fo Date: 2015-03-16 15:25:19 +0000 (Mon, 16 Mar 2015) Log Message: ----------- minor clarification of starname clustering convergence loop Modified Paths: -------------- trunk/FreeOrion/default/python/universe_generation/starnames.py Modified: trunk/FreeOrion/default/python/universe_generation/starnames.py =================================================================== --- trunk/FreeOrion/default/python/universe_generation/starnames.py 2015-03-15 13:18:37 UTC (rev 8040) +++ trunk/FreeOrion/default/python/universe_generation/starnames.py 2015-03-16 15:25:19 UTC (rev 8041) @@ -61,17 +61,16 @@ clusters = [[], []] clusters[0] = assign_clusters(all_coords, centers) # assign clusters based on init centers old_c = 0 - for loop in range(1): # main loop to try getting some convergence of center assignments + num_convergence_loops = 1 # if full convergence is deemed important then use a higher humber here + for loop in range(num_convergence_loops): # main loop to try getting some convergence of center assignments recalc_centers(centers, all_coords, clusters[old_c]) # get new centers clusters[1-old_c] = assign_clusters(all_coords, centers) # assign clusters based on new centers if clusters[0] == clusters[1]: break # stop iterating if no change in cluster assignments old_c = 1-old_c else: - # TODO: this check will never work loop will be always 0. - # if loop > 0: #if here at loop 0, then didn't try for convergence - # print "falling through system clustering iteration loop without convergence" - pass + if loop > 0: #if here at loop 0, then didn't try for convergence + print "falling through system clustering iteration loop without convergence" return clusters[1 - old_c] |