当前位置: 首页 > 知识库问答 >
问题:

尝试在层次模型中移动代理时出现AnyLogic错误

杨征
2023-03-14

任务描述:模型包含两种类型的代理,一种类型的代理生活在另一种类型的代理中。为了在高阶代理之间移动代理,我使用了以下代码(查找随机连接的代理,然后尝试增加其数量,然后定义内部位置):

City destinationCity = (City) city.getRandomConnectedAgent();
this.goToPopulation(destinationCity.population);
double newX = uniform(-50, 50);
double newY = uniform(-50, 50);
this.setXY(newX, newY);

代码编译成功,但是anyLogic本身会抛出错误:

java.lang.RuntimeException: root.cities[0].population[40]:
INTERNAL ERROR: moving shape from one owner directly to another: com.anylogic.engine.presentation.ShapeEmbeddedObjectPresentation@566dc332 -> com.anylogic.engine.presentation.ShapeEmbeddedObjectPresentation@f8b9090
    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.engine.Utilities.error(Unknown Source)
    at com.anylogic.engine.internal.ac.l(Unknown Source)
    at com.anylogic.engine.presentation.Shape.l(Unknown Source)
    at com.anylogic.engine.presentation.Shape3D.l(Unknown Source)
    at com.anylogic.engine.presentation.ShapeTopLevelPresentationGroup.setOwner_xjal(Unknown Source)
    at com.anylogic.engine.Agent.setOwnerShape_xjal(Unknown Source)
    at com.anylogic.engine.presentation.ShapeEmbeddedObjectPresentation.setEmbeddedObject_xjal(Unknown Source)
    at com.anylogic.engine.presentation.ShapeEmbeddedObjectPresentation.<init>(Unknown Source)
    at hierarchicalmodel__mobility_.City._population_presentation_createShapeWithStaticProperties_xjal(City.java:366)
    at hierarchicalmodel__mobility_.City$1.createShapeWithStaticProperties_xjal(City.java:388)
    at com.anylogic.engine.presentation.ShapeAgentPopulationGroup.createShapes(Unknown Source)
    at com.anylogic.engine.presentation.ShapeAgentPopulationGroup.updateDynamicProperties(Unknown Source)
    at com.anylogic.engine.presentation.ShapeGroup.updateDynamicProperties(Unknown Source)
    at com.anylogic.engine.Presentable.l(Unknown Source)
    at com.anylogic.engine.Presentable.updateShapeDynamicProperties(Unknown Source)
    at com.anylogic.engine.presentation.ShapeEmbeddedObjectPresentation.updateDynamicProperties(Unknown Source)
    at com.anylogic.engine.presentation.ShapeAgentPopulationGroup.updateDynamicProperties(Unknown Source)
    at com.anylogic.engine.presentation.ShapeGroup.updateDynamicProperties(Unknown Source)
    at com.anylogic.engine.Presentable.l(Unknown Source)
    at com.anylogic.engine.Presentable.updateShapeDynamicProperties(Unknown Source)
    at com.anylogic.engine.presentation.Panel.d(Unknown Source)
    at com.anylogic.engine.presentation.Panel.j(Unknown Source)
    at com.anylogic.engine.presentation.Panel$c.run(Unknown Source)

问题出在该行内部,没有该行代理正在移动,但是总体数量的参数保持不变:

this.goToPopulation(destinationCity.population);

如有任何帮助,我们将不胜感激(可能您知道在高阶代理之间移动代理的不同方式)!

共有1个答案

仲孙钊
2023-03-14

该错误应在AnyLogic 8.3或8.4中修复。

 类似资料:
  • 我有几个项目保存到documents目录。我目前需要这些以编程方式移动到另一个目录。我成功地创建了新目录,但在使用FileManager.Default.MoveItem时似乎并没有看到这一点。 用于创建目录的代码。 我用这个代码检查我的URL。 它输出这个。 无法将文件移动到新媒体路径错误-错误域=nscocoaErrorDomain代码=516“无法将Image_5移动到”Documents“

  • 问题内容: 尝试在ipython Notebook中使用Selenium打开Firefox时出现错误。我环顾四周,发现了类似的错误,但没有与我得到的错误完全匹配的错误。有人知道问题可能是什么以及我如何解决?我正在使用Firefox 22。 我输入的代码如下: 代码返回的错误如下: 问题答案: 尝试在初始化时指定Firefox二进制文件 FirefoxDriver查找的默认路径为。参见Firefox

  • 我尝试使用< code>minikube start启动minikube,但出现以下错误: charlie@charlie:~$minikube start本地库伯内特斯v1.10.0集群…启动VM… E0705 00:39:35.199099 20888start.go:168]启动主机时出错:创建主机时出错:执行步骤出错:运行预先检查。:我们从版本5开始支持Virtualbox。您的Virtu

  • 问题内容: 当我尝试在Chrome中运行测试时出现此错误: 初始化方法AutomationUsingSelenium.SmuladorChrome.MyTestInitialize引发异常。OpenQA.Selenium.DriverServiceNotFoundException:OpenQA.Selenium.DriverServiceNotFoundException 原因是什么? 问题答案

  • 但运气不好。有什么想法吗?这有意义吗?