How can I get a more even lesson spread from fet

Started by Daniel, August 14, 2012, 05:46:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Daniel

Hey all,

This is my first post here, I have bin using FET for a few month now and I would like to thank every one for the great work you have done FET is truly a great product, thank you.

Background:
I have a script that generates the FET XML file for me including most of the constraints I require, the time table is not very big just under a 1000(968 at this point) activities and it solves with all constraints at 100% in about 12-15 min. we have a not same day constraint setup with min days = 1 for every activity group so that we get an even spread of the activities across the week, and that works fine too.

Problem:
The lesson spread is not optimal and it seems that FET likes to place the same lesson groups (activities with same subject/group) in the same area on the time table, even if there is no problem to place it better.

Example:
We have 3 classes doing math but one class is getting all lessons(5 in total) in the morning other 2 are all later in the day, since in our school the lessons later in the day are a bit shorter, and the kids are less focused we would like for every class to get some lesson in the morning and some later in the day is there a way to convey this to the solver ?

Liviu Lalescu

Please use Constraint subactivities preferred time slots or starting times. Constrain 2 component math lessons (say components 1 and 2) in the morning and 2 (say 4 and 5) in the evening, for example.

Please let me know.

Daniel

Thanks, I had a look at the constraint you suggested and I have a questions

given this XML structure, will I need to add a ConstraintSubactivitiesPreferredStartingTimes for every activity ? or can I setup a global constraint per subject or tag ?

<Activity>
<Teacher>T21</Teacher>
<Subject>S5</Subject>
<Students>G598</Students>
<Students>G264</Students>
<Students>G399</Students>
<Duration>1</Duration>
<Total_Duration>4</Total_Duration>
<Id>2401</Id>
<Activity_Group_Id>804</Activity_Group_Id>
<Active>true</Active>
<Comments></Comments>
</Activity>
<Activity>
<Teacher>T2079</Teacher>
<Subject>S5</Subject>
<Students>G598</Students>
<Students>G264</Students>
<Students>G399</Students>
<Duration>1</Duration>
<Total_Duration>4</Total_Duration>
<Id>2402</Id>
<Activity_Group_Id>804</Activity_Group_Id>
<Active>true</Active>
<Comments></Comments>
</Activity>

.
.
.
.
.

<ConstraintSubactivitiesPreferredStartingTimes>
<Weight_Percentage>100</Weight_Percentage>
<Component_Number>2401</Component_Number>
<Teacher_Name></Teacher_Name>
<Students_Name></Students_Name>
<Subject_Name>S5</Subject_Name>
<Activity_Tag_Name></Activity_Tag_Name>
<Number_of_Preferred_Starting_Times>24</Number_of_Preferred_Starting_Times>
<Preferred_Starting_Time>
<Preferred_Starting_Day>Monday</Preferred_Starting_Day>
<Preferred_Starting_Hour>08:00</Preferred_Starting_Hour>
</Preferred_Starting_Time>
.
.
.
.
.
.

Liviu Lalescu

ConstraintActivityPreferred... -> is for a single (sub)activity, a single id.

ConstraintActivitiesPreferred... -> is for more (sub)activities. Specify a subject (or teacher, or students set, or activity tag, or a combination), and all (sub)activities from this activity group id (agid) will be affected.

ConstraintSubactivitiesPreferred... -> is for more subactivities. Like ConstraintActivitiesPreferred, but you specify a component number.

Difference between ActivitiesPreferred and SubactivitiesPreferred: for the latter you add an index, and only that component will be affected. For instance, activity split into 4 and you want to affect only 2nd component.

Daniel

The component number is what i m not getting, what I would like to say is, Set every 1'st, 2'nd activity of a subject to have a 90% priority to be placed in the morning. but it seem the component number must be a valid activity id ?

so I will need to setup this constraint for every activity in my file ?

Liviu Lalescu

#5
In your code, there is an error which I didn't see before: instead of "<Component_Number>2401</Component_Number>" make that number 1, then another constraint with 2.

Similarly to the attached file.

You should have pushed the Help button for this constraint.

Daniel

Hey, this is a modified file, i replaced the activities id's with 1 -> 100, 2 -> 200 and so on,

I update one constraint to have Component_Number = 100, and left one as 2, FET reports an error when trying to solve this constraint.

From what it looks like I will need to make a constraint like this for every activity, or at least every one i want to constraint.

Am I missing something ?

Liviu Lalescu

#7
Use my example, please! The affected activities are ids 1 and 2. If you add another activity split into 5, with ids 6, 7, 8, 9, and 10, the constraints will affect also ids 6 and 7. Is it clear now?

Component number = the activity count in the component.

The ids of activities in a component must be kept i, i+1, i+2, ..., i+j, unlike 100, 200, ..., 500.

Daniel

Yes I think I got it now :)

My issue then is with my activity id's, right now I'm just using the auto id's from the database, will have to make a plan to generate the lesson id's in sequence and map back to the database id's later.

Thanks for your help.

Liviu Lalescu

Activity Id-s must be in consecutive order, and the first Id should be the activity group id-s (AGid) for all in the same component.

Like: Id: 1, 2, 3, 4, 5 (AGid for all of them 1), then Id: 6, 7, 8, 9, 10 (AGid for all of them 6).

Daniel

Hey,

here is a sample file from our school with sequential activity id's. I would really appreciate it if you gave the file a look just to confirm our format is proper. The file loads and runs in FET.

Thanks,

Daniel


Liviu Lalescu

#12
Seems correct now.

PS: Please see http://lalescu.ro/liviu/fet/screenshots/english-1/005-06-activities.png.html . This is a screen shot of the activities dialog, and you can see a correct indentation of the activities. Your file should be similar (the representative activity, with id=agid, is near the left margin, and the other components are indented with 3 spaces).

Liviu Lalescu

Your file is interesting, could I include it into official FET examples? No privacy problems? (please double check this).

But maybe you could give me the final/complete file(s) instead.

Daniel

The file is not working atm, not solving but I should get it to work today, or else :)

I will upload the final version soon as I have it, there should be no privacy issue as all the data is just random auto generated id's really