This will take an availability array and info on guest priorities and fill in the essential meetings. It will make sure the slots are contiguous in time (so if there's a lunch break, it won't schedule a meeting across it). If you include a vector of rooms, where the vector if alphabetized puts nearby rooms together ("Smith 101", "Smith 201", "Adams 404") it will try to schedule appointments so that appointments are scheduled in nearby rooms. It will randomly do pairs of guests and hosts

availability_fill_random(
  possible_availability,
  guests,
  desired_length = 60,
  slot_length = 15,
  earliest_possible = TRUE,
  host_rooms = c(),
  allow_shorter_meetings = FALSE
)

Arguments

possible_availability

3D array with dimensions host, guest, times

guests

The data.frame of guest info, including a column of Name of the guest and Desired the hosts to meet

desired_length

The amount of time to require in a slot

slot_length

The amount of time each slot represents

earliest_possible

If TRUE, tries to do this meeting as early in the day as it can; if FALSE, as late

host_rooms

The vector of host rooms: room is entry, host name is names

allow_shorter_meetings

If TRUE, allow meetings shorter than desired_length

Value

An array in same format as possible_availability, but with 2 for the assigned slots, 0 for the unavailable slots, and 1 for available but still unfilled.