离散事件期间的任何logic错误; quot“执行类都无法施放。

发布于 2025-02-11 19:09:02 字数 1395 浏览 1 评论 0原文

我试图使用Anylogic到我们自己的提示进行配电中心模型进行模拟,因为它们以类似的方式工作,但产品和仓库不同,而且我只是从该程序开始的,所以我试图在运行时解决所有可提出的错误我知道它的工作原理与Java编程略有不同,因此当我最终解决此错误时,我不知道它在最后一个修改的存档中的根源是什么。如果我必须提供更多代码,请让我知道,请

首先说:

Exception during discrete event execution:
class com.anylogic.engine.Agent cannot be cast to class cocacola3.Muelle (com.anylogic.engine.Agent and cocacola3.Muelle are in unnamed module of loader 'app')
    at cocacola3.Main._OcuparMuelleDescarga_onSeizeUnit_xjal(Main.java:4908)

错误的代码是:

    
agent.muelle = (Muelle) unit;
agent.muelle.Ocupado = true;
DescargaEspera.add(agent);
verificarDescarga(); 
;
  }
  private void _hold_onEnter_xjal( final com.anylogic.libraries.processmodeling.Hold<DescargaCamione> self, DescargaCamione agent ) {
    
self.block();
DescargaEspera.remove(agent); 
;

映像上下文:

https://drive.google.com/file/d/1me5fptevvlwczkmsssedhsaq9zav3ncxh/view?usp = sharing?usp = sharing

? mdgl2.png“ rel =” nofollow noreferrer“>

I was trying to do a simulation of distribution center model using the tips from anylogic to our own, cause they work in similar ways but diferent products and warehouses, plus i just started with this program so i tried to fix every posible error during runtime cause i know it works slightly different from java programming so when i finally fix it this error happend and i dont know whats the root of it in the last modified archive. If i have to provide more codes let me know please

First one says:

Exception during discrete event execution:
class com.anylogic.engine.Agent cannot be cast to class cocacola3.Muelle (com.anylogic.engine.Agent and cocacola3.Muelle are in unnamed module of loader 'app')
    at cocacola3.Main._OcuparMuelleDescarga_onSeizeUnit_xjal(Main.java:4908)

And the code with error is:

    
agent.muelle = (Muelle) unit;
agent.muelle.Ocupado = true;
DescargaEspera.add(agent);
verificarDescarga(); 
;
  }
  private void _hold_onEnter_xjal( final com.anylogic.libraries.processmodeling.Hold<DescargaCamione> self, DescargaCamione agent ) {
    
self.block();
DescargaEspera.remove(agent); 
;

Images for context:

https://drive.google.com/file/d/1Me5fpTevvlWcZKMssEDhSaq9zaV3ncxH/view?usp=sharing

enter image description here

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

乖乖 2025-02-18 19:09:02

您的单位不是类型muelle的代理。那样简单。要么确保它是类型muelle的类型,要么将字段的类型更改为agent.muelle到更通用的表单,例如agent对象

您可能想做前者。如果在Resourcepool中发生这种情况,请确保您告诉它资源是类型muelle

Your unit is not an agent of type Muelle. It is as simple as that. Either make sure it is of type Muelle or change the type of the field agent.muelle to a more generic form such as Agent or Object.

You will probably want to do the former. If this happens in a ResourcePool, then make sure you tell it that the resources are of type Muelle

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文