Re: [tablix-list] Tablix 0.2.1 development release

From: Tomaz Solc <>
Date: Fri May 06 2005 - 19:47:07 CEST

Hash: SHA1


There was indeed a bug in the new parser that caused event restriction
handlers not to be called in your case. It is now fixed in the CVS version.

On the other hand, your configuration file t3.xml also had an error.

        <event name="Games 4" repeats="4">
                <resource type="teacher" name="NPR"/>
                <resource type="teacher" name="SAH"/>
                <resource type="class" name="1A"/>
                <resource type="class" name="1B"/>

You can have only one definition per resource type. I've fixed the
parser so it no longer ignores this type of errors.

        <event name="Choir" repeats="1" preferred-day="3">

"preferred-day" attribute is ignored here.

Your module seems to be working fine now. It had a bug in the
module_fitness function though. Following is the modified function
together with comments what it is actually doing. I hope they are clear
enough to show why the second for loop is not needed to check all events.

int module_fitness(chromo **c, ext **e, slist **s)
        int a,m;
        int n;
        int u;
        int sum;
        slist *list;
        chromo *time;


        // time->gennum is the number of defined tuples. This loop
        // iterates through all tuple IDs
                // a holds the resource ID of the time slot of the
                // tuple with ID m
                        int b;
                        // b holds the tuple ID of the nth tuple that is
                        // using time slot a

                        // ADDED THIS
                        // u holds the resource ID of the time slot
                        // that tuple with ID b is using
                        // (same as a)

                        int d,t;
                        // CHANGED b TO u
                        // time->restype->res[u].name is the name
                        // of the resource with ID u and type
                        // "time".
                        sscanf(time->restype->res[u].name, "%d %d", &d, &t);
                                if(d!=pday[b]) sum++;
                                if(t!=pperiod[b]) sum++;

I have just one more remark. This module is practical only when the
"mandatory" option is set to "no". If it is set to "yes", then this
functionality is better implemented by setting resource domains. I'll
write a module demonstrating this approach as soon as possible.

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

Received on Fri May 06 19:40:13 2005

This archive was generated by hypermail 2.1.8 : Tue Aug 16 2005 - 20:43:21 CEST