From b6de508ea05e754c372365efb2d3d843c54536a0 Mon Sep 17 00:00:00 2001 From: Elias Fierke Date: Tue, 17 Mar 2026 13:55:07 +0100 Subject: [PATCH] [chore:] removed ai-slop-test-crafting-function --- crafter.cs | 107 ----------------------------------------------------- 1 file changed, 107 deletions(-) diff --git a/crafter.cs b/crafter.cs index 0c25d81..e611e36 100644 --- a/crafter.cs +++ b/crafter.cs @@ -228,113 +228,6 @@ public class CourseCrafter } - public static void CraftOld() - { - GeneratedCourses = new(); - - var settings = Settings.Instance; - var students = settings.Students; - var sports = settings.Sports; - - if (students.Count == 0 || sports.Count == 0) - return; - - int semesterCount = sports.Max(s => s.Semester.Length); - - foreach (var st in students) - st.Result = Enumerable.Repeat("Fehler", semesterCount).ToList(); - - var nameMap = new Dictionary(StringComparer.OrdinalIgnoreCase); - foreach (var sp in sports) - { - nameMap[sp.Name] = sp; - foreach (var alt in sp.AlternativeNames) - nameMap[alt] = sp; - } - - // Nachfrage je Sport - var demand = new Dictionary>(); - foreach (var sp in sports) - demand[sp] = new List(); - - foreach (var st in students) - { - foreach (var sel in st.SelectedCourseNames.Distinct()) - { - if (nameMap.TryGetValue(sel, out var sp)) - demand[sp].Add(st); - } - } - - // ===== Semesterweise echte Verteilung ===== - for (int sem = 0; sem < semesterCount; sem++) - { - int remainingSemesterSlots = settings.NumCoursesPerSemester; - - foreach (var sp in sports) - { - if (sem >= sp.Semester.Length) - continue; - - if (remainingSemesterSlots <= 0) - break; - - var interested = demand[sp] - .Where(st => - st.Result![sem] == "Fehler" && - !st.Result.Contains(sp.Name)) - .ToList(); - - if (interested.Count < sp.MinStudents) - continue; - - int maxInstances = Math.Min(sp.Semester[sem], remainingSemesterSlots); - int instanceCount = 0; - int index = 0; - - while (interested.Count - index >= sp.MinStudents && - instanceCount < maxInstances) - { - var inst = new CourseInstance - { - Sport = sp, - Remaining = sp.MaxStudents - }; - - GeneratedCourses.Add((sem, inst)); - remainingSemesterSlots--; - instanceCount++; - - int filled = 0; - - while (filled < sp.MaxStudents && - index < interested.Count) - { - var st = interested[index++]; - - if (st.Result![sem] != "Fehler") - continue; - - //inst.Students.Add(st); - inst.Remaining--; - st.Result[sem] = sp.Name; - filled++; - } - - // Falls Mindestanzahl nicht erreicht → Instanz verwerfen - if (inst.Students.Count < sp.MinStudents) - { - //foreach (var st in inst.Students) - //st.Result[sem] = "Fehler"; - - GeneratedCourses.Remove((sem, inst)); - remainingSemesterSlots++; - break; - } - } - } - } - } public static string GenerateStatistics() {