Re: [tablix-list] Tablix 0.2.1 development release

From: Nicholas Robinson <nprREMOVE@THISbottlehall.co.uk>
Date: Thu May 05 2005 - 18:50:58 CEST

Hi Tomaz

Many thanks for the help, I'll make the changes later tonight.

Regards

Nick

On Thursday 05 May 2005 08:38, Tomaž Šolc wrote:
> 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

-- 
Fight Prejudice - Fight the Ban (see www.countrysidealliance.org)
Received on Thu May 05 18:47:04 2005

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