Dolphins schedule

Started by Paul the dolphin, October 09, 2014, 10:06:29 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Paul the dolphin

Hello all,

I am in need of some serious scheduling help. I found this program via a friend of mine but cant make much sense of it. I work with kids, dolphins, therapist and time and its one big mess. Currently we try to plan everything from the head but that's taking too much time. I am trying to figure out wether I can do the scheduling, or better yet generate the schedule automatically via FET.

My assignment: distribute the kids combined with on of 12 therapist over 5 dolphins and 4 timeslot

However
Some kids have limits, like specific therapist and dolphins (one or both)
Some therapist have limits on their day
etc.

I want to know if the program can, when there is no restriction and no preference for time or dolphin or therapist automatically distribute these and put them in a schedule? And if so, how do I realize that?

thank you for your help

Volker Dirr

Hi Paul,

i need a bit more information:

if i understand correct then you have 4 timeslots per day.

how many dolphins, therapist and stundes can you have max a the same time (in one slot)?

So for example, tell me something about the following points:
a) if one kid wants a therapie, then of course it need one therapist and one dolphin.
b) if one kid wants a therapie, do you need sometimes 2 therapists and/or 2 dolphins?
c) if two kids want a therapie, can they share one dolphin and/or therapist in the same timeslot?
d) is it possible to do two courses at the same time? (so can you have a kid, therapist and dolphin for one course and at the same time an other course with an other kid, therapist and dolphin.)

Paul the dolphin

hey Volker dirr,

Thanks for your interest:

the kids are here for 2 weeks in which they have therapy every weekday. at the beginning of the weekday they become a time, dolphin and therapist. We rever to an individual therapy as as session for example I as a therapist have a session in the 2nd time slot with dolphin x and kid x.

We have 4 time slot and 5 dolphins of which 4 can work at any time.
the table is time(y-axis) and dolphins (x-axis).

Each Kid in the end needs 1 time slot, 1 therapist and 1 dolphin, there is no sharing and this stays the same for the 2 weeks they are here.

Some kids have been her before and have a preference for a therapist and a dolphin.
Some kids cant do any late session or any early session due to medical reasons.

Example of a typical period of 16 kids
4 kids time, dolphin and therapist are set
6 Kids therapist and dolphin are set
4 kids can pick between 2 different therapist and 2 dolphins (however each therapist has 2 dolphins he can work with)
2 kids are open any therapist, dolphin and time will fit

If I register all this info for each kid; time constraints yes/no and what time, therapist constrainst yes/no and who and dolphins yes/no and who, is it possible for the program to spit out a schedule or multiple schedules with solutions were it picked filled in the blanks (all the kids who do not have dolphin,time and therapist set in stone)?






Volker Dirr

#3
Hi Paul,

Maybe the custom FET version will work best:
http://lalescu.ro/liviu/fet/forum/index.php?topic=1633.0
Let's see what Liviu think about.



You need to use some tricks if you want to use the official FET version:

FET -> Data -> Days and hours -> Days: Add 14 days (or 10 days if you don't work Saturday and Sunday)
FET -> Data -> Days and hours -> Hours: Add 4 hours

FET -> Data -> Subject -> course" (or what ever you want)

FET -> Data -> Students -> Years: add the kids names as "year".
FET -> Data -> Activity tags -> add the kids names (once again) as "activity tags".

FET -> Data -> Rooms: add the therapist as "room".
FET -> Data -> Rooms: add the dolphins also as "room"

FET -> Data -> Time constraints -> Students -> a students set is not available: set students available times here

FET -> Data -> Space constraints -> Rooms -> room is not available: set the therapists available times here

FET -> Data -> Activities -> add activities: Now add activities here. You must do it this way:
split the activity into as many parts as you have days. Set weight 100%.
a) add the students name (no teacher and no activity tags). And "add activity".
b) add a second activity. Again same number of days and weight. But this time without students and teachers, but with the activity tag as student.

FET -> Data -> Time constraints  -> activities  -> same starting time (day+hour)  -> add  -> check the "add multiple activities" check-box  -> select the two activities you just generated.

If you already now the therapist:
FET -> Data -> Space constraints -> Students -> home room: add therapist to students.
If you don't know the therapist:
FET -> Data -> Space constraints -> Activities -> occupy max different rooms: add 14 (10) activities of the activities with students name (YEAR!)

If you already now the dolphin:
FET -> Data -> Space constraints -> activity tag -> preferred room: add dolphin to kid (activity tag).
If you don't know the dolphin:
FET -> Data -> Space constraints -> Activities -> occupy max different rooms: add 14 (10) activities of the activities with kid name (activity tag)

repeat this until all data is included.

As LAST step:
FET -> Data -> Time constraints  -> activities  -> max simultaneous: select all activities at one. Select all time slots and set max 2*4=8. add.

now generate the timetabe.

Hmmm... maybe it's easier with the mapr custom version. It's late now. I will think about that tomorrow again. Maybe Liviu will answer earlier.


Volker Dirr

Sorry, small bug in last post. i modified it from:
"FET -> Data -> Time constraints  -> activities  -> max simultaneous: select all activities at one. Select all time slots and set max 4. add."

into

"FET -> Data -> Time constraints  -> activities  -> max simultaneous: select all activities at one. Select all time slots and set max 2*4=8. add."

Paul the dolphin

Hey Volker, I have followed the steps but get the following error :

Simulation impossible! Maybe you can consider lowering the constraints. The partial results were saved in the directory C:\Users\cdtc065\fet-results\timetables\test run-single

Additional information relating impossible to schedule activities:

Please check the constraints related to the activity below, which might be impossible to schedule:

No: 1, Id: 31 (T:, S:Therapy, AT:Merel K, St:)

To give you some more insight; an example of next weeks schedule

Therapyplan -
                                    
         

Dolphin 1           Dolphin 2              Dolphin 3     Dolphin 4     Dolphin 5         Time slot

Pat 1                                           Pat 2               Pat 3              Pat 4               
Therapist 1                                  Therapist 2     Therapist 3    Therapist 4       08:00-10:00
   
Pat 5                 Pat 6                  Pat 7               Pat 8              Pat 9           
Therapist 5    Therapist 6      Therapist 1     Therapist 2    Therapist 4        10:30-12:30
   
                         Pat 10                Pat 11             Pat 12            Pat 13     
                    Therapist 7         Therapist 6     Therapist 2   Therapist 8       13:00-15:00

Pat 14               Pat 15                                                             Pat 16
Therapist 7       Therapist 6                                                      Therapist 8       15:30-17:30   
         
This schedule was made based on the following infromation (tx = timeslot, Dx=dolphin, Px= therapist):
pat 1,   restricted t1, D/P=free
pat 2,   restricted t1 + prefer P3, D=free
pat 3,   restricted t1 or t2 + P3, D=free
pat 4,   restricted t1 + prefer P5, D=free
pat 5,   restricted t2 + prefer P5, D=free
pat 6,   restricted t1 or t2 + P/6/9 (random speech therapist), D=free
pat 7,   restricted t2, D/P=free
pat 8,   restricted t1 or t2 + P/2/3/4/5/7 (random Physical therapist), D=free
pat 9,   restricted t1 or t2 + P/2/3/4/5/7, D=free
pat 10, restricted P7 + D2, tx=free
pat 11, restricted P/6/9/, tx/D=free
pat 12, restricted P2, tx/D=free
pat 13, tx/P/D=Free
pat 14, restricted P7 + t4 + D3
pat 15, restricted p/6/9/, tx/D=free
pat 16, tx/P/D=Free

other rules followed:

Difference between prefer and restricted P; Some kids need a specific therapist, other prefer a therapist but dont "need" it.
Need>prefer

P3 works in t1 and t2
P3 has 1 pat this period
P5 has 1 pat this period
P1/4/7/8 have 2 pats this period
P2/6 have 3 patients this period
P9 is on holiday

Dolphin 1 has off in at least 1 tx
Dolphin 2 has off in at least 1 tx
Dolphin 3 + 4 have off set in t4
Only fill all dolphins in one tx as last resort, a back up dolphin is preferable (not much room for that in this schedule)
however restrictions>back up dolphin

Therapist who have 3 pats (P2/6) preferably don't have both t1 and t4
This varies amongst therapist, havent really gotten to their prefrences yet.

If possible no sessions in t4

Relationship D and P in descending order of preference:
P1 = 2,1,3
P2 = 4,3,2
P3 = 4,2,1
P4 = 5,3,4
P5 = 1,3,4
P6 = 2,1,3
P7 = 1,2,3,4
P8 = 5
P9 = 5

I hope this makes sense, this is what we're dealing with here :)


Volker Dirr

Difficult to help if i haven't got that example file. Maybe sent it to me.

Did you enter your whole dataset or just one dataset so far?
Please check easy dataset first.
So check if it work with one course (dolphin-pat-therapist) correct.
We can check bugs easier if you start and check easy dataset first.

Volker Dirr

hm... i see that i forgot that there is a relationship between P and D. let me think one more time.

Liviu Lalescu

#8
Quote from: Paul the dolphin on October 10, 2014, 09:46:11 PM
To give you some more insight; an example of next weeks schedule

Therapyplan -
                                    
         

Dolphin 1           Dolphin 2              Dolphin 3     Dolphin 4     Dolphin 5         Time slot

Pat 1                                           Pat 2               Pat 3              Pat 4               
Therapist 1                                  Therapist 2     Therapist 3    Therapist 4       08:00-10:00
   
Pat 5                 Pat 6                  Pat 7               Pat 8              Pat 9           
Therapist 5    Therapist 6      Therapist 1     Therapist 2    Therapist 4        10:30-12:30
   
                         Pat 10                Pat 11             Pat 12            Pat 13     
                    Therapist 7         Therapist 6     Therapist 2   Therapist 8       13:00-15:00

Pat 14               Pat 15                                                             Pat 16
Therapist 7       Therapist 6                                                      Therapist 8       15:30-17:30   
         
This schedule was made based on the following infromation (tx = timeslot, Dx=dolphin, Px= therapist):
pat 1,   restricted t1, D/P=free
pat 2,   restricted t1 + prefer P3, D=free
pat 3,   restricted t1 or t2 + P3, D=free
pat 4,   restricted t1 + prefer P5, D=free
pat 5,   restricted t2 + prefer P5, D=free
pat 6,   restricted t1 or t2 + P/6/9 (random speech therapist), D=free
pat 7,   restricted t2, D/P=free
pat 8,   restricted t1 or t2 + P/2/3/4/5/7 (random Physical therapist), D=free
pat 9,   restricted t1 or t2 + P/2/3/4/5/7, D=free
pat 10, restricted P7 + D2, tx=free
pat 11, restricted P/6/9/, tx/D=free
pat 12, restricted P2, tx/D=free
pat 13, tx/P/D=Free
pat 14, restricted P7 + t4 + D3
pat 15, restricted p/6/9/, tx/D=free
pat 16, tx/P/D=Free

other rules followed:

Difference between prefer and restricted P; Some kids need a specific therapist, other prefer a therapist but dont "need" it.
Need>prefer

P3 works in t1 and t2
P3 has 1 pat this period
P5 has 1 pat this period
P1/4/7/8 have 2 pats this period
P2/6 have 3 patients this period
P9 is on holiday

Dolphin 1 has off in at least 1 tx
Dolphin 2 has off in at least 1 tx
Dolphin 3 + 4 have off set in t4
Only fill all dolphins in one tx as last resort, a back up dolphin is preferable (not much room for that in this schedule)
however restrictions>back up dolphin

Therapist who have 3 pats (P2/6) preferably don't have both t1 and t4
This varies amongst therapist, havent really gotten to their prefrences yet.

If possible no sessions in t4

Relationship D and P in descending order of preference:
P1 = 2,1,3
P2 = 4,3,2
P3 = 4,2,1
P4 = 5,3,4
P5 = 1,3,4
P6 = 2,1,3
P7 = 1,2,3,4
P8 = 5
P9 = 5

I hope this makes sense, this is what we're dealing with here :)

I think it makes a lot of sense. It might be possible in FET, even if with a custom version.

Let us try to develop a solution.

You have activities (number of patients * number of days per week), each with duration 1, to be allocated each one to a period, to a dolphin, and to a therapist.

You can consider a FET "day" to have 4x5 "hours per day", and allocate activities to slots (hours x dolphins), and then to rooms, which are therapists. Or maybe consider a FET "day" to have 4x5x9 slots per day (hours x dolphins x therapists), and allocate activities only to slots. Or, considering that each day is the same, consider a FET "week" to have a dimension from 4x5x9 and the slots per day to have the rest of the two dimensions.

Official FET can handle max 35 days per week and 60 hours per day, but these can be increased in a custom version.

Then, there are many constraints available in FET. One that can be very nice is activities occupy max time slots from selection, to specify that for instance a dolphin can have maximum 3 activities from 4 selected slots. Other constraints are preferred time slots, with variable weight.

The last constraint, preferences of therapists for dolphins, seems difficult/impossible for me with the above approaches. But might be possible in a custom version. Or maybe by some tricks.

I'll let you consider these approaches and maybe come back with specific questions.

Paul the dolphin

Liviu,

Thank you for your post, i am however not yet with such experience that i can translate your remarks into a concrete input into fet but i am willing to learn! As for specific question, would it be possible to develop a custom fet perhaps solely for this purpose? There are going to be people working with who arent very computer friendly, so any help i can get is appreciated!

Liviu Lalescu

#10
Hello, Paul,

I hope I have some nice news! Please see the attached file, and let me know if the file and the timetable I obtained are good. I might have forgot something, resulting in an error - but I hope not.

If you see the all time constraints window, you can read the comments in the order I added them, explaining the procedure.

Only one constraint missing, backup dolphins (which should be possible in a custom version), but the rest is official FET.

Also, in your text there is an error? Pat 14, restricted to D3, but in the Therapyplan it is to Dolphin 1.

If you generate, the nicest timetable to see is activities timetable days vertical.

Liviu Lalescu

I thought, and also the backup dolphin is possible. But only with 100% weight. See attached file, I made backup dolphins for t1, t3, and t4 (for all four slots it seems impossible).

Paul the dolphin

excuse my language but

HOLY SHIT you pulled it off. I am really impressed!

In the files I saw this:

"probably mistake in problem description: in your table, Pat 14 is to Dolphin 1, but in rules in first paragraph it is restricted to P7 + t4 + D3. I made it restricted to D1."

you were right it was supposed to be "restricted"

and

"Third paragraph, "only fill all dolphins in one tx as last resort, a backup dolphin is preferable..." - it is possible, but only with 100% weight in official FET. I added this backup dolphin for t1, t3, and t4. For all four slots it seems impossible."

Would it be possible to give a preferences order for back up dolphins, for exampe preferably backup in t1 and t3 or any other combination?

Now the most important question....

Teach me master

where do i input what for the next schedule?

Thanks again, I wasnt expecting such tremendous help or these great results!

Liviu Lalescu

#13
I am glad it works!

Quote from: Paul the dolphin on October 13, 2014, 04:37:25 PM
Would it be possible to give a preferences order for back up dolphins, for exampe preferably backup in t1 and t3 or any other combination?

Either a custom version (but I am not sure if it is possible), or just make more files and try each one (there are not many variants).

Quote
Now the most important question....

Teach me master

where do i input what for the next schedule?

You need to open the .fet file (not the data_and_timetable one, which is locked). And see each variable I have input, in the Data menu and then in the Time->All (all time constraints). I added comments when a time constraints block begins, to explain what I have done. Please go through these, as a first step, then come back here with specific questions about constraints, but preferably one at a time. I will try to answer as my time permits.

There is a thing which may be improved in my style. Instead of adding students years as "Pat 1", ..., and subjects as "s1", do not add years, but add subjects as "Pat 1", and activities as having only subject (no teachers and no students). The output HTML will be nicer.

PS: Please let me know if I may add the input .fet file and your description of the problem as an official example. In what directory? (country, city, organization) (if affirmative).

Paul the dolphin

Hi again,

I have started trying to understand what you did here and I think I understand how to set the restrictions.

Most of the non patient restriction stay the same  so i wont have to edit them in a new period, which makes me happy.

I however don't understand the backup dolphin where you said only 2 or 3 will work, however you inputted for all 4 sessions?

I tried throwing out all the "patx" and changed the "subjects" to "pat x" however it would not hold. I probably need to adjust all the time constraints right?

Also would it be possible to condense printable schedule to something similar as above, so that it displays only 4 timeslots instead of 9 times each one? In other words that the therapist is placed under the the pat and x-axis is tx=4 and y=dolphinsx?

I would be honored if you would use this problem as a general solution and example, however it is very important to me that in no way any reference is found to "dolphins" or in "dolphins" in combination with "therapist". I would like to keep this a little under the hood if you understand :)

For next period, I am going to try to input the needed variables myself and come back to you how it worked out. Meanwhile the people I work with are very happy so far. This basically frees up over 80 hours a year!

If it works out I am going to discuss donation possibilities with my superiors, do you have a donation site?

Thanks again and i will come back to you soon!