Hi Tomaz
Thanks very much for the info and comments. I'm delighted there was only one
error!
There are a few permission errors when downloading from the BRANCH_0_2_0 of
CVS. They seem to be mainly example and documentation files so don't affect
anything to do with the build.
I've tested preferred.c with the latest CVS and it seems fine.
Attached is the finished version...
Regards
Nick
On Friday 06 May 2005 18:47, Tomaz Solc wrote:
> int module_fitness(chromo **c, ext **e, slist **s)
> {
> int a,m;
> int n;
> int u;
> int sum;
> slist *list;
> chromo *time;
>
> list=s[0];
> time=c[1];
>
> sum=0;
>
> // time->gennum is the number of defined tuples. This loop
> // iterates through all tuple IDs
> for(m=0;m<time->gennum;m++)
> {
> // a holds the resource ID of the time slot of the
> // tuple with ID m
> a=time->gen[m];
>
> for(n=0;n<list->tuplenum[a];n++)
> {
> int b;
> // b holds the tuple ID of the nth tuple that is
> // using time slot a
> b=list->tupleid[a][n];
>
> // ADDED THIS
> // u holds the resource ID of the time slot
> // that tuple with ID b is using
> // (same as a)
> u=time->gen[b];
>
> 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(pday[b]>-1)
> {
> if(d!=pday[b]) sum++;
> }
> if(pperiod[b]>-1)
> {
> if(t!=pperiod[b]) sum++;
> }
> }
> }
>
> return(sum);
> }
-- Fight Prejudice - Fight the Ban (see www.countrysidealliance.org)
This archive was generated by hypermail 2.1.8 : Tue Aug 16 2005 - 20:43:23 CEST