In my model, various practitioners go to see patients multiple times in one visit. I am trying to ensure the same fellow is used to see a patient over multiple visits after being seized and released multiple times. I continue to receive this Type mismatch. Type Patient is the agent being pushed through the model and type Fellow belongs to a resource pool of 3 fellows.
A few notes
Patient
- it should be Fellow
if you want the resource pool to contain agents of type Fellow
and have patients flow through the process flow and seize Fellowson seize
code you have two local variables you can useUnit - is the Fellow, the resource unit from this pool agent - the agent that seized the unit (can be literally anything) so you need to cast it to what you think it is going to be.. AnyLogic cant do it or you as it has no idea what agent type will seize it
We again need to cast the agent to a Patient
again
NB - remember that this logic will throw a cast class exception error if any other agent than a Patient seizes a fellow.