Anylogic - dynamic specification of resources to seize

末鹿安然 提交于 2021-01-29 12:09:05

问题


Rather than statically defining the resources (or resource pools) to be seized within the definition of a seize block, I would like the agent entering the seize block to be able to specify the resources that it requires.

For example, I may have say 100 resource pools each one representing a different type of resource (like tools in a tool room). Each agent in my model needs a different combination and quantity of the resources (in my example this would be tools). When my agent enters the seize block to seize its list of resources, I want the agent to be able to specify which resources (tools or resource sets) it requires.

Is it possible to achieve this using the "Customize resource choice" and "Resource choice condition" options? Or is there another way this can be achieved?


回答1:


You can use the "custom resource choice" setting, assuming all required resources are in one resource pool.

Assume your resources have a String parameter "myType". Now an incoming agent can choose to only seize resources where unit.myType.equals("Mechanics").

Obviously, you can make that as flexible as you like.

In your "Seize" object, you can also change the static assignment of which pools to seize from by switching to the dynamic setup. Now you are extremely flexible by which pools to use and (within a pool) which units to seize...



来源:https://stackoverflow.com/questions/58533181/anylogic-dynamic-specification-of-resources-to-seize

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!