Re: [tablix-list] Extended teacher_preferred.c

From: Tomaz Solc <>
Date: Fri Jun 24 2005 - 19:04:34 CEST

Hash: SHA1


> I've extended the module teacher_preferred.c:

Was there an original version? Because I haven't seen this module yet.

> 2. Add a tuple restriction also called 'preferred-room' that allows a
> preferred room for an event to be defined.

> The fitness function needs to cope with the situation where more than one
> 'preferred-room' applies - basically it assigns a hierarchy. An event
> preferred room is more important than a class preferred room and in turn is
> more important than a teacher preferred room.

You don't mention these two features in the comment block in the source

> It might be better to have these as separate modules so different hierarchies
> can be applied by using weights, but I'll leave that to you to decide. Doing
> it this way is more rigid but should converge faster, I think.

I think it is fine as it is. Since this module isn't really specific to
teachers, I have added it to the CVS under the name "preferredroom.c"

> // ERROR between here
> if ( peroom[time->gen[m]] != -1 )
> {
> if ( room->gen[m] != peroom[time->gen[m]]) sum++;
> }
> else

The problem here is that the index of "peroom" array should be a tuple
ID, but in this code you are trying to use time resource ID instead.
Version in CVS has this fixed.

I've written four automated test cases and it looks like it is working
properly now.

Best regards
Tomaz Solc
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird -

Received on Fri Jun 24 18:56:20 2005

This archive was generated by hypermail 2.1.8 : Tue Aug 16 2005 - 20:44:07 CEST