Hi so I have this code for scheduling surgery appointments. Each surgery needs to be put on a day, in a time slot and be assigned a theatre.
Here's the requirements / constraints I have for the code:
- There are 100+ surgeries
- There are 9 time slots (read hours) in a ay for surgeries
- That means that it will take 11_ days to do all of the surgeries
- There are 3 operating theatres
- There are 2 anaesthetists that can be used per day
- A surgeon cannot perform two surgeries at the same time
- A surgeon cannot perform two surgeries back-to-back
- A surgeon can perform a maximum of their surgery quota in a day
- A operating theatre can only be used for one surgery at a time
This is what I think needs to happen
- The surgeons start their day in a resting state
- The resting surgeons then move into the idle state
- The working surgeons move into the resting state
- The working surgeons then gets blanked
get_idle_surgeon
- It's supposed to be checking if there are any idle surgeons then removes them
- If there are no idle surgeons then it's checking that there are surgeons
- if there are surgeons then it creates a new list and removes them form it (which doesn't make much sense now I think about it) when really it' supposed to be returning a surgeon for use in the loop
Maybe it should be checking how many surgeons are in a resting state? and then providing one of those?
Code Examples
Surgeons List
[
Surgeon(name='Meredith Gery', suregery_quota='4', surgery_quantity=0, in_surgery=False),
Surgeon(name='Leonard McCoy', suregery_quota='3', surgery_quantity=0, in_surgery=False),
Surgeon(name='Preston Burke', suregery_quota='2', surgery_quantity=0, in_surgery=False),
Surgeon(name='Cristina Yang', suregery_quota='4', surgery_quantity=0, in_surgery=False),
Surgeon(name='Beverly Crusher', suregery_quota='2', surgery_quantity=0, in_surgery=False)
]
Surgeries Data
[
Surgery(surgery_type='Cholecystectomy', anesthetist_required='Yes'),
Surgery(surgery_type='Broken Bone repair', anesthetist_required='Yes'),
Surgery(surgery_type='Heart Bypass', anesthetist_required='Yes'),
Surgery(surgery_type='Carpal Tunnel', anesthetist_required='No'),
Surgery(surgery_type='Dupuytren Contracture Release', anesthetist_required='No')
]
Current Code
https://paste.pythondiscord.com/AFPA