> 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
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
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
if(fitness_request_chromo(fitness, "room")) return -1;
if(fitness_request_chromo(fitness, "time")) return -1;
if(fitness_request_chromo(fitness, "class")) return -1;
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:
Also, you don't need this loop:
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' -
> 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
> 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,
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