0.99.10: catalogue hybrid on ToonZ and Tots (full) and Odyssey and Three (keeping at least half the tier); every pool read again once
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -249,9 +249,16 @@ class WeightedRolloutReplayTest {
|
||||
val others = clashesWith(baseline.filterKeys { it != number }.values.map { ChannelPlan(it, ScheduleCursor()) })
|
||||
val hours = series.associate { it.title to it.episodes.sumOf { e -> e.durationMs } / 3_600_000.0 }
|
||||
out.appendLine("== ${base.name} ($number): ${series.size} shows; under 24 h of episodes: ${hours.filterValues { it < 24 }.keys.joinToString().ifEmpty { "none" }}")
|
||||
for ((label, scale) in listOf("As built" to null, "Hybrid under 12 h" to 12.0, "Hybrid under 24 h" to 24.0)) {
|
||||
val p = base.copy(catalogueScaleHours = scale)
|
||||
report(label, replay(committed, series, p, p::weightOf, others), series, p, p::weightOf, others, out)
|
||||
val watched = mapOf(103 to listOf("Gavin & Stacey", "The Mighty Boosh", "Spaced", "Phoenix Nights"), 202 to listOf("Cosmos", "Cosmos (2014)", "Wonders of the Universe", "Wonders of the Solar System", "Wonders of Life"),
|
||||
605 to listOf("Danger Mouse", "Count Duckula", "Bananaman"))[number].orEmpty()
|
||||
for ((label, scale, floor) in listOf(Triple("Without the hybrid (0.99.9)", null, MIN_CATALOGUE_SCALE), Triple("Hybrid at 24 h, full scaling", 24.0, MIN_CATALOGUE_SCALE),
|
||||
Triple("Hybrid at 24 h, keeping at least half the tier", 24.0, 0.5), Triple("Hybrid at 12 h, keeping at least half the tier", 12.0, 0.5),
|
||||
Triple("As built", base.catalogueScaleHours, base.catalogueScaleFloor))) {
|
||||
val p = base.copy(catalogueScaleHours = scale, catalogueScaleFloor = floor)
|
||||
val entries = replay(committed, series, p, p::weightOf, others)
|
||||
report(label, entries, series, p, p::weightOf, others, out)
|
||||
if (watched.isNotEmpty()) out.appendLine(" airings: " + watched.joinToString { t -> val s = series.firstOrNull { it.title == t }; "$t ${if (s == null) "not in pool" else entries.count { it.seriesId == s.id }.toString()}" } +
|
||||
(if (number == 605) "; trio in teatime: " + entries.count { e -> java.time.Instant.ofEpochMilli(e.startMs).atZone(zone).hour in 16..17 && series.firstOrNull { it.id == e.seriesId }?.title in watched } + " of " + entries.count { java.time.Instant.ofEpochMilli(it.startMs).atZone(zone).hour in 16..17 } else ""))
|
||||
}
|
||||
out.appendLine()
|
||||
}
|
||||
|
||||
@@ -193,23 +193,24 @@ class WeightedRotationTest {
|
||||
assertEquals(listOf(101, 102, 103, 104, 106, 107, 202, 203, 204, 601, 602, 603, 604, 605, 614), SmartChannels.filter { it.tierWeights != null }.map { it.number }.sorted())
|
||||
// Riot, Terra, Ring X and Junior keep equal turns.
|
||||
assertTrue(SmartChannels.filter { it.number in setOf(105, 201, 401, 611) }.all { it.tierWeights == null })
|
||||
assertEquals(setOf(204, 601, 604), SmartChannels.filter { it.catalogueScaleHours != null }.map { it.number }.toSet())
|
||||
assertEquals(setOf(103, 202, 204, 601, 604, 605, 614), SmartChannels.filter { it.catalogueScaleHours != null }.map { it.number }.toSet())
|
||||
assertEquals(setOf(103, 202), SmartChannels.filter { it.catalogueScaleFloor == 0.5 }.map { it.number }.toSet())
|
||||
assertEquals(TIER_SUPPORTING, SmartChannels.first { it.number == 204 }.weightOf(show("Haunted", 100, 60)), 0.0)
|
||||
assertEquals(TIER_CORE, SmartChannels.first { it.number == 101 }.weightOf(show("The Wonder Years", 1)), 0.0)
|
||||
assertEquals(TIER_SURPRISE, SmartChannels.first { it.number == 101 }.weightOf(show("Heartbeat", 1)), 0.0)
|
||||
assertEquals(TIER_CORE, SmartChannels.first { it.number == 101 }.weightOf(show("The Wonder Years", 100, 60)), 0.0)
|
||||
assertEquals(TIER_SURPRISE, SmartChannels.first { it.number == 101 }.weightOf(show("Heartbeat", 100, 60)), 0.0)
|
||||
assertEquals(TIER_CORE, SmartChannels.first { it.number == 601 }.weightOf(show("Tenchi Muyo! Ryo-Ohki", 100, 60)), 0.0)
|
||||
assertEquals(TIER_CORE, SmartChannels.first { it.number == 106 }.weightOf(show("Doctor Who (2023)", 1)), 0.0)
|
||||
assertEquals(TIER_CORE, SmartChannels.first { it.number == 106 }.weightOf(show("Doctor Who (2023)", 100, 60)), 0.0)
|
||||
val tots = SmartChannels.first { it.number == TOTS_NUMBER }
|
||||
assertEquals(listOf(true, true, false, false), tots.dayParts.map { it.weighted })
|
||||
val toonz = SmartChannels.first { it.number == 605 }
|
||||
val teatime = toonz.dayParts.single { it.weights.isNotEmpty() }
|
||||
assertEquals(16 to 18, teatime.fromHour to teatime.toHour)
|
||||
assertEquals(setOf("Danger Mouse", "Count Duckula", "Bananaman").map(::seriesKey).toSet(), teatime.weights.keys)
|
||||
assertEquals(TIER_SUPPORTING, toonz.weightOf(show("Danger Mouse", 1)), 0.0)
|
||||
assertEquals(TIER_CORE, toonz.weightOf(show("Looney Tunes", 1)), 0.0)
|
||||
assertEquals(TIER_SURPRISE, SmartChannels.first { it.number == 203 }.weightOf(show("Dirty Jobs", 1)), 0.0)
|
||||
assertEquals(TIER_CORE, SmartChannels.first { it.number == 603 }.weightOf(show("Mighty Morphin Power Rangers", 1)), 0.0)
|
||||
assertEquals(TIER_CORE, SmartChannels.first { it.number == 202 }.weightOf(show("Cosmos", 1)), 0.0)
|
||||
assertEquals(TIER_SUPPORTING, toonz.weightOf(show("Danger Mouse", 100, 60)), 0.0)
|
||||
assertEquals(TIER_CORE, toonz.weightOf(show("Looney Tunes", 100, 60)), 0.0)
|
||||
assertEquals(TIER_SURPRISE, SmartChannels.first { it.number == 203 }.weightOf(show("Dirty Jobs", 100, 60)), 0.0)
|
||||
assertEquals(TIER_CORE, SmartChannels.first { it.number == 603 }.weightOf(show("Mighty Morphin Power Rangers", 100, 60)), 0.0)
|
||||
assertEquals(TIER_CORE, SmartChannels.first { it.number == 202 }.weightOf(show("Cosmos", 100, 60)), 0.0)
|
||||
assertTrue(SmartChannels.filter { it.number != 614 && it.number != 605 }.all { p -> p.dayParts.all { it.weighted && it.weights.isEmpty() } })
|
||||
}
|
||||
|
||||
@@ -230,8 +231,8 @@ class WeightedRotationTest {
|
||||
@Test fun orbitThreesTiers() {
|
||||
val three = SmartChannels.first { it.number == 103 }
|
||||
assertTrue(three.searches.none { seriesKey(it) == seriesKey("Family Guy") })
|
||||
assertEquals(TIER_CORE, three.weightOf(show("Gavin & Stacey", 1)), 0.0)
|
||||
assertEquals(TIER_SURPRISE, three.weightOf(show("Brass Eye", 1)), 0.0)
|
||||
assertEquals(TIER_SUPPORTING, three.weightOf(show("Peep Show", 1)), 0.0)
|
||||
assertEquals(TIER_CORE, three.weightOf(show("Gavin & Stacey", 100, 60)), 0.0)
|
||||
assertEquals(TIER_SURPRISE, three.weightOf(show("Brass Eye", 100, 60)), 0.0)
|
||||
assertEquals(TIER_SUPPORTING, three.weightOf(show("Peep Show", 100, 60)), 0.0)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user