size()
: Returns the total capacity
queue_size()
: Returns the number of patients in queue
n_free()
: Returns the number of free resource units
patients_using()
: Vector of patient IDs currently using the resource
patients_using_times()
: Vector of start times for patients using the resource
queue_start_times()
: Vector of queue start times parallel to queue order
queue_priorities()
: Vector of priorities parallel to queue order
queue_info(n)
: Data.frame with patient_id, priority, start_time for queue
is_patient_in_queue(patient_id)
: Check if patient is in queue
is_patient_using(patient_id)
: Check if patient is using resource
attempt_block(patient_id, priority, start_time)
: Attempt to block a resource unit
attempt_free(patient_id, remove_all)
: Free a resource unit
attempt_free_if_using(patient_id, remove_all)
: Free only if patient is using
next_patient_in_line(n)
: Get next n patients in queue
modify_priority(patient_id, new_priority)
: Modify patient priority in queue
add_resource(n)
: Add n resource units to total capacity
remove_resource(n, current_time)
: Remove n resource units from total capacity