Re: [tablix-list] Extended teacher_preferred.c

From: Tomaz Solc <tomaz.solcREMOVE@THISsiol.net>
Date: Fri Jun 24 2005 - 19:04:34 CEST

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

> 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
code.

> 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
> // AND HERE

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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCvD0isAlAlRhL9q8RAjmPAJ934jKLeUdJ5Z38x3k8GHky5EBcywCeL+mk
9sAVYuftQuhMm8gGuh0oDwI=
=dnRs
-----END PGP SIGNATURE-----
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