Reputation: 23
I am working on a case where I need to assign 17 doctors to patients based on predefined doctor names. Each patient has a specific doctor assigned for their examination, and I want to dynamically allocate the correct doctor in AnyLogic using the names provided.
To achieve this, I have created 17 separate resource pools, each representing a doctor and named accordingly. However, I am facing a problem when configuring the Seize block. If I link all the resource pools to the Seize block's resource sets, patients end up waiting for a long time in the queue. I want seize block to select the corresponding doctor according to their assigned doctor.
I have also added a parameter named doctorName in the Patient agent, which is populated from an Excel file. The doctor names in the Excel file are correctly mapped to the doctorName parameter through the Source block.
Could you please guide me on how to correctly configure the Seize block to minimize patient waiting times while ensuring that each patient is assigned to their predefined doctor?
Thank you for your help!
Upvotes: 1
Views: 50
Reputation: 9431
What you need to do is create only 1 resource pool with all the doctors, then on the seize block, you will use the "custom resource choice" and do something like ((Doctor)unit).name.equals(agent.assignedDoctorName) as the condition to seize the resource.
Or if you know what doctor is assigned, then the condition will be ((Doctor)unit).equals(agent.assignedDoctor)
Upvotes: 1