0

我正在尝试启动在 anylogic 6 中工作的旧模型之一,但有一个有趣的错误:

    Invalid space type value: undefined
java.lang.RuntimeException: Invalid space type value: undefined
    at com.anylogic.engine.SpaceType$1.getAgentExtClass(Unknown Source)
    at com.anylogic.engine.Agent.n(Unknown Source)
    at com.anylogic.engine.Agent.setEnvironment(Unknown Source)
    at automataproductioncell2.Robot.create_robotArm1_xjal(Robot.java:809)
    at automataproductioncell2.Robot.create_robotArm1_xjal(Robot.java:792)
    at automataproductioncell2.Robot.doCreate(Robot.java:1674)
    at com.anylogic.engine.Agent.create(Unknown Source)
    at automataproductioncell2.Main.create_robot_xjal(Main.java:403)
    at automataproductioncell2.Main.create_robot_xjal(Main.java:384)
    at automataproductioncell2.Main.doCreate(Main.java:1507)
    at com.anylogic.engine.Agent.create(Unknown Source)
    at com.anylogic.engine.Engine.start(Unknown Source)
    at com.anylogic.engine.ExperimentSimulation.y(Unknown Source)
    at com.anylogic.engine.ExperimentSimulation.run(Unknown Source)
    at automataproductioncell2.Simulation.executeShapeControlAction(Simulation.java:114)

如我所见,有一个 SpaceType 调用已从 7.0.0 版中删除(请参阅http://www.anylogic.com/changes-history)。

我想知道我需要改变什么 - 我第一次看到这个问题等。我看到“SpaceType$1”这个名字不是普通的名字,而是在生成的java代码中调用的......

该项目在这里:https ://drive.google.com/file/d/0B6tpi846g-FBNlBjaTNyS0huN3M/view?usp=sharing

4

1 回答 1

2

此异常是由于空间设置被锁定为子代理类型(机器人)引起的。如果父代理类型 (AnimatedObject) 不扮演任何代理群体的环境角色,则它不能是嵌入式代理的环境(连续或离散)。但是,由于空间设置是由 GIS 地图定义的,因此可以正确处理 GIS 空间。您需要将一组虚拟代理放入父代理类型以解决问题。

于 2016-02-25T16:53:54.683 回答