@@ -30,34 +30,7 @@ class LIPSAlgorithm<T> : AbstractGeneticAlgorithm<T>() where T : Individual {
3030 val i = sampleSuite()
3131 println (" [LIPS DEBUG] initPopulation: sampled initial individual" )
3232
33- // 2) Compute UB directly from the sampled individual `i`
34- // Merge suite fitness and consider targets with score < 1.0 as uncovered
35- val view = if (i.suite.isNotEmpty()) {
36- val fv = i.suite.first().fitness.copy()
37- i.suite.forEach { ei -> fv.merge(ei.fitness) }
38- fv.getViewOfData()
39- } else emptyMap()
40-
41- val uncovered = view.filterValues { it.score < FitnessValue .MAX_VALUE }.keys.toList()
42- println (" [LIPS DEBUG] initPopulation: derived uncoveredSize=${uncovered.size} from initial individual" )
43-
44- // 3) Select current target b
45- if (uncovered.isNotEmpty()) {
46- val target = uncovered.last()
47- currentTarget = target
48- frozenTargets = setOf (target)
49- println (" [LIPS DEBUG] initPopulation: selected target=$target , frozenTargets set" )
50- } else {
51- currentTarget = null
52- frozenTargets = emptySet()
53- println (" [LIPS DEBUG] initPopulation: no uncovered targets in initial individual; frozenTargets cleared" )
54- }
55-
56- // 4) initialize budget for this target
57- budgetLeftForCurrentTarget = calculatePerTargetBudget(maxOf(1 , uncovered.size))
58- println (" [LIPS DEBUG] init: target=${currentTarget} uncovered=${uncovered.size} budgetLeftForCurrentTarget=$budgetLeftForCurrentTarget " )
59-
60- // 5) P <- RandomPopulation(ps-1) ∪ {i}
33+ // 2) P <- RandomPopulation(ps-1) ∪ {i}
6134 population.add(i)
6235 println (" [LIPS DEBUG] initPopulation: added initial individual, pop=${population.size} " )
6336 while (population.size < config.populationSize) {
@@ -71,12 +44,17 @@ class LIPSAlgorithm<T> : AbstractGeneticAlgorithm<T>() where T : Individual {
7144
7245 override fun searchOnce () {
7346 beginGeneration()
47+ println (" [LIPS DEBUG] searchOnce: popSize=${population.size} " )
7448
7549 // Compute uncovered goals
7650 val uncovered = archive.notCoveredTargets()
51+ println (" [LIPS DEBUG] searchOnce: uncoveredSize=${uncovered.size} " )
7752 if (uncovered.isEmpty()) {
53+ println (" [LIPS DEBUG] searchOnce: uncovered is EMPTY; ending generation" )
7854 endGeneration()
7955 return
56+ } else {
57+ println (" [LIPS DEBUG] searchOnce: uncovered is NOT EMPTY" )
8058 }
8159
8260 // current target is null if covered by previous generation or out of budget
0 commit comments