Re: [tablix-list] Freelesson module

From: Tomaz Solc <>
Date: Sun Jun 05 2005 - 17:34:32 CEST

Hash: SHA1


> <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
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird -

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