FET Forum

FET Support (English) => General Stuff => Topic started by: Bob Hairgrove on August 13, 2016, 11:52:57 PM

Title: Question about negative weights in constraints -- is it possible?
Post by: Bob Hairgrove on August 13, 2016, 11:52:57 PM
I have a very simple timetable -- I teach individual piano lessons at a school and need to use the free hours available when students are not attending other courses. So I set each student as a "year" with one "student". For each student, I set the available hours by setting up a constraint "student not available hours". I then assign each student an activity: teacher (me), subject (piano).

If I want to specify preferred lesson times, I use the constraint "activity has a preferred starting time" with appropriate weight (100% if i want to guarantee a certain time, otherwise maybe less). But how do I do a "negative weight", i.e. an activity might occur at a specified time, but preferably not? Right now I am limited to setting an undesirable time as "student not available", but those constraints are always 100%. Can I just set the weight of "activity has preferred starting time" to a very low value?
Title: Re: Question about negative weights in constraints -- is it possible?
Post by: Liviu Lalescu on August 14, 2016, 07:06:03 AM
If you want a teacher/student to work at a specified interval, you can use a constraint activities occupy max time slots from selection (see the Help there).

Negative weight is not possible.

If you want an activity not preferred time slots - just add preferred slots the other slots :)  The strongest constraint in each time slot for each activity will win.
Title: Re: Question about negative weights in constraints -- is it possible?
Post by: Bob Hairgrove on August 15, 2016, 07:26:45 PM
Quote from: Liviu Lalescu on August 14, 2016, 07:06:03 AM
If you want an activity not preferred time slots - just add preferred slots the other slots :)  The strongest constraint in each time slot for each activity will win.

There is only one activity for each student in the finished timetable (one piano lesson per week; I am the only teacher, at least in the FET environment, because it is my personal working schedule). Assuming that only four free hours are available for a certain student, I would like to prioritize these according to student choice (1st, 2nd, and perhaps the other two as last choice, only if one of the other hours is not available).

That would appear to mean entering multiple constraints for the same activity with different weights. Is that right? Is it possible?
Title: Re: Question about negative weights in constraints -- is it possible?
Post by: Liviu Lalescu on August 15, 2016, 07:40:51 PM
Activity(ies) preferred starting times (time slots) consider for each slot the maximum value of denial of all constraints of this type.

For instance, in the attached file, 100% denied for all slots but the first four. 90% denied for Wed and Thu first hour, and 80% denied for Tue first hour.

I hope I am not mistaking at some point.
Title: Re: Question about negative weights in constraints -- is it possible?
Post by: Bob Hairgrove on August 15, 2016, 09:55:35 PM
Quote from: Liviu Lalescu on August 15, 2016, 07:40:51 PM
Activity(ies) preferred starting times (time slots) consider for each slot the maximum value of denial of all constraints of this type.

For instance, in the attached file, 100% denied for all slots but the first four. 90% denied for Wed and Thu first hour, and 80% denied for Tue first hour.

I hope I am not mistaking at some point.
Thank you! I shall look into the file tomorrow.
Title: Re: Question about negative weights in constraints -- is it possible?
Post by: Bob Hairgrove on August 16, 2016, 07:57:08 AM
Very nice ... "Activities have a set of preferred starting times", I had missed that one.

One more question: I noticed that you did not define any "Student set not available" times. In the "Activity has a set of preferred starting times", you set four slots preferred. However, shouldn't it be necessary to also define "not available" for the other times?

Thanks!