Don't create random
This commit is contained in:
parent
bc9896d327
commit
9ca98f10be
@ -352,10 +352,10 @@ class LightCalculator(val parent: ICellAccess, val width: Int, val height: Int)
|
|||||||
val clusterCount = threads.size.coerceAtMost(pointLights.size)
|
val clusterCount = threads.size.coerceAtMost(pointLights.size)
|
||||||
val clusters = ArrayList<TaskCluster>(clusterCount)
|
val clusters = ArrayList<TaskCluster>(clusterCount)
|
||||||
val startingPoints = IntArraySet()
|
val startingPoints = IntArraySet()
|
||||||
val rand = Random(System.nanoTime())
|
// val rand = Random(System.nanoTime())
|
||||||
|
|
||||||
while (startingPoints.size < clusterCount) {
|
while (startingPoints.size < clusterCount) {
|
||||||
//startingPoints.add(rand.nextInt(0, pointLights.size))
|
// startingPoints.add(rand.nextInt(0, pointLights.size))
|
||||||
startingPoints.add(startingPoints.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
|
// check their centres of mass, and probably
|
||||||
// merge clusters which are too close to each other,
|
// merge clusters which are too close to each other,
|
||||||
// to avoid excess work
|
// to avoid excess work
|
||||||
// if we merge something, re-run k-clusters algorithm
|
// if we merge something, re-run k-means algorithm
|
||||||
if (converged) {
|
if (converged) {
|
||||||
for (cluster1 in clusters) {
|
for (cluster1 in clusters) {
|
||||||
for (cluster2 in clusters) {
|
for (cluster2 in clusters) {
|
||||||
|
Loading…
Reference in New Issue
Block a user