Back to ITC overview
if we would use subjects instead of ITimeIntervals
we need the following class. It adds a
subject to an orgroup, but hides the other
timeintervals:
class SubjectWrapper implements ISubject {
getTimeIntervals() {
return Collections.singleton(oneTI);
}
}
How can we optimize orgroups and timeintervals with the same algorithm?
Because an orgroup does not have only one
room ...
e.g. orgroup.getTimeIntervals (only for the room optimization?)
Def. of No Collision Principle
No Collision Principle = NCP
- split(subjects);if too many visitors=> ordered list of all timeintervals
- Def.:
void tryBigger(OrGroup og, int i) {
for(int n = i+1;; n++) {
OrGroup tmp = og.or(s_n).clone();
if(tmp.getCollisions() == 0) {
or use: if(tmp.getAssignments() == og.getAssignments() + s_n.getAssignments();
with og.and(s_n) == 0 it is slower?
TODO check possible rooms
ogList.add(tmp);
tryBigger(tmp, n);
}}}
- for(i=timeintervals){
tryBigger(one = new OrGroup(ti_i), i);
(TODO assign rooms here??)
I dont know which orgoup of the ti will be realized
ogList.addAll(one.getAll());
ogList.add(ti_i);always add single subject to orgroups
}
- sort(ogList);
- >> orGroup.setStartTime(..)
- >> (help: x=og_i.getPersonSet().and(og_j.getPersonSet());)
- >> maximize x!
- find orgroups for the main + submain places
- find places for the rest orgroups
Again in German
- Teile ein Fach in mehrere Kinderfächer, falls Besucherzahl zu hoch.
- Sortiere ISubject's nach Besucherzahl
- Wähle erstes Fach und bilde OrGroup anhand von personen collisionen (+order der TI's). Notiere dabei wie stark ein bestimmtes Fach an der OrGroup klebt (TreeMap<Fixierung, ISubject>). Fixierung hoch, falls IFeature's verschieden und IRaster ähnlich. Breche nach N/t Fächern ab, wobei N Gesamtanzahl der Fächer ist und z.B. t = 10 gilt.
- Wähle nächstes (besucherstarkes) Fach analog zu 3. - jetzt kann aber auch ein schach fixiertes Fach aus vorhergehenden OrGroup's genommen werden, falls Fixierung an neuer OrGroup höher.
- List<OrGroup>, wobei OrGroup's jetzt ein oder mehr Fächer haben können
- TODO Sortiere in timetable ein und weise Räume zu
- LATER finde ähnliche OrGruppen mit maximalem x = orGroup1.getPersonSet().and(orGroup2.getPersonSet())
- Für ITC: jedes Fach hat nur ein TI => verwerfe OrGroup's mit fascher Reihenfolge der TI's in 2.
No Collision Principle could have the name Min-Max Collision Principle, because
- Minimize timeatoms with orgroups (subjectset), so: less "subjects"
- Maximize timeatoms with andgroups (with "no of person" connected orgroups) so: less slots in the week
- an orgroup is a set of subjects or timeintervals
NCP with Input
change start time and rooms (do not newly create or assign)
NCP pro's:
decrease of the number of subjects (orgroup)
decrease of the number of slots per week (and groups) - more important
no test against collisions necessary
NCP contra's:
high memoryusage, time?
rooms collision are not mentioned
NCP with Input contra's
we cannot optimize a given timetable (only create!)
so that it can be useful for GA, too
room capacity does not fit
so: splitting of orgroup necessary
too many orgroups?
too long calculation to create orgroups?
New Algorithm:
- Clustering/Grouping: Divide all ITimeInterval's in T clusters, where T is the number of timeslotsPerDay * days. Every cluster has a startTime, so only group those ITimeInterval's together which can take place at this time and without a collision.
- While clustering it is necessary to assign IRoom's to ITimeInterval's, because otherwise we wouldn't know if such a cluster could exist.
- Can we do a 'Cluster assignment to timeslots'? Or is this too difficult, because we have to recognize the raster of every ITimeInterval?
IAlgorithm
boolean findsOnlyLocalOptimum
boolean optimizesRoomCollision
(boolean optimizesRoomGap)
boolean optimizesSubjectCollision
boolean optimizesSubjectGap
boolean optimizesSubjectSplitting
boolean needsInput (GA)
boolean optimizesExisting or: useOnlyWithInput (NCP)