From 9ca98f10be39952a178a5566a9339e435877b2d0 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sat, 9 Sep 2023 17:18:47 +0700 Subject: [PATCH] Don't create random --- .../ru/dbotthepony/kstarbound/world/LightCalculator.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/world/LightCalculator.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/world/LightCalculator.kt index 87108def..a4c6b367 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/world/LightCalculator.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/world/LightCalculator.kt @@ -352,10 +352,10 @@ class LightCalculator(val parent: ICellAccess, val width: Int, val height: Int) val clusterCount = threads.size.coerceAtMost(pointLights.size) val clusters = ArrayList(clusterCount) val startingPoints = IntArraySet() - val rand = Random(System.nanoTime()) + // val rand = Random(System.nanoTime()) while (startingPoints.size < clusterCount) { - //startingPoints.add(rand.nextInt(0, pointLights.size)) + // startingPoints.add(rand.nextInt(0, pointLights.size)) startingPoints.add(startingPoints.size) } @@ -399,7 +399,7 @@ class LightCalculator(val parent: ICellAccess, val width: Int, val height: Int) // check their centres of mass, and probably // merge clusters which are too close to each other, // to avoid excess work - // if we merge something, re-run k-clusters algorithm + // if we merge something, re-run k-means algorithm if (converged) { for (cluster1 in clusters) { for (cluster2 in clusters) {