Re: [tablix-list] Re: some module contributions

From: Richard Taylor <rtaylorREMOVE@THISouc.bc.ca>
Date: Fri Nov 26 2004 - 22:50:11 CET

Hi Tomaz,

Thanks for looking at the modules, and for your helpful comments.

I had thought of the changes you've made, and now I see how they would
make subject_sameroom.so behave better with the genetic algorithm. But
with your changes, a room sequence A,B,B gets the same score as the
sequence A,B,C (which should score higher). Also A,B,B scores worse
than A,B,A but they should really have the same score.

Scoring all these scenarios properly would require rewriting the module.
For now, if your change speeds up the solution while giving good
results, that's good enough for me. Regards,

Richard

Tomaz Solc <tomaz.solc@siol.net> wrote:

> For example in "subject_sameroom.so": the sum of errors does not
> depend on the number of different rooms that are used by a subject.
> It is either "0" when all tuples are scheduled in the same room or
> "1" if there is one or more tuples scheduled in different rooms...
>
> A simple change that fixes this (diff attached below) improves time
> needed to solve my test case for "subject_sameroom.so" from 36s to 6s.

> - --- ../patches/mymodules/subject_sameroom.c 2004-11-24
> 04:55:43.000000000 +0100
> +++ subject_sameroom.c 2004-11-26 17:57:54.000000000 +0100
> @@ -48,7 +48,7 @@
> ~ for (a=0;a<nsu;a++) {
> ~ if (sid==su[a]) {
> ~ flag=0;
> - - if (rid != rm[a]) multiroom[a]=1;
> + if (rid != rm[a]) multiroom[a]++;
> ~ break;
> ~ }
> ~ }
> @@ -65,7 +65,7 @@
> ~ // count number of multiroom subjects
> ~ sum=0;
> ~ for (a=0;a<nsu;a++) {
> - - if (multiroom[a]) sum++;
> + sum+=multiroom[a];
> ~ }
>
> ~ return(sum);
Received on Fri Nov 26 22:56:28 2004

This archive was generated by hypermail 2.1.8 : Tue Aug 16 2005 - 20:42:28 CEST