We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3acbb12 commit 22cb05eCopy full SHA for 22cb05e
src/main/scala/copeland.scala
@@ -3,6 +3,7 @@ package org.expr.mcdm
3
import org.expr.mcdm.Direction.{Maximize, Minimize}
4
5
case class CopelandResult(
6
+ scores: Vec,
7
ranks: Vec
8
)
9
@@ -28,6 +29,10 @@ def winloss_scores(dommat: Array[Array[Int]]): Array[Array[Int]] =
28
29
def copeland(rankmatrix: Array[Array[Int]]): CopelandResult =
30
31
val winloses = winloss_scores(dominance_scores(rankmatrix))
- val scores = Array.tabulate(winloses.length)(i => winloses(i).sum)
32
- val ranks = ranksfromscores(scores.map(_.toDouble))
33
- CopelandResult(ranks)
+ val scores = Array.tabulate(winloses.length)(i => winloses(i).sum.toDouble)
+ val ranks = ranksfromscores(scores)
34
+
35
+ CopelandResult(
36
+ scores = scores,
37
+ ranks = ranks
38
+ )
0 commit comments