Skip to content
Snippets Groups Projects
Commit dcffa3fc authored by beekmannju85374's avatar beekmannju85374 :writing_hand:
Browse files

Merge branch 'master' into 'main'

various fixes

See merge request !10
parents fe667b0d 093afd68
No related branches found
No related tags found
1 merge request!10various fixes
......@@ -102,10 +102,13 @@ generateSchedules rooms startDay endDay professors = groups
| otherwise = map (splitIntoGroups (fairRest projectsLen) . sortByRoom) $ combinationsFast projectsLen (sort presentations) -- try complexity with sort and without
-- after combining the presentations, split each list into the fairest groups
-- a presentationgroup should have 3 to 5 projects each
-- finds the fairest 3,4,5 grouping for n projects
-- a fair grouping is either where every group has the same amount of projects or where one group has one less or one more project than others
-- lowest remainder = 1 means last group has one more project, lowest dif remainder = 1 means last group has one less project
-- if 5 is the fairest with rest 1 change to resultDif because you cannot have groupings of 6
-- if 3 is the fairest with dif rest 1 change to result because you cannot have groupings of 2
-- 3a + 4b + 5c = n
-- if 3,4 or 5 are equal, does findEven change if the other equal number is chosen?
-- guard order is important!
......@@ -115,7 +118,7 @@ fairRest n
| first resultDif == 3 && third result == 1 = first result -- last group cannot be 2 since its not allowed
| second result <= 1 = first result
| second result > 1 = first resultDif
| otherwise = error "critical math error in fairRest" -- is not possible
| otherwise = error "critical math error in fairRest" -- is not possible since for any n and x = 3, either n mod x is 1 or 0 or x - n mod x is 1
where
result = minimumBy (compare `on` second) modResults
resultDif = minimumBy (compare `on` third) modResults
......@@ -125,9 +128,6 @@ fairRest n
second (_, x, _) = x
third (_, _, x) = x
-- if first result == 5 && second result == 1 then first resultDif else first result
-- ( n, x, n%x, x - (n%x) )
fairRestDebug :: Int -> [(Int, Int,Int,Int)]
fairRestDebug n = result
......@@ -168,11 +168,11 @@ filterPresentations x = filter (\p -> (professor p, project p) /= (professor x,
-- if the amount of groups are even: no mix of rooms inside a group
-- if the amount of projects is even: amount of rooms should be equal
-- if the amount of projects is uneven: amount of rooms can be off by one
-- will maybe behave strange if having more than 2 rooms, cant find an easy solution and is unlikely so its not a prio for now
-- will behave not perfectly when having more than 2 rooms, cant find an easy solution and is unlikely so it has a low prio
findEven :: [[[Presentation]]] -> [Room] -> [[[Presentation]]]
findEven presentations rooms
| projectsLen <= 5 = filter (\group -> length (nub (map room (concat group))) == 1) presentations -- if projects only need one room, they should use only one room
| otherwise = filter (`checkEven` rooms) presentations
| projectsLen <= 5 = filter (\group -> length (nub (map room (concat group))) == 1) presentations -- if projects only need one room, they should use only one room
| otherwise = filter (`checkEven` rooms) presentations
where
projectsLen = length (concat $ head presentations)
......
No preview for this file type
No preview for this file type
......@@ -13,22 +13,57 @@
\begin{document}
\noindent \textbf{Vortragsgruppe S1}\\
Beginn: 14:00\\
\\
\begin{tabular}{@{}llll}
Datum & Projektgruppe & Dozent/in & Raum\\
04.04.24 & Project 2 & Professor 2 & H\\
11.04.24 & Project 1 & Professor 1 & H\\
18.04.24 & Project N & Professor 1 & H\\
04.04.24 & Memtest & Meier & H\\
11.04.24 & project1N & P1 & H\\
18.04.24 & KI-Survey1 & Duman & H\\
\end{tabular}
\\\\
\noindent \textbf{Vortragsgruppe S2}\\
Beginn: 14:00\\
\\
\begin{tabular}{@{}llll}
Datum & Projektgruppe & Dozent/in & Raum\\
04.04.24 & Project 4 & Professor 4 & P\\
11.04.24 & Project 3 & Professor 3 & P\\
25.04.24 & Project 5 & Professor 5 & P\\
25.04.24 & Memtest2 & Meier & H\\
02.05.24 & project2N & P2 & H\\
16.05.24 & project45 & P4 & H\\
\end{tabular}
\\\\
\noindent \textbf{Vortragsgruppe S3}\\
Beginn: 14:00\\
\begin{tabular}{@{}llll}
Datum & Projektgruppe & Dozent/in & Raum\\
23.05.24 & project6 & P6 & H\\
06.06.24 & project8 & P8 & H\\
13.06.24 & MMO & Schulz & H\\
\end{tabular}
\\\\
\noindent \textbf{Vortragsgruppe S4}\\
Beginn: 14:00\\
\begin{tabular}{@{}llll}
Datum & Projektgruppe & Dozent/in & Raum\\
04.04.24 & project1 & P1 & P\\
11.04.24 & project3 & P3 & P\\
18.04.24 & project10 & P10 & P\\
\end{tabular}
\\\\
\noindent \textbf{Vortragsgruppe S5}\\
Beginn: 14:00\\
\begin{tabular}{@{}llll}
Datum & Projektgruppe & Dozent/in & Raum\\
25.04.24 & project2 & P2 & P\\
02.05.24 & project4 & P4 & P\\
16.05.24 & project5 & P5 & P\\
\end{tabular}
\\\\
\noindent \textbf{Vortragsgruppe S6}\\
Beginn: 14:00\\
\begin{tabular}{@{}llll}
Datum & Projektgruppe & Dozent/in & Raum\\
23.05.24 & project7 & P7 & P\\
06.06.24 & project9 & P9 & P\\
13.06.24 & THNSensor & Zapf & P\\
20.06.24 & MMO2 & Schulz & P\\
\end{tabular}
\\\\
\end{document}
......@@ -13,5 +13,4 @@ P7,project7,2024-04-18,
P8,project8,2024-04-18,
P9,project9,2024-04-04,
P10,project10,2024-04-11,
P11,project11,2024-04-18,
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment