Option "recursive-conflicts" in module "sametime.so"

From: Giovanni Perego <giovanni.perego_at_grupposandonato.it>
Date: Sat, 06 Oct 2007 17:00:59 +0200

Hello to everyone,
first of all, I apologise for my English...

I'm trying to apply Tablix 0.3.5 to a Nurse rostering problem.
For this reason I'm modifying the module "sametime.so" since I need a more
generic behaviour concerning resource types that have to be checked (not
necessarily "class" and "teacher" at the same time); I have introduced a
module option to specify which resource types must be used, but keeping as
defaults the previous "class" and "teacher".
Perhaps, I will introduce also the chance to choice the name of the
resource type "room"; in this way I think the module could be loaded more
times, each one with different targets and constraints.
I hope that my work could be of some interest.

Anyway, studying "sametime.c", in the handler "getconflict()" I've notice
the code that treats the "recursive-conflicts" option:

         if(recursive) {
                 for(n=0;n<restype->resnum;n++) {
                         if(res_get_conflict(restype, n, res1->resid)) {
                                 res_set_conflict(&restype->res[n], res2);
                                 res_set_conflict(res2, &restype->res[n]);
                         }
                 }
         } else {
                 res_set_conflict(res1, res2);
                 res_set_conflict(res2, res1);
         }

I feel that it should be different:

         res_set_conflict(res1, res2);
         res_set_conflict(res2, res1);
         if(recursive) {
                 for(n=0;n<restype->resnum;n++) {
                         if(res_get_conflict(restype, n, res1->resid)) {
                                 res_set_conflict(&restype->res[n], res2);
                                 res_set_conflict(res2, &restype->res[n]);
                         }
                 }
         }

I think the two calls to "res_set_conflict()" must be executed also in case
of recursive conflicts enabled, or just the conflict requested by the user
will be skipped since the following "res_get_conflict()" loop won't find it.
Am I making some mistake?
Thank you very much

Regardings
JH
Received on Sat Oct 06 2007 - 17:01:10 CEST

This archive was generated by hypermail 2.2.0 : Sun Oct 07 2007 - 06:28:03 CEST