-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscheduler.rb
More file actions
24 lines (20 loc) · 806 Bytes
/
scheduler.rb
File metadata and controls
24 lines (20 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require_relative("unitType")
require_relative("appointments")
def team_availability(appointments)
lunch = ["12:00", "1:00"]
appointments.push(lunch)
#express appointments as intervals over time line
appointments = encodeAppointments(appointments)
#puts appointments
startOfDay, endOfDay = encode("8:30"), encode("5:00")
#express availability as intervals over time segment
availability = encodeAvailability(appointments, startOfDay, endOfDay)
#chop availablity into 30 minute openings
openings = encodeOpenings(availability)
#Decode openings to string time
decodeOpenings(openings)
return openings
end
require_relative "ts_all_the_tests"
appointments = [['9:00', '9:30'], ['9:00', '11:30'], ['10:00', '11:00'], ['2:30', '3:00'], ['2:30', '3:30']]
print(team_availability(appointments))