Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Planer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
beekmannju85374
Planer
Commits
cb38e00f
Commit
cb38e00f
authored
7 months ago
by
beekmannju85374
Browse files
Options
Downloads
Patches
Plain Diff
added functionality to save and load schedules
parent
093afd68
No related branches found
Branches containing commit
No related tags found
1 merge request
!11
added functionality to save and load schedules
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/Main.hs
+19
-3
19 additions, 3 deletions
app/Main.hs
savedPres
+25
-0
25 additions, 0 deletions
savedPres
with
44 additions
and
3 deletions
app/Main.hs
+
19
−
3
View file @
cb38e00f
...
...
@@ -23,14 +23,14 @@ data Professor = Professor {
availableDays
::
[
Day
],
-- avail and unavailDays are mutually exclusive! program does not work if both are set
projects
::
[
Project
]
}
deriving
(
Show
,
Eq
,
Ord
)
}
deriving
(
Show
,
Eq
,
Ord
,
Read
)
data
Presentation
=
Presentation
{
room
::
Room
,
day
::
Day
,
project
::
Project
,
professor
::
Professor
}
deriving
(
Eq
)
}
deriving
(
Eq
,
Read
)
instance
FromNamedRecord
Professor
where
parseNamedRecord
r
=
do
...
...
@@ -51,7 +51,6 @@ instance Ord Presentation where
compare
(
day
p1
,
room
p1
,
professor
p1
,
project
p1
)
(
day
p2
,
room
p2
,
professor
p2
,
project
p2
)
main
::
IO
()
main
=
do
putStrLn
"Hello"
...
...
@@ -102,6 +101,17 @@ 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
saveToFile
::
[[
Presentation
]]
->
FilePath
->
IO
()
saveToFile
presentations
filename
=
do
let
content
=
unlines
$
map
(
unlines
.
map
detailedPrint
)
presentations
writeFile
filename
content
loadFromFile
::
FilePath
->
IO
[[
Presentation
]]
loadFromFile
filename
=
do
content
<-
readFile
filename
let
presentations
=
map
(
map
read
.
lines
)
(
splitOn
"
\n\n
"
content
)
return
presentations
-- a presentationgroup should have 3 to 5 projects each
-- finds the fairest 3,4,5 grouping for n projects
...
...
@@ -313,6 +323,12 @@ prettyPrint p = "Presentation:\n" ++
" Project: "
++
project
p
++
" Professor: "
++
profName
(
professor
p
)
++
"
\n
"
detailedPrint
::
Presentation
->
String
detailedPrint
p
=
"Presentation {room = "
++
show
(
room
p
)
++
", day = "
++
show
(
day
p
)
++
", project = "
++
show
(
project
p
)
++
", professor = "
++
show
(
professor
p
)
++
"}"
{-
-- CSV handling:
...
...
This diff is collapsed.
Click to expand it.
savedPres
0 → 100644
+
25
−
0
View file @
cb38e00f
Presentation {room = "H", day = 2024-04-04, project = "Memtest", professor = Professor {profName = "Meier", unavailableDays = [2024-04-11,2024-04-18], availableDays = [], projects = ["Memtest","Memtest2"]}}
Presentation {room = "H", day = 2024-04-11, project = "project1N", professor = Professor {profName = "P1", unavailableDays = [2024-04-23], availableDays = [], projects = ["project1","project1N"]}}
Presentation {room = "H", day = 2024-04-18, project = "KI-Survey1", professor = Professor {profName = "Duman", unavailableDays = [2024-04-04,2024-04-11], availableDays = [], projects = ["KI-Survey1"]}}
Presentation {room = "H", day = 2024-04-25, project = "Memtest2", professor = Professor {profName = "Meier", unavailableDays = [2024-04-11,2024-04-18], availableDays = [], projects = ["Memtest","Memtest2"]}}
Presentation {room = "H", day = 2024-05-02, project = "project2N", professor = Professor {profName = "P2", unavailableDays = [2024-04-11,2024-04-18], availableDays = [], projects = ["project2","project2N"]}}
Presentation {room = "H", day = 2024-05-16, project = "project45", professor = Professor {profName = "P4", unavailableDays = [2024-04-18], availableDays = [], projects = ["project4","project45"]}}
Presentation {room = "H", day = 2024-05-23, project = "project6", professor = Professor {profName = "P6", unavailableDays = [2024-04-11], availableDays = [], projects = ["project6"]}}
Presentation {room = "H", day = 2024-06-06, project = "project8", professor = Professor {profName = "P8", unavailableDays = [2024-04-18], availableDays = [], projects = ["project8"]}}
Presentation {room = "H", day = 2024-06-13, project = "MMO", professor = Professor {profName = "Schulz", unavailableDays = [2024-04-18], availableDays = [], projects = ["MMO","MMO2"]}}
Presentation {room = "H", day = 2024-06-20, project = "MMO2", professor = Professor {profName = "Schulz", unavailableDays = [2024-04-18], availableDays = [], projects = ["MMO","MMO2"]}}
Presentation {room = "P", day = 2024-04-04, project = "project1", professor = Professor {profName = "P1", unavailableDays = [2024-04-23], availableDays = [], projects = ["project1","project1N"]}}
Presentation {room = "P", day = 2024-04-11, project = "project3", professor = Professor {profName = "P3", unavailableDays = [2024-04-04], availableDays = [], projects = ["project3"]}}
Presentation {room = "P", day = 2024-04-18, project = "project10", professor = Professor {profName = "P10", unavailableDays = [2024-04-11], availableDays = [], projects = ["project10"]}}
Presentation {room = "P", day = 2024-04-25, project = "project2", professor = Professor {profName = "P2", unavailableDays = [2024-04-11,2024-04-18], availableDays = [], projects = ["project2","project2N"]}}
Presentation {room = "P", day = 2024-05-02, project = "project4", professor = Professor {profName = "P4", unavailableDays = [2024-04-18], availableDays = [], projects = ["project4","project45"]}}
Presentation {room = "P", day = 2024-05-16, project = "project5", professor = Professor {profName = "P5", unavailableDays = [2024-04-04], availableDays = [], projects = ["project5"]}}
Presentation {room = "P", day = 2024-05-23, project = "project7", professor = Professor {profName = "P7", unavailableDays = [2024-04-18], availableDays = [], projects = ["project7"]}}
Presentation {room = "P", day = 2024-06-06, project = "project9", professor = Professor {profName = "P9", unavailableDays = [2024-04-04], availableDays = [], projects = ["project9"]}}
Presentation {room = "P", day = 2024-06-13, project = "THNSensor", professor = Professor {profName = "Zapf", unavailableDays = [2024-04-11], availableDays = [], projects = ["THNSensor"]}}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment