Anylogic - 要获取的资源的动态规范 [英] Anylogic - dynamic specification of resources to seize

查看:44
本文介绍了Anylogic - 要获取的资源的动态规范的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

与其在 seize 块的定义中静态定义要占用的资源(或资源池),我希望进入 seize 块的代理能够指定它需要的资源.

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.

例如,我可能会说 100 个资源池,每个资源池代表不同类型的资源(例如工具室中的工具).我模型中的每个代理都需要不同的资源组合和数量(在我的示例中,这将是工具).当我的代理进入 seize 块以获取其资源列表时,我希望代理能够指定它需要哪些资源(工具或资源集).

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?

推荐答案

您可以使用自定义资源选择"设置,假设所有需要的资源都在一个资源池中.

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

假设您的资源有一个字符串参数myType".现在,传入代理可以选择仅在 unit.myType.equals("Mechanics").

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.

在您的Seize"对象中,您还可以通过切换到动态设置来更改要从哪些池中获取的静态分配.现在,您可以非常灵活地使用哪些池以及(在池内)要夺取哪些单位...

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...

这篇关于Anylogic - 要获取的资源的动态规范的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆