Divide the weights before building the graph with jgrapht

This commit is contained in:
Quentin Rendu
2023-12-07 15:13:25 +01:00
parent 707eae15b3
commit e0dfba27d8

View File

@@ -86,8 +86,8 @@ sealed class BaseSolver(
for (j in i + 1 until nameSortedPairables.size) { for (j in i + 1 until nameSortedPairables.size) {
val p = nameSortedPairables[i] val p = nameSortedPairables[i]
val q = nameSortedPairables[j] val q = nameSortedPairables[j]
weight(p, q).let { if (it != Double.NaN) builder.addEdge(p, q, it/1.0) } weight(p, q).let { if (it != Double.NaN) builder.addEdge(p, q, it/1e6) }
weight(q, p).let { if (it != Double.NaN) builder.addEdge(q, p, it/1.0) } weight(q, p).let { if (it != Double.NaN) builder.addEdge(q, p, it/1e6) }
if (DEBUG_EXPORT_WEIGHT) if (DEBUG_EXPORT_WEIGHT)
{ {
File(WEIGHTS_FILE).appendText("Player1Name="+p.nameSeed()+"\n") File(WEIGHTS_FILE).appendText("Player1Name="+p.nameSeed()+"\n")