# Best match problem

Question asked by siplus on Jun 21, 2016
Latest reply on Jun 21, 2016 by keywords

I have the following problem to solve:

Offer a list of possible dates and times to the client of a fitness center.

The fitness center

- has 10 different machine types (rowing, lifting, stepping etc)

- has 1 to 5 machines of the same type

- all reservations are in a single table, with machineID, clientID, date, start and end time, times are in 10 min steps, i.e. you can have 9:00 - 9:40 but you won’t ever have 9:15 - 9:23

The client

- is told by his personal trainer what he should do the next time, in form of a “recipe”:

n[i] minutes on machine type t[i], 0 < i < 5

- it does not matter in which order he uses the machines.

- When he chooses a date and a time among the ones calculated (presented in a global repeating field with 25 reps), he will be shown the details in a popover:

Appointment on june 21, 2016

9:00 to 9:10 on rowing #3

9:10 to 9:30 on stepper #1

wait 10 min till punchingBall #2 is free

9:40 to 10:00 punch ball on puncher #2

etc

The algorithm

- will stop after evaluating 60 days from given start date (usually set to today + 1)

- will stop after finding 10 alternatives with 0 wait time even if it did not reach the 60 days horizon

- will stop after reaching 25 alternatives

- will try to avoid leaving holes in single machine agendas if possible

Ideas ?

ps repeating fields can be used