Bugfixing explain

This commit is contained in:
Claude Brisson
2025-07-24 20:38:49 +02:00
parent d47d4fc8cc
commit 84ab78c461
3 changed files with 15 additions and 12 deletions

View File

@@ -91,7 +91,7 @@ sealed class Solver(
fun pair(): List<Game> {
// check that at this stage, we have an even number of pairables
// The BYE player should have been added beforehand to make a number of pairables even.
// The BYE player should have been added beforehand to make the number of pairables even.
if (pairables.size % 2 != 0) throw Error("expecting an even number of pairables")
val builder = GraphBuilder(SimpleDirectedWeightedGraph<Pairable, DefaultWeightedEdge>(DefaultWeightedEdge::class.java))

View File

@@ -6,6 +6,7 @@
}
#pairing-table {
border-collapse: collapse;
width: max-content;
thead {
//border-collapse: collapse;
tr {
@@ -97,6 +98,7 @@
}
td {
height: 55px;
width: 55px;
border: solid 1px gray;
position: relative;
&.game::after {

View File

@@ -62,6 +62,7 @@
#if($white.id != $black.id)
#set($key = "$white.id-$black.id")
#set($weights = $explain.weights[$key])
#if($weights)
#set($toMax = $explain.max - $weights.total)
#set($toMin = $weights.total - $explain.min)
#if ($toMax > $toMin)
@@ -71,11 +72,11 @@
## total is close to max
#set($percent = 60 + ($explain.max - $weights.total) / ($explain.max - $explain.high) * 40)
#end
<!-- $!percent -->
#end
#set($game = $explain.games[$key])
<td data-wb="$white.id-$black.id" #if($game)class="game"#end style="background-color: color-mix(in srgb, rgb(0 255 0) ${percent}%, rgb(255 0 0));">
<td data-wb="$white.id-$black.id" #if($game)class="game"#end #if($weights)style="background-color: color-mix(in srgb, rgb(0 255 0) ${percent}%, rgb(255 0 0));"#end>
<div class="weights">
<pre>$weights.toPrettyString()</pre>
<pre>#if($weights)$weights.toPrettyString()#{else}Bye Player#end</pre>
</div>
</td>
#else