Skip to content

Commit

Permalink
#826 fix issue with incomplete squad assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
luechtdiode committed Feb 16, 2024
1 parent f84a42f commit 922a157
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,14 @@ object RiegenBuilder {
val riegen = kandidatriegen.map(_._2).sortBy(r => r.start.map( dzl.indexOf(_)))
//kandidat.diszipline für die Rotationsberechnung verwenden
val rg = riegen.groupBy(e => e.start).toList.sortBy{d => d._1.map( dzl.indexOf(_))}
val geraete = dzl.foldLeft(rg){(acc, item) =>
acc.find(p => p._1.exists { f => f.equals(item) }) match {
case Some(_) => acc
case _ => acc :+ (Some(item) -> List[Riege]())
val geraete = dzl.foldLeft(rg) { (acc, item) =>
acc.find(p => p._1.exists { f => f.equals(item) }) match {
case Some(_) => acc
case _ => acc :+ (Some(item) -> List[Riege]())
}
}
}.sortBy(geraet => geraet._1.map(g => dzl.indexOf(g)))
.filter(pair => dzlmap.exists(p => pair._1.contains(p._1)))
.sortBy(geraet => geraet._1.map(g => dzl.indexOf(g)))
.map(geraet => (geraet._1, geraet._2, dzlmap(geraet._1.get)))

val startformationen = pickStartformationen(geraete, durchgang, k => (k.einteilung, k.diszipline))
Expand Down

0 comments on commit 922a157

Please sign in to comment.