简体   繁体   English

Anylogic - 抢占资源的动态规范

[英]Anylogic - dynamic specification of resources to 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.我不希望在占用块的定义中静态定义要占用的资源(或资源池),而是希望进入占用块的代理能够指定它需要的资源。

For example, I may have say 100 resource pools each one representing a different type of resource (like tools in a tool room).例如,我可能会说 100 个资源池,每个资源池代表不同类型的资源(例如工具室中的工具)。 Each agent in my model needs a different combination and quantity of the resources (in my example this would be tools).我的 model 中的每个代理都需要不同的资源组合和数量(在我的示例中,这将是工具)。 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.您可以使用“自定义资源选择”设置,假设所有需要的资源都在一个资源池中。

Assume your resources have a String parameter "myType".假设您的资源有一个字符串参数“myType”。 Now an incoming agent can choose to only seize resources where unit.myType.equals("Mechanics") .现在,传入代理可以选择只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.在您的“占用”object 中,您还可以通过切换到动态设置来更改要占用哪些池的 static 分配。 Now you are extremely flexible by which pools to use and (within a pool) which units to seize...现在,您可以非常灵活地使用哪些池以及(在池内)要占用哪些单元......

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM