Re: [tablix-list] New module 'consecutive'

From: Nicholas Robinson <>
Date: Thu Jun 02 2005 - 22:19:20 CEST


Thanks for the feedback. I'd spotted both the problems but not worked out
solutions! I'll download and have a look.

I've got a near complete config file for our timetable that I'm trying out.
Although the algorithm reports a lower GPM, it seems to converge faster than

I've attached a copy of the config file in case you want to try it out. Give
or take the odd missing lesson, the only significant omission is that teacher
JL only works on Thursday and Friday.

My 'mandatory' modules ought to be sametime, timeplace, consecutive and
forcesametime. If these all return fitness=0 (or forcesametime near to zero)
then I've got a working timetable.

Should I be thinking of increasing the weight for preferred above sametime and
timeplace and manually scheduling the 'hard' subjects? Is this likely to
improve the chances of a solution?

'same-time-as' works fine for the core subjects that are scheduled together
within a year (i.e. English and Maths for classes Ia and Ib) but I'm still
not convinced about my solution for CDT for classes "I and II". I can
schedule them using 'same-time-as' if I invent teachers.

With Games, I have more teachers than classes and this is causing problems.
Presumably, I can invent classes and use 'same-time-as' again but it seems
clumsy. I can see a way to write a much simpler (I think!) more-teachers
module but I don't know if it is the best approach. What do you think?

Best wishes

On Thursday 02 June 2005 20:48, Tomaz Solc wrote:
> Hash: SHA1
> Hi
> > It offers a single restriction at event level called 'consecutive'.
> > If repeats=1 then the module has no effect, but if repeats>1 then all
> > instances of the event are scheduled to run consecutively. I've tried
> > it as far as repeats=5 and it seems to work okay.
> I had a look at this module and it seems to be working fine. I see a
> potential problem though. Consider this case:
> <event name="Games" repeats="1">
> <resource type="teacher" name="SAH"/>
> <resource type="class" name="1A"/>
> </event>
> <event name="Games" repeats="4">
> <restriction type="consecutive"/>
> <resource type="teacher" name="NPR"/>
> <resource type="class" name="1B"/>
> </event>
> Your module will think that the first event also needs to be placed in
> the same row as the last 4 because it has the same name. I've fixed this
> by making another check in the getevent() function.
> Also it would be better if your module would not try to enforce the
> exact order of events. I think module_fitness() will return zero only if
> events are ordered by tupleid. It won't return zero if they are
> consecutive, but in the wrong order. This makes it harder for the
> algorithm to find a solution.
> You can get the modified version from the CVS.
> Best regards
> Tomaz Solc
> Version: GnuPG v1.4.1 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird -
> iD8DBQFCn2KQsAlAlRhL9q8RAloWAJ9lP8JRezptQLkS2WH9Ukg51910FQCgyOk4
> sYo9ZRRQn318PPVlgTvP2BE=
> =woau

Fight Prejudice - Fight the Ban (see

Received on Thu Jun 02 22:19:44 2005

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