Bugfixing explain
This commit is contained in:
@@ -91,7 +91,7 @@ sealed class Solver(
|
|||||||
|
|
||||||
fun pair(): List<Game> {
|
fun pair(): List<Game> {
|
||||||
// check that at this stage, we have an even number of pairables
|
// 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")
|
if (pairables.size % 2 != 0) throw Error("expecting an even number of pairables")
|
||||||
val builder = GraphBuilder(SimpleDirectedWeightedGraph<Pairable, DefaultWeightedEdge>(DefaultWeightedEdge::class.java))
|
val builder = GraphBuilder(SimpleDirectedWeightedGraph<Pairable, DefaultWeightedEdge>(DefaultWeightedEdge::class.java))
|
||||||
|
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
}
|
}
|
||||||
#pairing-table {
|
#pairing-table {
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
|
width: max-content;
|
||||||
thead {
|
thead {
|
||||||
//border-collapse: collapse;
|
//border-collapse: collapse;
|
||||||
tr {
|
tr {
|
||||||
@@ -97,6 +98,7 @@
|
|||||||
}
|
}
|
||||||
td {
|
td {
|
||||||
height: 55px;
|
height: 55px;
|
||||||
|
width: 55px;
|
||||||
border: solid 1px gray;
|
border: solid 1px gray;
|
||||||
position: relative;
|
position: relative;
|
||||||
&.game::after {
|
&.game::after {
|
||||||
|
@@ -62,20 +62,21 @@
|
|||||||
#if($white.id != $black.id)
|
#if($white.id != $black.id)
|
||||||
#set($key = "$white.id-$black.id")
|
#set($key = "$white.id-$black.id")
|
||||||
#set($weights = $explain.weights[$key])
|
#set($weights = $explain.weights[$key])
|
||||||
#set($toMax = $explain.max - $weights.total)
|
#if($weights)
|
||||||
#set($toMin = $weights.total - $explain.min)
|
#set($toMax = $explain.max - $weights.total)
|
||||||
#if ($toMax > $toMin)
|
#set($toMin = $weights.total - $explain.min)
|
||||||
## total is close to min
|
#if ($toMax > $toMin)
|
||||||
#set($percent = ($weights.total - $explain.min) / ($explain.low - $explain.min) * 40)
|
## total is close to min
|
||||||
#else
|
#set($percent = ($weights.total - $explain.min) / ($explain.low - $explain.min) * 40)
|
||||||
## total is close to max
|
#else
|
||||||
#set($percent = 60 + ($explain.max - $weights.total) / ($explain.max - $explain.high) * 40)
|
## total is close to max
|
||||||
|
#set($percent = 60 + ($explain.max - $weights.total) / ($explain.max - $explain.high) * 40)
|
||||||
|
#end
|
||||||
#end
|
#end
|
||||||
<!-- $!percent -->
|
|
||||||
#set($game = $explain.games[$key])
|
#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">
|
<div class="weights">
|
||||||
<pre>$weights.toPrettyString()</pre>
|
<pre>#if($weights)$weights.toPrettyString()#{else}Bye Player#end</pre>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user