Preferred Rooms Constraint

Started by OppyLock, June 25, 2008, 04:18:42 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

OppyLock

It seems that the following is not possible:

* A school has two general purpose rooms, one large (Room A) and another small (Room B).
* Both rooms are capable of holding subject A, B, C & D.
* For various reasons it is preferred that Room A is used for subject A & B before Room B is used for those subjects.
* Likewise Room B is the preferred room for subject C.
* Subject D can use either, but will likely end up in Room B as Room A is in more demand.

The timetable is overloaded in such a way that occasionally subject A or B will need to use room B.  I just want to minimize those times.

Is there a sneaky way of handling this type of constraint?
Any plans to add a room weighting to the preferred rooms constraint?

This seems to be the only requirement that I can't find a way to work around.

Liviu Lalescu

#1
I think you can solve what you need. Subjects SA, SB, SC and SD and rooms RA and RB. Add constraint subject preferred rooms, SA -> RA and RB, SB->RA and RB, SC->RA and RB, SD->RA and RB, 100%. Then subject preferred room, SA->RA, value from 90% to 99.75% or higher (try with 90%, then 95%, then 99%, then 99.75%, then 99.99%), then SB->RA  90% to 99.75%, then SC->RB 90% to 99.75%. So you will add 4+3 = 7 space constraints for these subjects and rooms.

Please try this and let me know. Did you get a working timetable so far? Maybe you would like to send me your file, for testing or inclusion into FET.

OppyLock

Thanks Liviu for the quick reply.

That answer seems logical and I'll have to give it a go in the next day or two.  I'd been fixated on getting 1 constraint to do the job, where I need several.

The application I'm putting FET too isn't actually a school timetable, it's an athletics timetable, but the analogy is the similar.  Hopefully the algorithm works the same too ;)

Subjects = Athletic events(100m sprint, High jump, etc)
Rooms = Athletics stations(Front straight, Main track, Long jump pit)
Students are broken into year levels.  
Activities tie the lot together.  
No teachers, as there is a manager for each year level, room and subject already and they stay where they are assigned and don't need any extra allocation by FET.

It's been quite difficult in the past to get a good 'tight', balanced timetable.  Each day there is always a group that is having to wait too long to start an event or takes too long to finish one.  

Once I get a meaningful solution I'll send you the file to take a look at.

I'm having to document how it works so that the next person to take on the task can 'just do it'.  Some of that doco may also prove helpful.

Liviu Lalescu

Quote
Once I get a meaningful solution I'll send you the file to take a look at.

I'm having to document how it works so that the next person to take on the task can 'just do it'.  Some of that doco may also prove helpful.

OK, I'll wait for your file and documentation to include them into FET.

mimooh

Hello!

Does the described here situation correspond to the one from the manual? https://timetabling.de/manual/FET-manual.en.html#id_29

"Subject physics must always be instructed in physics lab, but if physics lab is already occupied it is allowed to be instructed in the chemistry lab.
This example is sadly not possible, but very similar constraint is possible: Subject physics must always be instructed in physics lab or chemistry lab.
Add A subject has a set of preferred rooms."

Is then my reasoning correct that FET uses 2 constraints to handle this?:

constraint1: (phase1 says: subject.physics must take place in one of the 2 rooms):
subject.physics vs room.lab.physics = 100%
subject.physics vs room.lab.chemistry = 100%

constraint2: (phase2 says, that from the two rooms, room.lab.physics has a higher priority than room.lab.chemistry):
subject.physics vs room.lab.physics = 90%

So the same xml construct expresses two various concepts, first is for MUST-BE-IN-ONE-OF-THE-ROOMS and the second one is for PREFERRED-FROM-MUST-BE-IN-ROOMS? Am I getting this right?

    <ConstraintSubjectPreferredRooms>
      <Subject>Sys.wsp.dzi.lab</Subject>
      <Weight_Percentage>100</Weight_Percentage>
      <Number_of_Preferred_Rooms>2</Number_of_Preferred_Rooms>
      <Active>True</Active>
      <Comments/>
      <Preferred_Room>02.lab.inf.003</Preferred_Room>
      <Preferred_Room>01.lab.inf.216</Preferred_Room>
    </ConstraintSubjectPreferredRooms>

    <ConstraintSubjectPreferredRooms>
      <Subject>Sys.wsp.dzi.lab</Subject>
      <Weight_Percentage>90</Weight_Percentage>
      <Number_of_Preferred_Rooms>1</Number_of_Preferred_Rooms>
      <Active>True</Active>
      <Comments/>
      <Preferred_Room>02.lab.inf.003</Preferred_Room>
    </ConstraintSubjectPreferredRooms>

Liviu Lalescu

Yes, the first constraint 100% is preferred rooms subject to two rooms and the second is 90% (or similar) preferred room to the preferred room.

Volker Dirr

Yes. My dataset is very difficult and i do it a bit different.
I increase the 90% to 99.999%, but i DEactivate it!
As soon as i got a result and i am satisfied with the result (of course excelt of the rooms):
i load the timetable from the results folder,
unlock all rooms (fet -> timetable -> advanced lock/unlock),
activate the 99.999% room constraint
and generate again. So this takes only a very small moment.