Re: [tablix-list] Tablix 0.2.1 development release

From: Tomaž Šolc <tomaz.solcREMOVE@THISsiol.net>
Date: Thu May 05 2005 - 09:38:45 CEST

Hi

> On 0.2.0, the attached preferred.c finds the 'preferred-day' and
> 'preferred-period' restrictions and builds the arrays pday and pperiod
> correctly using the handler functions 'getday' and 'getperiod'.
> Unfortunately, the module_fitness function hangs after a couple of
> iterations.

I didn't find any errors that could cause the module_fitness to hang. I
have some other comments on your code though:

        //TODO find out if this is essential
        // precalc_new(module_precalc);

If you don't need a function to be called after all restriction
handlers, then you don't need to register one. It's OK not to call
precalc_new().

        if(fitness_request_chromo(fitness, "room")) return -1;
        if(fitness_request_chromo(fitness, "time")) return -1;
        if(fitness_request_chromo(fitness, "class")) return -1;
        fitness_request_slist(fitness, "time");

You are requesting more data than you need. This slows down your module.

        sscanf(time->restype->res[b].name, "%d %d", &d, &t);

You could do the same thing a lot faster by calling:

        d=b/periods;
        t=b%periods;

Also, you don't need this loop:

        for(n=0;n<list->tuplenum[a];n++)
        {
                ...
        }
                        
The first for loop already iterates through all events (time->gennum is
equal to tuplenum, number of tuples).

> On 0.2.1, the same code now seems to work okay in 'module_fitness' -
> debug
> shows lots of day/period combinations for 'time->restype->res[b].name'.
> Sadly, the handlers no longer seem to get called. I've tried all the
> sensible
> ways of putting the restriction in the xml.

I can't check this right now. It sounds like a bug in the new parser. I
will get back to you,

Best regards
Tomaz Solc
Received on Thu May 05 09:33:04 2005

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