【问题标题】:Did anyone work with set_center method in AnyLogic?有人在 AnyLogic 中使用 set_center 方法吗?
【发布时间】:2020-11-30 04:09:07
【问题描述】:

我正在将 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 代码,但没有找到。
请问有人知道吗?

【问题讨论】:

    标签: java anylogic


    【解决方案1】:

    set_center(...) 是代理类型Distributor 中参数center 的自动创建方法。您创建的每个参数都会获得这样的方法,请参阅AnyLogic help on parameters

    您的代理类型中缺少参数center,所以没有这种方法。

    【讨论】:

    • 嗨@Chloe,很高兴答案很有帮助。请将此答案推荐为“有用”(答案旁边的向上箭头),以帮助其他用户将来也能找到它。有关 SOF 工作原理的更多信息,请参阅stackoverflow.com/help/why-vote :)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-14
    • 1970-01-01
    • 2012-07-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多