FET Forum

FET Support (English) => Get Help => Topic started by: Christian Kemmer on August 01, 2011, 12:15:10 PM

Title: Teacher in certain hours of a day
Post by: Christian Kemmer on August 01, 2011, 12:15:10 PM
Hello,

I have one teacher who has to teach in certain hours of day.

At the moment, I only see the possibility to manually choose and place one of his activities in each of those hours. Is there a better way, e.g., can I tell FET to assign this teacher's activities to certain hours?
Title: Re: Teacher in certain hours of a day
Post by: Liviu Lalescu on August 01, 2011, 01:04:34 PM
Why don't you use constraint teacher not available? (only 100% weight possible for this one, though). Alternatively, constraint activities preferred time slots, with only the teacher selected, allows a weight lower than 100%.
Title: Re: Teacher in certain hours of a day
Post by: Christian Kemmer on August 08, 2011, 08:00:19 AM
Take the following example:

The Teacher has to work on Monday in the first and in the seventh hour, also on Tuesday in the first and in the sixth hour. All other activities of this teacher may be placed as FET does. So I don't care about a special activity for that teacher and I cannot use "teacher not available", because FET has to respect only that this teacher works in four certainĀ  hours, all other activities of this teacher may be placed in any other hour.
Title: Re: Teacher in certain hours of a day
Post by: Volker Dirr on August 08, 2011, 09:09:31 AM
I can't see a problem.
Place the 4 activities manualy.
Then add a max gaps constraint. FET will now place other activities between the 4 activities (of course depending on the value of the "max gaps" constraint).
Title: Re: Teacher in certain hours of a day
Post by: Christian Kemmer on August 08, 2011, 12:07:39 PM
I could do that, if I knew which activities to place.

But I only know that the teacher has to be in an activity, it doesn't matter, which activity this is. I only care that he has one (any of his) activities.

Background: The teacher has to prove to some government agency that he cannot be at home at certain times, because he has to work.
Title: Re: Teacher in certain hours of a day
Post by: Liviu Lalescu on August 08, 2011, 12:43:03 PM
QuoteI could do that, if I knew which activities to place.

But I only know that the teacher has to be in an activity, it doesn't matter, which activity this is. I only care that he has one (any of his) activities.

Background: The teacher has to prove to some government agency that he cannot be at home at certain times, because he has to work.

This cannot be done directly in current FET. We need this new constraint: in a set of time slots, there can be placed maximum x number of activities from a specified set of activities (it is the negative of what you need). I'll add this in the TODO, but don't know if and when I'll do it.

You may try to use some tricks, but it is clear that FET lacks something here.

Maybe you could use min gaps between activities.
Title: Re: Teacher in certain hours of a day
Post by: Davide G. M. Salvetti on September 05, 2011, 07:03:27 PM
Quote
QuoteI could do that, if I knew which activities to place.

But I only know that the teacher has to be in an activity, it doesn't matter, which activity this is. I only care that he has one (any of his) activities.

Background: The teacher has to prove to some government agency that he cannot be at home at certain times, because he has to work.

This cannot be done directly in current FET. We need this new constraint: in a set of time slots, there can be placed maximum x number of activities from a specified set of activities (it is the negative of what you need). I'll add this in the TODO, but don't know if and when I'll do it.

You may try to use some tricks, but it is clear that FET lacks something here.

Maybe you could use min gaps between activities.

I'm also interested in the original request (background: vice-headmaster, an otherwise normal teacher, has to be at school teaching no matter what in certain hours, most notably at the beginning of the day, to be able to possibly deal with pupils headmaster matters when the headmaster is not there, if need arises).

How could we make use of min gaps between activities to set this constraint?
Title: Re: Teacher in certain hours of a day
Post by: Volker Dirr on September 05, 2011, 07:13:13 PM
Quote
I'm also interested in the original request (background: vice-headmaster, an otherwise normal teacher, has to be at school teaching no matter what in certain hours, most notably at the beginning of the day, to be able to possibly deal with pupils headmaster matters when the headmaster is not there, if need arises).

How could we make use of min gaps between activities to set this constraint?

Maybe i missunderstood your request, but i think min gaps between doesn't help in your situation.

If i understood correct, then you need a "begins early" constraint for teachers.
You can maybe do that by a trick: add befor your first hour an hour and place an pseudoactivity into that hour. so with low gap constraints, you will be early.
Title: Re: Teacher in certain hours of a day
Post by: Liviu Lalescu on September 05, 2011, 07:20:23 PM
Quote
I'm also interested in the original request (background: vice-headmaster, an otherwise normal teacher, has to be at school teaching no matter what in certain hours, most notably at the beginning of the day, to be able to possibly deal with pupils headmaster matters when the headmaster is not there, if need arises).

OK, I took note of your request. I still believe that my formulation "We need this new constraint: in a set of time slots, there can be placed maximum x number of activities from a specified set of activities (it is the negative of what you need)." is the most general.

But:

1) I cannot think of a decent FET style name for such a constraint; please let us know your proposals.

2) I cannot promise I'll do it (soon).

By the way, Davide G. M. Salvetti, this would apply also to your first request: http://lalescu.ro/liviu/fet/forum/index.php?topic=413.0 , because we add n_days_per_week such constraints for each day j, with all activities of the teacher, and two slots: first and last hour of day j, allowed to occupy only one slot. (am I right?)

Quote
How could we make use of min gaps between activities to set this constraint?

This was my suggestion to make the teacher have activities in the first and last hours. But it is quite a poor suggestion.
Title: Re: Teacher in certain hours of a day
Post by: Davide G. M. Salvetti on September 05, 2011, 10:00:26 PM
Quote
OK, I took note of your request. I still believe that my formulation "We need this new constraint: in a set of time slots, there can be placed maximum x number of activities from a specified set of activities (it is the negative of what you need)." is the most general.

But:

1) I cannot think of a decent FET style name for such a constraint; please let us know your proposals.
Maybe it's not the best, but this is what I can think of:

Time -> Activities -> Max number of activities from a set allowed in a set of time slots

Quote
2) I cannot promise I'll do it (soon).

By the way, Davide G. M. Salvetti, this would apply also to your first request: http://lalescu.ro/liviu/fet/forum/index.php?topic=413.0 , because we add n_days_per_week such constraints for each day j, with all activities of the teacher, and two slots: first and last hour of day j, allowed to occupy only one slot. (am I right?)
Yes, I think you are right, that would do.
Title: Re: Teacher in certain hours of a day
Post by: Liviu Lalescu on September 07, 2011, 12:40:08 PM
I added a resume of this topic in the TODO file.
Title: Re: Teacher in certain hours of a day
Post by: Liviu Lalescu on September 08, 2011, 11:53:13 AM
See also http://lalescu.ro/liviu/fet/forum/index.php?topic=412.0
Title: Re: Teacher in certain hours of a day
Post by: Liviu Lalescu on September 14, 2011, 08:40:05 AM
I want to add the constraint "Time -> Activities -> Max number of activities from a set allowed in a set of time slots" or something like that. In fact, "Max number of time slots from a set occupied by a set of activities", or I'll try to find a better formulation. Please help with a better formulation - ideas.

Let me know if anybody needs it. And if anybody will help with testing.
Title: Re: Teacher in certain hours of a day
Post by: Corfiot on September 14, 2011, 02:45:16 PM
QuoteI want to add the constraint "Time -> Activities -> Max number of activities from a set allowed in a set of time slots" or something like that. In fact, "Max number of time slots from a set occupied by a set of activities", or I'll try to find a better formulation. Please help with a better formulation - ideas.

Let me know if anybody needs it. And if anybody will help with testing.

"A max number of activities fill a set of time slots"
"Time slots contain max number of some activities"
??
Title: Re: Teacher in certain hours of a day
Post by: lalloso on September 14, 2011, 04:41:19 PM
This could be useful but not often, at leat in my mind.

I think "max hours per day with a teacher" could be more useful.
Title: Re: Teacher in certain hours of a day
Post by: Liviu Lalescu on September 14, 2011, 04:44:35 PM
QuoteThis could be useful but not often, at leat in my mind.

There were some users asking this.

Quote
I think "max hours per day with a teacher" could be more useful.

This is available: students activity tag max hours daily (yes, you need to work a bit to use it, you have to add a lot of tags, but conceptually it is there).
Title: Re: Teacher in certain hours of a day
Post by: Liviu Lalescu on September 14, 2011, 10:02:54 PM
What about:
     ConstraintActivitiesOccupyMaxTimeSlots
or
     ConstraintActivitiesOccupyMaxTimeSlotsFromSelection
?
Title: Re: Teacher in certain hours of a day
Post by: Liviu Lalescu on September 27, 2011, 12:34:38 PM
OK, new constraint added in the latest snapshot and probably in the future FET versions. Please see Snapshots section here on forum, test and report results.

New constraint is: activities occupy max time slots from selection. Can be made to force a teacher to have activities in certain time slots.

Thank you for your suggestions!