FET Forum

FET Support (English) => Get Help => Topic started by: Daniel on August 14, 2012, 05:46:41 PM

Title: How can I get a more even lesson spread from fet
Post by: Daniel on August 14, 2012, 05:46:41 PM
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 ?
Title: Re: How can I get a more even lesson spread from fet
Post by: Liviu Lalescu on August 14, 2012, 05:53:25 PM
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.
Title: Re: How can I get a more even lesson spread from fet
Post by: Daniel on August 15, 2012, 08:49:37 AM
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>
.
.
.
.
.
.
Title: Re: How can I get a more even lesson spread from fet
Post by: Liviu Lalescu on August 15, 2012, 08:57:30 AM
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.
Title: Re: How can I get a more even lesson spread from fet
Post by: Daniel on August 15, 2012, 09:11:54 AM
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 ?
Title: Re: How can I get a more even lesson spread from fet
Post by: Liviu Lalescu on August 15, 2012, 09:53:02 AM
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.
Title: Re: How can I get a more even lesson spread from fet
Post by: Daniel on August 15, 2012, 12:36:09 PM
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 ?
Title: Re: How can I get a more even lesson spread from fet
Post by: Liviu Lalescu on August 15, 2012, 12:42:19 PM
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.
Title: Re: How can I get a more even lesson spread from fet
Post by: Daniel on August 15, 2012, 04:44:35 PM
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.
Title: Re: How can I get a more even lesson spread from fet
Post by: Liviu Lalescu on August 15, 2012, 04:50:34 PM
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).
Title: Re: How can I get a more even lesson spread from fet
Post by: Daniel on August 17, 2012, 09:34:06 AM
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
Title: Re: How can I get a more even lesson spread from fet
Post by: Daniel on August 17, 2012, 09:43:19 AM
Opps :) sorry
Title: Re: How can I get a more even lesson spread from fet
Post by: Liviu Lalescu on August 17, 2012, 09:53:34 AM
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).
Title: Re: How can I get a more even lesson spread from fet
Post by: Liviu Lalescu on August 17, 2012, 10:47:43 AM
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.
Title: Re: How can I get a more even lesson spread from fet
Post by: Daniel on August 17, 2012, 11:00:53 AM
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
Title: Re: How can I get a more even lesson spread from fet
Post by: Daniel on August 17, 2012, 11:32:26 AM
I have quick question, do you think the order of the activities effects the way it is being solved ?

So if say I export like forms 5, 4, 3... first, atm the order is form 1,2,3... and so activities from this forms are placed better (in the morning) the the later forms 4, 5 who get more lessons in the afternoon
Title: Re: How can I get a more even lesson spread from fet
Post by: Liviu Lalescu on August 17, 2012, 11:41:22 AM
No, or in a very very low manner (but not like you say, in a different way). The slots are randomized.

Anyway, if you add all the necessary constraints, FET will conform.
Title: Re: How can I get a more even lesson spread from fet
Post by: Daniel on August 17, 2012, 08:01:32 PM
The file I have uploaded dose solve after about 1h 30 min, how ever the lesson spread is not optimal, so working on some more constraints to try get it optimal and once done I'll upload the new file.