如何将 AnyLogic 代理从一个空间移动到另一个空间?
Posted
技术标签:
【中文标题】如何将 AnyLogic 代理从一个空间移动到另一个空间?【英文标题】:How do I move AnyLogic agents from one space to another? 【发布时间】:2021-10-12 21:31:25 【问题描述】:在我的 AnyLogic 模型中,Container 代理在 Main 代理中移动到不同的位置。
Main 在特定位置包含多个 Block 代理实例。 Block 包含一个多桥桥式起重机,它应该拿起 Container 并将其移动到本地存储。
当 Container 被放置在 Block 的起重机范围内的 Attractor 上时,Block 内的进程被调用。 此过程包含 Entry、MoveByCrane 和 Exit 块。 在 MoveByCrane 块中,在抓住步骤中,AnyLogic 给了我以下错误:
Exception during discrete event execution
root.blocks[0].moveContainerIn.seize:
The agent root.containers[0] and the crane com.anylogic.engine.markup.OverheadCrane@50b7349f have different spaces
at com.anylogic.engine.Engine.error(Unknown Source)
at com.anylogic.engine.Agent.error(Unknown Source)
at com.anylogic.engine.Utilities.error(Unknown Source)
at com.anylogic.libraries.material_handling.MHLBlock_xjal.error(Unknown Source)
at com.anylogic.libraries.material_handling.SeizeCrane.j(Unknown Source)
at com.anylogic.libraries.material_handling.SeizeCrane.k(Unknown Source)
at com.anylogic.libraries.material_handling.SeizeCrane.getHookDestinationPoint(Unknown Source)
at com.anylogic.libraries.material_handling.SeizeCrane.a(Unknown Source)
at com.anylogic.libraries.material_handling.SeizeCrane.a(Unknown Source)
at com.anylogic.libraries.material_handling.SeizeCrane$1.onEnter(Unknown Source)
at com.anylogic.libraries.processmodeling.Delay.b(Unknown Source)
at com.anylogic.libraries.processmodeling.Delay.b(Unknown Source)
at com.anylogic.libraries.processmodeling.Delay$9.onEnter(Unknown Source)
at com.anylogic.libraries.processmodeling.InputBlock$1.b(Unknown Source)
at com.anylogic.libraries.processmodeling.InPort.a(Unknown Source)
at com.anylogic.libraries.processmodeling.InPort.receiveImmediately(Unknown Source)
at com.anylogic.libraries.processmodeling.InputBlock$1.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.b(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock.forwardReadyEntityNotification(Unknown Source)
at com.anylogic.libraries.processmodeling.InputBlock$1.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.b(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock$2.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock$2.action(Unknown Source)
at com.anylogic.libraries.processmodeling.AsynchronousExecutor_xjal$a.execute(Unknown Source)
at com.anylogic.engine.LibraryEventHandler$b.execute(Unknown Source)
at com.anylogic.engine.Engine.c(Unknown Source)
at com.anylogic.engine.Engine.hi(Unknown Source)
at com.anylogic.engine.Engine.f(Unknown Source)
at com.anylogic.engine.Engine$b.run(Unknown Source)
所有的 Block 代理都位于 main 中的不同坐标。他们每个人都有自己的坐标参考/原点。 (block中的位置(0,0)与main中的(0,0)不同。)这是错误信息中“空格”一词的含义吗?
有没有办法将代理从一个空间移动到另一个空间?
我应该从一个空间移除(下沉)代理并在另一个空间中创建一个新的吗?
【问题讨论】:
【参考方案1】:是的。
最简单的方法是使用Main
中的Enter
和Exit
块以及您的代理类型并以这种方式将代理发送到不同的空间。在Enter
属性中,指定代理类型中的位置,它将使您到达的代理“切换”到新空间。
如果您不使用流程建模块,则需要调用 setEnvironment()
,然后使用 setLocation(...)
在其新环境中定义代理位置
【讨论】:
以上是关于如何将 AnyLogic 代理从一个空间移动到另一个空间?的主要内容,如果未能解决你的问题,请参考以下文章
我如何在 AnyLogic 中拆分我的代理,以便一个始终使用一项服务,然后其他人使用另一项服务?
oracle 11g 如何将表从一个表空间移动到另一个表空间