Re: [tablix-list] Freelesson module

From: Tomaz Solc <tomaz.solcREMOVE@THISsiol.net>
Date: Sun Jun 05 2005 - 17:34:32 CEST

-----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-----
Received on Sun Jun 05 17:29:51 2005

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