I am modelling an inventory management system in Anylogic by means of Discrete Event Simulation.
Throughout the model, new resources are added according to a dataset in excel. I modelled this with a source block. In the source block, several parameters of the agent are added to the resource agent, which I need in the rest of my model (for instance purchase date, level of source activity etc.). I now want these agents to be added to my resource pool while keeping the parameters. However, since they are entering the model in a source block, I am not sure how to model/code this.
I tried to seize the sources after the enterblock, but this does not work. I also have tried to specificy the capacity of the ResourcePool with a variable 'varNumberResources', which is adjusted each time after a resource leaves the enterblock, however then the parameters are not added to the agent in the resourcePool.
you can't add custom resources to a resourcePool, so the only way you can do it is by using the
set_capacity(n)method.And you will then have to use "on new unit" from the actions of your resourcePool in order to define this new resource characteristics
Also you can't add resources using a source or an enter blocks. So don't do that. By setting the capacity of the resourcePool, the new resources will be added automatically to the model, but you will need to use the on new unit action to do anything with them