Re: [tablix-list] subjects-sameday.c tablix2 port

From: Antonio Duran <adminies.elbrocenseREMOVE@THISedu.juntaextremadura.net>
Date: Fri Oct 21 2005 - 09:54:22 CEST

Hi. I saw what you tell me yesterday, when i was looking at
consecutive.c.

I have been trying to get the cvs version, but couldn't do it.

$ cvs -d :pserver:anonymous@cvs.tablix.org:/cvs checkout tablix

Gets the 0.1 branch.
Using tablix2 instead of tablix returns module not found.

Can anybody please tell me what am i doing wrong?

More things: yesterday i was playing with my timetables, and i saw that
i was getting a lot of thinsg like this: i need a subject with four
events to be teached in 2 separate days, two consecutive hours each day.
So i end up with something like this:

  <event name="FOTD" repeats="2">
                        <resource type="teacher" name="SMD"/>
                        <resource type="class" name="1 Lab Imagen"/>
                        <restriction
type="capability">6041</restriction>
                        <restriction type="consecutive"/>
                </event>
                <event name="FOTD2" repeats="2">
                        <resource type="teacher" name="SMD"/>
                        <resource type="class" name="1 Lab Imagen"/>
                        <restriction
type="capability">6041</restriction>
                        <restriction type="consecutive"/>
                        <restriction
type="not-same-day-as">FOTD</restriction>

Looking at consecutive.c module i see that in this case, each tuple has
to go in its place. Lets say these are the only tuples with id1 0,1,2,3.
Tuple 1 has to go after tuple 0 and tuple 3 has to go after tuple 2.
In my problem it would be OK if it was like 1,0 and 3,2, for example. Or
even 3,0 and 2,1 or something.

So i was thinking about trying to do just that, with a restriction that
would look like:

<restriction type="timeblock">6 2</restriction>

The first argument is the "repeats" number, so the handler has knowledge
of it. The second one is the number of hours in each block.

For each tuple, the module would know all the other possible adjacent
tuples.

The module fitness function then would test if any two blocks of the
list are adjacent to rate the solution.

As i have subjects with 8 hours divided in 4 blocks, maybe this could
make an improvement. However i am not sure, because as i see in the
consecutive module, it does not check to see if events are just in
reverse order (which in theory would increase perfomance, but i saw in
0.1 double_period module that it dind't make much difference).

Of course, this would need a rewrite of sameday.c, and maybe it is just
too "different" to fit with existing modules.
So i was thinking about getting your thoughs about this before going
with it.
Thanks.

Regards,
Antonio.

El jue, 20-10-2005 a las 19:20 +0200, Tomaz Solc escribió:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi
>
> > I have been looking at the new kernel (the docs are great!)
>
> I'm happy to hear that.
>
> > i have ported one of my old modules just to give it a try.
>
> Thanks for your module. I've added it to the CVS repository under the
> name "events_sameday.c".
>
> I've removed a lot of unnecessary loops from the fitness function and
> I've cleaned up the initialization function a bit.
>
> You only need to check events that are stored in the sameday struct -
> you already have their tuple IDs stored in there. To find out on which
> day two events are scheduled, you take the "time" chromosome and lookup
> the resource ID by their tuple IDs. Divide the resource IDs of the
> "time" resources two events are using by the number of periods in each
> day and you have the day numbers.
>
> This way you only need the simple chromosome structure, not the
> expensive extension. Also your module as far as I see doesn't need to
> know anything about classes.
>
> Best regards
> Tomaz Solc
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
>
> iD8DBQFDV9HKsAlAlRhL9q8RAldBAJ9Q1wNjNmsNOUF9R/MqG+YCA/7siQCg4LG0
> MBNTYuOXArP0A1lMyPr1TWw=
> =zN7O
> -----END PGP SIGNATURE-----
>
Received on Fri Oct 21 09:57:39 2005

This archive was generated by hypermail 2.1.8 : Sat Oct 22 2005 - 06:28:44 CEST