Re: [tablix-list] new module & some questions

From: Tomaz Solc <tomaz.solcREMOVE@THISsiol.net>
Date: Thu May 26 2005 - 18:11:16 CEST

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

> First let me say Tablix rocks :)

I'm glad to hear that.

> So, would you please take a look a it an tell me? I don't fully
> understand the tablix structures yet, so i don't know if this is the
> fastest way to do this, either.

Your tuple restriction "not-same-time" affects all tuples with the same
subject, not just the tuple with this restriction. It would be better if
you would make this a subject restriction - tuple restrictions are
expected to affect only tuples they are used on.

Also I believe your example in the module documentation should look like
this:

<timetable>
<subject title="MATH_LAB" teacher="Cronin" perweek="1">
        <restriction type="not-same-day">MATH_FIRST Cronin</restriction>
</subject>
</timetable>

At the moment I don't see how you could make your grade function faster.

> Well, i have started writing another module to prevent one teacher from
> being scheduled at the last period of a day and the fisrt of the next. I
> thought it was really simple (in fact it must be :) but i can't get it
> working. Here's a snippet with comments on what i try to do:
>
> pnt=tpnt;
> for(tid=0;tid<tmapnum;tid++) { // for each teacher
> for(day=0;day<DAYS - 1;day++) { // For each day, but the last one
> pnt += (PERIODS - 1); // Go to the last period of the day
> if (*pnt!=-1) { // the teacher has a lesson assigned in this period
> pnt++; // Go to the first period of the next day
> if (*pnt!=-1) //the teacher has lesson assigned
> sum++;
> } else pnt++; // Go to the first period of the next day
> }
> }
>
> I am doing something wrong, i guess the tpnt array is not aligned as i
> think or something. Could you help please?

pnt pointer isn't pointing to the first period of the first day for the
second teacher after the inner loop is finished. It is pointing to the
first period of the last day for the first teacher. You should add
"pnt+=PERIODS" after the inner loop.

Best regards
Tomaz Solc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFClfUksAlAlRhL9q8RAkzAAKDVhj5YFWuF6JZ9zg7R2RtLsz87uQCg3uwv
Ec6CMFhf7hTTWV+f08TNhgE=
=sPul
-----END PGP SIGNATURE-----
Received on Thu May 26 18:00:53 2005

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