v0.2.0-dev-22 #47

Merged
altavir merged 158 commits from dev into master 2021-07-17 11:04:22 +03:00
2 changed files with 3 additions and 5 deletions
Showing only changes of commit e1138be861 - Show all commits

View File

@ -55,12 +55,12 @@ public fun SolidGroup.markLayers(thresholds: List<Int> = listOf(500, 1000, 20000
val counterTree = VisionCounterTree(Name.EMPTY, this, hashMapOf())
val totalCount = counterTree.childrenCount
if (totalCount > thresholds.firstOrNull() ?: 0) {
val allNodes = counterTree.topToBottom().filter { it.selfCount > 1 }.distinct().toMutableList()
val allNodes = counterTree.topToBottom().distinct().toMutableList()
//println("tree construction finished")
allNodes.sortWith(
compareBy<VisionCounterTree>(
{ it.name.length },
{ it.childrenCount * it.selfCount }
{ (it.children.size + 1) * it.selfCount }
).reversed()
)
@ -76,7 +76,7 @@ public fun SolidGroup.markLayers(thresholds: List<Int> = listOf(500, 1000, 20000
if (layerIndex == 0) break
node.vision.layer = layerIndex
remaining -= node.selfCount * node.childrenCount
remaining -= node.selfCount * (node.children.size + 1)
logger?.apply {
if (node.selfCount > 1) {
info { "Prototype with name ${node.name} moved to layer $layerIndex. $remaining nodes remains" }

View File

@ -37,8 +37,6 @@ public interface Solid : Vision {
override val descriptor: NodeDescriptor get() = Companion.descriptor
public companion object {
// val SELECTED_KEY = "selected".asName()
public val DETAIL_KEY: Name = "detail".asName()