Re: [tablix-list] Freelesson module

From: Nicholas Robinson <nprREMOVE@THISbottlehall.co.uk>
Date: Sun Jun 05 2005 - 19:04:20 CEST

Hi

Thanks for this, it sounds a great way to tackle it.

I've had a stab at it. The module options are passed to the init function okay
and I can get at the options easily. Unfortunately, the opt param to the
precalc function is being passed as NULL. I've had a quick look in modsup.c
and (I think) I have confirmed this. I can't see an easy way of passing it
the opt param within modsup or xmlsup. For the time being, I've created a
module global to store it.

Best Wishes

Nick

On Sunday 05 June 2005 16:34, Tomaz Solc wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi
>
> > <resourcetype type="time">
> > <matrix width="5" height="9"/>
> > <restriction type="free-lesson">4 1</restriction>
> > </resourcetype>
> >
> > The parser isn't being called - if I don't load the module then the
> > parser doesn't complain about the restriction being unknown. If I change
> > the line:
>
> This isn't working because the restriction tag isn't placed within any
> of the tags that define a resource with resource type "time".
>
> You can't place any restriction tags under <resourcetype> tag (parser
> doesn't know to which resource you want to apply your restriction).
>
> > My intention with this restriction is to create an irregularly-shaped
> > timetable. We have a whole school assembly first lesson on Friday and a
> > variable timetable on Wednesday afternoons, again for the whole school.
>
> You can try the following: Somehow obtain a list of periods that must
> remain free (For example by using module options). Then in the
> precalculate function of your module remove the resources for those
> periods from the domains of all tuples for the resource type "time" (see
> the module HOWTO for information about domains).
>
> This method is very efficient and you also don't need to write a fitness
> function for your module.
>
> Best regards
> Tomaz Solc
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
>
> iD8DBQFCoxuHsAlAlRhL9q8RAgU3AJ0c04KZvHLTSbX+VCV8fX+3Fi1w8gCfXFnF
> 4AlkblZzXxVo40wpK4gg2Gs=
> =2ncG
> -----END PGP SIGNATURE-----

-- 
Fight Prejudice - Fight the Ban (see www.countrysidealliance.org)
Received on Sun Jun 05 19:04:18 2005

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