After being briefed by the Miss Liew (Time Table Planner), I am
seriously re-thinking the algorithm design.
The Vertical Allocation Algorithm seems unsuitable. It can only do
simple allocation.
I'm considering going back to Horizontal algorithms - ie. where the
slots are assigned horizontally Mon: 8am to 7pm, Tues: 8am to 7pm etc.
In the Vertical Algorithms, it was 8am: Mon to Sat, 9am: Mon to Sat etc.
In this new approach, I'm going to do:
1. For each and every slot, iterate through each Subject
2. Do Triple allocation first. Go through each Subject.
3. If the Subject has Triple slot attributes, enter that
Subject into the slot. Then, move to another Subject and
repeat the procedure. If there is insufficient triple slot,
move onto another day. If at any time, the triple slots
become exhausted (i.e. when we are at the Sat 5pm slot and
there is only 2 hours left), then, move onto another room
4. Then Do Double allocation next. Repeat the procedure in
Step 3 above again, but allocate 2 slots instead of 3.
5. Finally do Single allocation and repeat Step 3.
Each Subject will need to have 3 attributes:
boolean hasTripleAllocation;
boolean hasDoubleAllocation;
boolean hasSingleAllocation;
The AddSubject Frame and its JTable will also need to be
redesigned to enable User to enter these additional
attributes.
However, I will do all the above changes in stages.
First stage, I will just write the new algorithm to assign
Double Slots, followed by Single Slots.
If this works, I will then consider the other changes.
Till then...