有人在AnyLogic中使用set_center方法吗?

huangapple go评论99阅读模式
英文:

Did anyone work with set_center method in AnyLogic?

问题

我正在使用AnyLogic进行供应链项目。我想请教那些看过AnyLogic预定义模型的人。

它的路径是:欢迎 > 示例模型 > 供应链和物流 > 产品交付。在该模型中,他们使用了一个名为set_center的函数(您可以在Main中找到)。
以下是AnyLogic中的代码:

for (Distributor distributor : distributors) 
    distributor.set_center(
        distributor.getNearestAgentByRoute(manufacturingCenters));

对于我的项目,我创建了一个受上述预定义模型启发的模型,但函数set_center不起作用。控制台显示以下消息:

The method set_center(shiptopoint.getNearestAgentByRoute(retailers)) is undefined for the type Shiptopoint

其中shiptopointretailers是我为我的模型创建的代理(它们都是人口代理)。

我尝试找到Java代码,但没有找到。请问有人有线索吗?

英文:

I'm using AnyLogic for a project in Supply Chain. I would love to ask those who have seen the predefined model in AnyLogic.

Its path is in: Welcome > Example Models > Supply Chains and Logistics > Product delivery. In the model they used a function called set_center (You can find it in the Main).
You can find below the code in AnyLogic

for (Distributor distributor : distributors) 
    distributor.set_center(
        distributor.getNearestAgentByRoute(manufacturingCenters));

For my project, I created a model inspired from the predefined model described above but the function set_center didn't work. It tells me in the console

The method set_center(shiptopoint.getNearestAgentByRoute(retailers)) is undefined for the type Shiptopoint

Where shiptopoint and retailers are agents that I created for my model (They are both population agents)

I tried to find the Java Code but I didn't find it.
Does anyone have a clue please?

答案1

得分: 2

set_center(...) 是参数 center 在代理类型 Distributor 中自动创建的方法。您创建的每个参数都会有这样的方法,详见AnyLogic关于参数的帮助文档

您的代理类型中缺少参数 center,因此没有这样的方法。

英文:

set_center(...) is an automatically created method for the parameter center in the agent type Distributor. Each parameter you create gets such a method, see AnyLogic help on parameters.

You lack a parameter center in your agent type, so there is no such method.

huangapple
  • 本文由 发表于 2020年8月10日 22:25:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/63342145.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定