fixed a mistake in workloadbalance
method used immutable instance of clusters array
This commit is contained in:
parent
365c028fbc
commit
f34d5dce80
@ -3,11 +3,11 @@
|
||||
<!-- encoders are assigned the type
|
||||
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
|
||||
<encoder>
|
||||
<pattern>%msg%n</pattern>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="trace">
|
||||
<root level="debug">
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
</configuration>
|
@ -15,10 +15,10 @@ import cats.implicits
|
||||
import scala.util.chaining._
|
||||
|
||||
class HHCSim2(
|
||||
private val epsilonMax: Int = 0,
|
||||
private val iterations: Int = 0,
|
||||
private val WLDMax: Float = 0,
|
||||
private val customers: String Either ArraySeq[Customer]
|
||||
epsilonMax: Int = 0,
|
||||
iterations: Int = 0,
|
||||
WLDMax: Float = 0,
|
||||
customers: String Either ArraySeq[Customer]
|
||||
) extends LazyLogging {
|
||||
import HHCSim2._
|
||||
import Ordering.Double.IeeeOrdering
|
||||
@ -39,7 +39,7 @@ class HHCSim2(
|
||||
case (mstUpdated, clusters, edgeMappings, removedEdges) =>
|
||||
printClusters(clusters)
|
||||
val e =
|
||||
groupClusters2(mstUpdated, clusters, edgeMappings, removedEdges)
|
||||
groupClusters(mstUpdated, clusters, edgeMappings, removedEdges)
|
||||
printGroups(e._5)
|
||||
e
|
||||
}
|
||||
@ -184,7 +184,7 @@ class HHCSim2(
|
||||
logger.debug(s"Nearest neighbour = $s")
|
||||
// val avg = averagePairwiseDistance(mst(s))
|
||||
val avg = adjMatrix
|
||||
.map(m => averagePairwiseDistance(m)(clusters(s)))
|
||||
.map(m => averagePairwiseDistance(m)(mutClusters(s)))
|
||||
.getOrElse(9999d)
|
||||
// if (avg < epsilonMax) true else false
|
||||
|
||||
@ -204,28 +204,9 @@ class HHCSim2(
|
||||
})
|
||||
}
|
||||
|
||||
// def averagePairwiseDistance[T](
|
||||
// lst: List[HHCEdge2[T]]
|
||||
// )(implicit num: Numeric[T]) = {
|
||||
// val it = lst.combinations(2)
|
||||
// val sum = lst.foldLeft(0)((x, y) => x + num.toInt(y.weight))
|
||||
// val n = if (lst.length == 0) 1 else lst.length
|
||||
// val avg = sum / n
|
||||
|
||||
// // it.map()
|
||||
// avg
|
||||
// }
|
||||
|
||||
def averagePairwiseDistance(graph: GraphMatrix[Double])(
|
||||
cluster: List[Int]
|
||||
) = {
|
||||
// val iter = cluster.combinations(2)
|
||||
// var sum = 0d
|
||||
// for (pair <- iter) {
|
||||
// val (i, j) = pair(0) -> pair(1)
|
||||
// sum += graph(i)(j)
|
||||
// }
|
||||
// val n = if (iter.length == 0) 1 else iter.length
|
||||
val (sum, size) = cluster
|
||||
.combinations(2)
|
||||
.foldLeft((0d, 0))((acc, pair) => {
|
||||
@ -266,10 +247,6 @@ object HHCSim2 extends HHCTypes {
|
||||
arr match {
|
||||
case Array(latitude, longitude, workLoad) => {
|
||||
val cust =
|
||||
// Customer(
|
||||
// Coord(latitude.toDouble, longitude.toDouble),
|
||||
// workLoad.toFloat
|
||||
// )
|
||||
for {
|
||||
lat <- latitude.toDoubleOption
|
||||
lon <- longitude.toDoubleOption
|
||||
@ -280,7 +257,6 @@ object HHCSim2 extends HHCTypes {
|
||||
case Some(c) => loop(lst += c, iter)
|
||||
case None => Left(s"Error reading customers at line - $line")
|
||||
}
|
||||
// loop(lst += cust, iter)
|
||||
}
|
||||
case _ => {
|
||||
if (line.equals(" ") || line.contains("\n"))
|
||||
@ -439,21 +415,8 @@ object HHCSim2 extends HHCTypes {
|
||||
val result = ArraySeq.tabulate(mstUpdated.length) { i =>
|
||||
{
|
||||
val buf = ListBuffer[Int]()
|
||||
// mstUpdated(i).isEmpty match {
|
||||
// case true => { lst += i }
|
||||
// case false => {
|
||||
// if (!visited(i)) {
|
||||
// lst ++= DFS(i)(mstUpdated)
|
||||
// for (j <- lst) visited(j) = true
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
visited(i) match {
|
||||
case true => {
|
||||
// val (nds, rms) = assignEdges(List(i), removedEdges2)
|
||||
// egdeMappings(i) = nds
|
||||
// removedEdges2 = rms
|
||||
}
|
||||
case true =>
|
||||
case false if (!mstUpdated(i).isEmpty) => {
|
||||
val nodes = DFS(i)(mstUpdated)
|
||||
buf ++= nodes
|
||||
@ -475,8 +438,6 @@ object HHCSim2 extends HHCTypes {
|
||||
|
||||
// println(s"Removed edges size: ${removedEdges2.size}")
|
||||
|
||||
// result
|
||||
// (result, ArraySeq.unsafeWrapArray(egdeMappings), removedEdges)
|
||||
(
|
||||
mstUpdated,
|
||||
result.filterNot(_.isEmpty),
|
||||
@ -503,31 +464,11 @@ object HHCSim2 extends HHCTypes {
|
||||
val node = iter.next
|
||||
val (filt, rm) =
|
||||
removedEdges.partition(e => e.fromNode == node)
|
||||
// removedEdges.partition(e => e.toNode == node || e.fromNode == node)
|
||||
loop(nodes, rm, iter, filt)
|
||||
}
|
||||
}
|
||||
// val filtered = ListBuffer.empty[HHCEdge2[T]]
|
||||
// val updated = ListBuffer.empty[HHCEdge2[T]]
|
||||
// for (node <- nodes) {
|
||||
// val (filt, rm) =
|
||||
// removedEdges.partition(e => e.toNode == node || e.fromNode == node)
|
||||
// if (!filtered.isEmpty) {
|
||||
// // return (filt.toList, rm.toList)
|
||||
// } else {
|
||||
// filtered ++= filt
|
||||
// updated ++= rm
|
||||
// }
|
||||
// }
|
||||
|
||||
// print(filtered)
|
||||
// (filtered.toList, updated.toList)
|
||||
val (edges, removedEdgesUpdated) =
|
||||
loop(nodes, removedEdges, it, List.empty[HHCEdge2[T]])
|
||||
// val edges2 = edges.sortWith {
|
||||
// case (HHCEdge2(_, _, weight1), HHCEdge2(_, _, weight2)) =>
|
||||
// weight1 < weight2
|
||||
// }
|
||||
(edges, removedEdgesUpdated)
|
||||
}
|
||||
|
||||
@ -543,50 +484,6 @@ object HHCSim2 extends HHCTypes {
|
||||
}
|
||||
|
||||
def groupClusters[N: Ordering](
|
||||
clusters: Clusters,
|
||||
edgeMappings: ArraySeq[List[HHCEdge2[N]]],
|
||||
removed: RemovedEdges[N]
|
||||
) = {
|
||||
var k = -1
|
||||
val clustMap = collection.mutable.Map.empty[Int, Int]
|
||||
val groups = ArraySeq.tabulate(edgeMappings.size)(i => {
|
||||
val buf = ListBuffer.empty[(Int, N)]
|
||||
val lst = edgeMappings(i)
|
||||
val y = lst.foreach(e => {
|
||||
if (edgeMappings(e.toNode).isEmpty) {
|
||||
// var buf = ListBuffer.empty[(Int, N)]
|
||||
for (j <- 0 until clusters.size) {
|
||||
for (edge <- clusters(j)) {
|
||||
if (edge == e.toNode)
|
||||
buf += (j -> e.weight)
|
||||
}
|
||||
}
|
||||
// Left(buf.toList)
|
||||
} else {
|
||||
buf += ((e.toNode, e.weight))
|
||||
}
|
||||
// Right(lst.map {
|
||||
// case HHCEdge2(fromNode, toNode, weight) => (toNode, weight)
|
||||
// })
|
||||
})
|
||||
if (!clusters(i).isEmpty) {
|
||||
k += 1
|
||||
clustMap += k -> i
|
||||
}
|
||||
// val lst2 = lst.map {
|
||||
// case HHCEdge2(fromNode, toNode, weight) => (toNode, weight)
|
||||
// }
|
||||
// if (buf.isEmpty) lst2 else buf.toList ::: lst2
|
||||
// if (lt.isEmpty) rt else lt
|
||||
(k, buf.sortWith {
|
||||
case ((_, weight1), (_, weight2)) =>
|
||||
weight1 < weight2
|
||||
}.toList)
|
||||
})
|
||||
(clusters, clustMap.toMap, removed, groups)
|
||||
}
|
||||
|
||||
def groupClusters2[N: Ordering](
|
||||
mst: Graph[N],
|
||||
clusters: Clusters,
|
||||
edgeMappings: ArraySeq[List[HHCEdge2[N]]],
|
||||
@ -607,147 +504,3 @@ object HHCSim2 extends HHCTypes {
|
||||
(mst, clusters, edgeMappings, removed, groups)
|
||||
}
|
||||
}
|
||||
// def fun2[N: Numeric](
|
||||
// clusters: Clusters,
|
||||
// clustMap: Map[Int, Int],
|
||||
// removedEdges: RemovedEdges[N],
|
||||
// groups: ArraySeq[(Int, List[(Int, N)])]
|
||||
// ) = {
|
||||
// customers.map(c => {
|
||||
// val mutClusters =
|
||||
// clusters.view.filterNot(_.isEmpty).zipWithIndex.toArray
|
||||
// val k = mutClusters.size
|
||||
// // val k = clustMap.size
|
||||
// for (_ <- 0 until iterations) {
|
||||
// val WL = mutClusters.view
|
||||
// // .filter(!_._1.isEmpty)
|
||||
// .map(e => {
|
||||
// val (clust, _) = e
|
||||
// val customers = clust.map(j => c(j))
|
||||
// val wl = customers.foldLeft(0f)(_ + _.workload)
|
||||
// wl
|
||||
// })
|
||||
// .to(ArraySeq)
|
||||
// // logger.debug(s"$mutClusters")
|
||||
// logger.debug(s"$WL")
|
||||
// var counter = 0
|
||||
// mutClusters.sortInPlaceWith((x, y) => {
|
||||
// val l = WL(counter)
|
||||
// if (counter < mutClusters.length - 1) counter += 1
|
||||
// println(s"$counter")
|
||||
// val r = WL(counter)
|
||||
// l < r
|
||||
// // WL(x._2) < WL(y._2)
|
||||
// })
|
||||
// val (minWL, maxWL) = WL.foldLeft((99999f, 0f))((x, y) => {
|
||||
// val (currMin, currMax) = x
|
||||
// if (y < currMin) (y, currMax)
|
||||
// else if (y > currMax) (currMin, y)
|
||||
// else x
|
||||
// })
|
||||
// // val mutSortedClust = mutClusters.sort
|
||||
// val WLD = maxWL - minWL
|
||||
// // logger.debug(s"Iterations = $iterations")
|
||||
|
||||
// logger.debug(s"maxWL = $maxWL, minWL = $minWL")
|
||||
// logger.debug(s"WLD = $WLD")
|
||||
// if (WLD > WLDMax) {
|
||||
// val clustNum = Random.between(((k / 2) + 1), k)
|
||||
// // while (clusters(groupNum).isEmpty) {
|
||||
// // print(s"num = $groupNum")
|
||||
// // groupNum = Random.between(((k / 2) + 1), k)
|
||||
// // }
|
||||
// // val clustT = mutClusters(groupNum)
|
||||
// logger.debug(s"Chosen Num=$clustNum")
|
||||
// // val t = groups(groupNum)._1
|
||||
// val p = mutClusters(clustNum)._2
|
||||
// logger.debug(s"Clust num =$p")
|
||||
// val t = clustMap(p)
|
||||
// // val t = mutClusters(clustNum)._2
|
||||
// logger.debug(s"T=$t")
|
||||
// val s = groups(t)._2(0)
|
||||
// logger.debug(s"Nearest neighbour = ${s._1}")
|
||||
// }
|
||||
// }
|
||||
// ArraySeq.unsafeWrapArray(mutClusters)
|
||||
// })
|
||||
// }
|
||||
// def workloadBalance[N: Numeric](
|
||||
// clusters: Clusters,
|
||||
// edgeMappings: ArraySeq[List[HHCEdge2[N]]],
|
||||
// removedEdges: RemovedEdges[N],
|
||||
// groups: ArraySeq[(Int, List[(Int, N)])]
|
||||
// ) =
|
||||
// customers.map { c =>
|
||||
// val k = clusters.size
|
||||
// val mutClusters = clusters.toArray
|
||||
// for (_ <- 0 until iterations) {
|
||||
// val worlkLoads =
|
||||
// mutClusters.map(
|
||||
// _.map(j => c(j)).foldLeft(0f)((x, y) => x + y.workload)
|
||||
// )
|
||||
// val sortedClusters =
|
||||
// mutClusters.map(_.sortWith((x, y) => c(x).workload < c(y).workload))
|
||||
// val minWL =
|
||||
// c.foldLeft(c(0).workload)(_ min _.workload)
|
||||
// val maxWL =
|
||||
// c.foldLeft(0f)(_ max _.workload)
|
||||
// val WLD = maxWL - minWL
|
||||
// if (WLD > WLDMax) {
|
||||
// var t = Random.between(((k / 2) + 1), k)
|
||||
// while (!mutClusters(t).isEmpty) t = Random.between(((k / 2) + 1), k)
|
||||
// val Ds = groups(t)._2(0)
|
||||
// mutClusters.updated(Ds._1, t)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// def fun[N: Numeric](
|
||||
// clusters: Clusters,
|
||||
// clustMap: Map[Int, Int],
|
||||
// removedEdges: RemovedEdges[N],
|
||||
// groups: ArraySeq[(Int, List[(Int, N)])]
|
||||
// ) = {
|
||||
// customers.map(c => {
|
||||
// val mutClusters = clusters.toArray
|
||||
// // val k = mutClusters.size
|
||||
// val k = clustMap.size
|
||||
// for (_ <- 0 until iterations) {
|
||||
// val WL = mutClusters.view
|
||||
// .filter(!_.isEmpty)
|
||||
// .map(clust => {
|
||||
// val customers = clust.map(j => c(j))
|
||||
// val wl = customers.foldLeft(0f)(_ + _.workload)
|
||||
// wl
|
||||
// })
|
||||
// .to(ArraySeq)
|
||||
// val (minWL, maxWL) = WL.foldLeft((99999f, 0f))((x, y) => {
|
||||
// val (currMin, currMax) = x
|
||||
// if (y < currMin) (y, currMax)
|
||||
// else if (y > currMax) (currMin, y)
|
||||
// else x
|
||||
// })
|
||||
// // val mutSortedClust = mutClusters.sort
|
||||
// val WLD = maxWL - minWL
|
||||
// // logger.debug(s"Iterations = $iterations")
|
||||
// logger.debug(s"$WL")
|
||||
// logger.debug(s"maxWL = $maxWL, minWL = $minWL")
|
||||
// logger.debug(s"WLD = $WLD")
|
||||
// if (WLD > WLDMax) {
|
||||
// var clustNum = Random.between(((k / 2) + 1), k)
|
||||
// // while (clusters(groupNum).isEmpty) {
|
||||
// // print(s"num = $groupNum")
|
||||
// // groupNum = Random.between(((k / 2) + 1), k)
|
||||
// // }
|
||||
// // val clustT = mutClusters(groupNum)
|
||||
// logger.debug(s"Clust Num=$clustNum")
|
||||
// // val t = groups(groupNum)._1
|
||||
// val t = clustMap(clustNum)
|
||||
// logger.debug(s"T=$t")
|
||||
// val s = groups(t)._2(0)
|
||||
// logger.debug(s"Nearest neighbour = ${s._1}")
|
||||
// }
|
||||
// }
|
||||
// ArraySeq.unsafeWrapArray(mutClusters)
|
||||
// })
|
||||
// }
|
||||
|
270
test-output2.txt
270
test-output2.txt
@ -1,4 +1,3 @@
|
||||
Graph:
|
||||
0.00, 1169.81, 464.59, 945.75, 1282.33, 1037.66, 640.89, 335.29, 111.67, 1142.56, 876.33, 845.31, 1211.84, 587.31, 735.31, 497.33, 994.87, 922.07, 767.10, 1206.08,
|
||||
1169.81, 0.00, 722.99, 682.83, 191.14, 527.48, 777.24, 929.62, 1122.63, 195.17, 605.52, 512.54, 221.44, 833.01, 862.90, 703.24, 856.59, 540.04, 634.58, 278.41,
|
||||
464.59, 722.99, 0.00, 724.38, 859.17, 599.15, 302.60, 218.49, 402.17, 732.89, 621.64, 398.11, 747.67, 294.91, 643.37, 234.41, 848.21, 485.90, 527.86, 813.31,
|
||||
@ -93,14 +92,28 @@ ArraySeq(115.13, 21.65, 2.66, 338.0, 66.130005, 136.32, 79.13, 42.29, 55.81, 23.
|
||||
Current order [2, 1, 9, 7, 10, 8, 4, 6, 0, 5, 3]
|
||||
maxWL = 338.0, minWL = 2.66
|
||||
WLD = 335.34
|
||||
Rand Num=10
|
||||
Chosen cluster = 3
|
||||
Nearest neighbour = 9
|
||||
Rand Num=7
|
||||
Chosen cluster = 6
|
||||
Nearest neighbour = 5
|
||||
5 17 -
|
||||
weight = 115.60102365831875
|
||||
5 11 -
|
||||
weight = 202.1756669521256
|
||||
17 11 -
|
||||
weight = 95.71999741615204
|
||||
Pairwise average = 137.83222934219881
|
||||
ArraySeq(115.13, 21.65, 2.66, 338.0, 66.130005, 136.32, 79.13, 42.29, 55.81, 23.83, 55.61)
|
||||
Current order [2, 1, 9, 7, 10, 8, 4, 6, 0, 5, 3]
|
||||
maxWL = 338.0, minWL = 2.66
|
||||
WLD = 335.34
|
||||
Rand Num=6
|
||||
Chosen cluster = 4
|
||||
Nearest neighbour = 1
|
||||
Pairwise average = 0.0
|
||||
Average less than epsilonMax. Updating Clusters.
|
||||
Clusters:
|
||||
Cluster-0: 0 8
|
||||
Cluster-1: 1
|
||||
Cluster-1: 4 1
|
||||
Cluster-2: 2
|
||||
Cluster-3: 3 10 18 16
|
||||
Cluster-4: 4 9 19
|
||||
@ -108,31 +121,52 @@ Cluster-5: 5 17 11
|
||||
Cluster-6: 6 13
|
||||
Cluster-7: 7
|
||||
Cluster-8: 12
|
||||
Cluster-9: 3 14
|
||||
Cluster-9: 14
|
||||
Cluster-10: 15
|
||||
ArraySeq(115.13, 21.65, 2.66, 338.0, 66.130005, 136.32, 79.13, 42.29, 55.81, 112.740005, 55.61)
|
||||
Current order [2, 1, 7, 10, 8, 4, 6, 9, 0, 5, 3]
|
||||
ArraySeq(115.13, 70.24, 2.66, 338.0, 66.130005, 136.32, 79.13, 42.29, 55.81, 23.83, 55.61)
|
||||
Current order [2, 9, 7, 10, 8, 4, 1, 6, 0, 5, 3]
|
||||
maxWL = 338.0, minWL = 2.66
|
||||
WLD = 335.34
|
||||
Rand Num=9
|
||||
Chosen cluster = 5
|
||||
Nearest neighbour = 8
|
||||
Pairwise average = 0.0
|
||||
Average less than epsilonMax. Updating Clusters.
|
||||
Clusters:
|
||||
Cluster-0: 0 8
|
||||
Cluster-1: 1
|
||||
Cluster-2: 2
|
||||
Cluster-3: 3 10 18 16
|
||||
Cluster-4: 4 9 19
|
||||
Cluster-5: 5 17 11
|
||||
Cluster-6: 6 13
|
||||
Cluster-7: 7
|
||||
Cluster-8: 5 12
|
||||
Cluster-9: 3 14
|
||||
Cluster-10: 15
|
||||
ArraySeq(115.13, 21.65, 2.66, 338.0, 66.130005, 136.32, 79.13, 42.29, 89.44, 112.740005, 55.61)
|
||||
Current order [2, 1, 7, 10, 4, 6, 8, 9, 0, 5, 3]
|
||||
Rand Num=7
|
||||
Chosen cluster = 6
|
||||
Nearest neighbour = 5
|
||||
5 17 -
|
||||
weight = 115.60102365831875
|
||||
5 11 -
|
||||
weight = 202.1756669521256
|
||||
17 11 -
|
||||
weight = 95.71999741615204
|
||||
Pairwise average = 137.83222934219881
|
||||
ArraySeq(115.13, 70.24, 2.66, 338.0, 66.130005, 136.32, 79.13, 42.29, 55.81, 23.83, 55.61)
|
||||
Current order [2, 9, 7, 10, 8, 4, 1, 6, 0, 5, 3]
|
||||
maxWL = 338.0, minWL = 2.66
|
||||
WLD = 335.34
|
||||
Rand Num=6
|
||||
Chosen cluster = 1
|
||||
Nearest neighbour = 4
|
||||
4 9 -
|
||||
weight = 148.32786590021598
|
||||
4 19 -
|
||||
weight = 152.85018337083108
|
||||
9 19 -
|
||||
weight = 99.82544752586941
|
||||
Pairwise average = 133.66783226563882
|
||||
ArraySeq(115.13, 70.24, 2.66, 338.0, 66.130005, 136.32, 79.13, 42.29, 55.81, 23.83, 55.61)
|
||||
Current order [2, 9, 7, 10, 8, 4, 1, 6, 0, 5, 3]
|
||||
maxWL = 338.0, minWL = 2.66
|
||||
WLD = 335.34
|
||||
Rand Num=7
|
||||
Chosen cluster = 6
|
||||
Nearest neighbour = 5
|
||||
5 17 -
|
||||
weight = 115.60102365831875
|
||||
5 11 -
|
||||
weight = 202.1756669521256
|
||||
17 11 -
|
||||
weight = 95.71999741615204
|
||||
Pairwise average = 137.83222934219881
|
||||
ArraySeq(115.13, 70.24, 2.66, 338.0, 66.130005, 136.32, 79.13, 42.29, 55.81, 23.83, 55.61)
|
||||
Current order [2, 9, 7, 10, 8, 4, 1, 6, 0, 5, 3]
|
||||
maxWL = 338.0, minWL = 2.66
|
||||
WLD = 335.34
|
||||
Rand Num=8
|
||||
@ -142,40 +176,51 @@ Pairwise average = 0.0
|
||||
Average less than epsilonMax. Updating Clusters.
|
||||
Clusters:
|
||||
Cluster-0: 0 8
|
||||
Cluster-1: 1
|
||||
Cluster-1: 4 1
|
||||
Cluster-2: 2
|
||||
Cluster-3: 3 10 18 16
|
||||
Cluster-4: 4 9 19
|
||||
Cluster-5: 5 17 11
|
||||
Cluster-6: 6 13
|
||||
Cluster-7: 0 7
|
||||
Cluster-8: 5 12
|
||||
Cluster-9: 3 14
|
||||
Cluster-8: 12
|
||||
Cluster-9: 14
|
||||
Cluster-10: 15
|
||||
ArraySeq(115.13, 21.65, 2.66, 338.0, 66.130005, 136.32, 79.13, 125.17, 89.44, 112.740005, 55.61)
|
||||
Current order [2, 1, 10, 4, 6, 8, 9, 0, 7, 5, 3]
|
||||
maxWL = 338.0, minWL = 2.66
|
||||
WLD = 335.34
|
||||
Rand Num=6
|
||||
Chosen cluster = 9
|
||||
Nearest neighbour = 3
|
||||
3 10 -
|
||||
weight = 110.32563662919385
|
||||
3 18 -
|
||||
weight = 197.93532036986213
|
||||
3 16 -
|
||||
weight = 176.6244692117106
|
||||
10 18 -
|
||||
weight = 109.32984942622367
|
||||
10 16 -
|
||||
weight = 277.38062276155625
|
||||
18 16 -
|
||||
weight = 330.7167343396919
|
||||
Pairwise average = 200.3854387897064
|
||||
ArraySeq(115.13, 21.65, 2.66, 338.0, 66.130005, 136.32, 79.13, 125.17, 89.44, 112.740005, 55.61)
|
||||
Current order [2, 1, 10, 4, 6, 8, 9, 0, 7, 5, 3]
|
||||
ArraySeq(115.13, 70.24, 2.66, 338.0, 66.130005, 136.32, 79.13, 125.17, 55.81, 23.83, 55.61)
|
||||
Current order [2, 9, 10, 8, 4, 1, 6, 0, 7, 5, 3]
|
||||
maxWL = 338.0, minWL = 2.66
|
||||
WLD = 335.34
|
||||
Rand Num=8
|
||||
Chosen cluster = 7
|
||||
Nearest neighbour = 2
|
||||
Pairwise average = 0.0
|
||||
Average less than epsilonMax. Updating Clusters.
|
||||
Clusters:
|
||||
Cluster-0: 0 8
|
||||
Cluster-1: 4 1
|
||||
Cluster-2: 7 2
|
||||
Cluster-3: 3 10 18 16
|
||||
Cluster-4: 4 9 19
|
||||
Cluster-5: 5 17 11
|
||||
Cluster-6: 6 13
|
||||
Cluster-7: 0 7
|
||||
Cluster-8: 12
|
||||
Cluster-9: 14
|
||||
Cluster-10: 15
|
||||
ArraySeq(115.13, 70.24, 44.95, 338.0, 66.130005, 136.32, 79.13, 125.17, 55.81, 23.83, 55.61)
|
||||
Current order [9, 2, 10, 8, 4, 1, 6, 0, 7, 5, 3]
|
||||
maxWL = 338.0, minWL = 23.83
|
||||
WLD = 314.17
|
||||
Rand Num=7
|
||||
Chosen cluster = 0
|
||||
Nearest neighbour = 7
|
||||
0 7 -
|
||||
weight = 335.29122627935715
|
||||
Pairwise average = 335.29122627935715
|
||||
ArraySeq(115.13, 70.24, 44.95, 338.0, 66.130005, 136.32, 79.13, 125.17, 55.81, 23.83, 55.61)
|
||||
Current order [9, 2, 10, 8, 4, 1, 6, 0, 7, 5, 3]
|
||||
maxWL = 338.0, minWL = 23.83
|
||||
WLD = 314.17
|
||||
Rand Num=10
|
||||
Chosen cluster = 3
|
||||
Nearest neighbour = 9
|
||||
@ -183,118 +228,23 @@ Pairwise average = 0.0
|
||||
Average less than epsilonMax. Updating Clusters.
|
||||
Clusters:
|
||||
Cluster-0: 0 8
|
||||
Cluster-1: 1
|
||||
Cluster-2: 2
|
||||
Cluster-1: 4 1
|
||||
Cluster-2: 7 2
|
||||
Cluster-3: 3 10 18 16
|
||||
Cluster-4: 4 9 19
|
||||
Cluster-5: 5 17 11
|
||||
Cluster-6: 6 13
|
||||
Cluster-7: 0 7
|
||||
Cluster-8: 5 12
|
||||
Cluster-8: 12
|
||||
Cluster-9: 3 14
|
||||
Cluster-10: 15
|
||||
ArraySeq(115.13, 21.65, 2.66, 338.0, 66.130005, 136.32, 79.13, 125.17, 89.44, 112.740005, 55.61)
|
||||
Current order [2, 1, 10, 4, 6, 8, 9, 0, 7, 5, 3]
|
||||
maxWL = 338.0, minWL = 2.66
|
||||
WLD = 335.34
|
||||
Rand Num=10
|
||||
Chosen cluster = 3
|
||||
Nearest neighbour = 9
|
||||
Pairwise average = 0.0
|
||||
Average less than epsilonMax. Updating Clusters.
|
||||
Clusters:
|
||||
Cluster-0: 0 8
|
||||
Cluster-1: 1
|
||||
Cluster-2: 2
|
||||
Cluster-3: 3 10 18 16
|
||||
Cluster-4: 4 9 19
|
||||
Cluster-5: 5 17 11
|
||||
Cluster-6: 6 13
|
||||
Cluster-7: 0 7
|
||||
Cluster-8: 5 12
|
||||
Cluster-9: 3 14
|
||||
Cluster-10: 15
|
||||
ArraySeq(115.13, 21.65, 2.66, 338.0, 66.130005, 136.32, 79.13, 125.17, 89.44, 112.740005, 55.61)
|
||||
Current order [2, 1, 10, 4, 6, 8, 9, 0, 7, 5, 3]
|
||||
maxWL = 338.0, minWL = 2.66
|
||||
WLD = 335.34
|
||||
Rand Num=9
|
||||
Chosen cluster = 5
|
||||
Nearest neighbour = 8
|
||||
Pairwise average = 0.0
|
||||
Average less than epsilonMax. Updating Clusters.
|
||||
Clusters:
|
||||
Cluster-0: 0 8
|
||||
Cluster-1: 1
|
||||
Cluster-2: 2
|
||||
Cluster-3: 3 10 18 16
|
||||
Cluster-4: 4 9 19
|
||||
Cluster-5: 5 17 11
|
||||
Cluster-6: 6 13
|
||||
Cluster-7: 0 7
|
||||
Cluster-8: 5 12
|
||||
Cluster-9: 3 14
|
||||
Cluster-10: 15
|
||||
ArraySeq(115.13, 21.65, 2.66, 338.0, 66.130005, 136.32, 79.13, 125.17, 89.44, 112.740005, 55.61)
|
||||
Current order [2, 1, 10, 4, 6, 8, 9, 0, 7, 5, 3]
|
||||
maxWL = 338.0, minWL = 2.66
|
||||
WLD = 335.34
|
||||
Rand Num=9
|
||||
Chosen cluster = 5
|
||||
Nearest neighbour = 8
|
||||
Pairwise average = 0.0
|
||||
Average less than epsilonMax. Updating Clusters.
|
||||
Clusters:
|
||||
Cluster-0: 0 8
|
||||
Cluster-1: 1
|
||||
Cluster-2: 2
|
||||
Cluster-3: 3 10 18 16
|
||||
Cluster-4: 4 9 19
|
||||
Cluster-5: 5 17 11
|
||||
Cluster-6: 6 13
|
||||
Cluster-7: 0 7
|
||||
Cluster-8: 5 12
|
||||
Cluster-9: 3 14
|
||||
Cluster-10: 15
|
||||
ArraySeq(115.13, 21.65, 2.66, 338.0, 66.130005, 136.32, 79.13, 125.17, 89.44, 112.740005, 55.61)
|
||||
Current order [2, 1, 10, 4, 6, 8, 9, 0, 7, 5, 3]
|
||||
maxWL = 338.0, minWL = 2.66
|
||||
WLD = 335.34
|
||||
Rand Num=9
|
||||
Chosen cluster = 5
|
||||
Nearest neighbour = 8
|
||||
Pairwise average = 0.0
|
||||
Average less than epsilonMax. Updating Clusters.
|
||||
Clusters:
|
||||
Cluster-0: 0 8
|
||||
Cluster-1: 1
|
||||
Cluster-2: 2
|
||||
Cluster-3: 3 10 18 16
|
||||
Cluster-4: 4 9 19
|
||||
Cluster-5: 5 17 11
|
||||
Cluster-6: 6 13
|
||||
Cluster-7: 0 7
|
||||
Cluster-8: 5 12
|
||||
Cluster-9: 3 14
|
||||
Cluster-10: 15
|
||||
ArraySeq(115.13, 21.65, 2.66, 338.0, 66.130005, 136.32, 79.13, 125.17, 89.44, 112.740005, 55.61)
|
||||
Current order [2, 1, 10, 4, 6, 8, 9, 0, 7, 5, 3]
|
||||
maxWL = 338.0, minWL = 2.66
|
||||
WLD = 335.34
|
||||
Rand Num=9
|
||||
Chosen cluster = 5
|
||||
Nearest neighbour = 8
|
||||
Pairwise average = 0.0
|
||||
Average less than epsilonMax. Updating Clusters.
|
||||
Clusters:
|
||||
Cluster-0: 0 8
|
||||
Cluster-1: 1
|
||||
Cluster-2: 2
|
||||
Cluster-3: 3 10 18 16
|
||||
Cluster-4: 4 9 19
|
||||
Cluster-5: 5 17 11
|
||||
Cluster-6: 6 13
|
||||
Cluster-7: 0 7
|
||||
Cluster-8: 5 12
|
||||
Cluster-9: 3 14
|
||||
Cluster-10: 15
|
||||
ArraySeq(115.13, 70.24, 44.95, 338.0, 66.130005, 136.32, 79.13, 125.17, 55.81, 112.740005, 55.61)
|
||||
Current order [2, 10, 8, 4, 1, 6, 9, 0, 7, 5, 3]
|
||||
maxWL = 338.0, minWL = 44.95
|
||||
WLD = 293.05
|
||||
Rand Num=8
|
||||
Chosen cluster = 7
|
||||
Nearest neighbour = 2
|
||||
7 2 -
|
||||
weight = 218.49036137013215
|
||||
Pairwise average = 218.49036137013215
|
Loading…
Reference in New Issue
Block a user