Search code examples
anylogic

Why is this error (Environment must be defined) showing while running the model in anylogic?


I have a model where the initial population size is 60. I have got two states of the population. I am entering the population to a node, which moves automatically to rackpallet. From there forklifts picks them up and takes them to Polygonal Node 1.

But during running the model, I keep getting the following error

Exception during discrete event execution:

root.[21]:

Environment must be defined

java.lang.RuntimeException: root.[21]:

Environment must be defined

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.AgentExtensionImpl.error(Unknown Source)

at com.anylogic.engine.ii.k(Unknown Source)

at com.anylogic.engine.ii.deliver(Unknown Source)

at com.anylogic.engine.ii$a.execute(Unknown Source)

at com.anylogic.engine.Engine.h(Unknown Source)

at com.anylogic.engine.Engine.nj(Unknown Source)

at com.anylogic.engine.Engine$a.run(Unknown Source)

enter image description here


Solution

  • Ensure that in your Enter node, you specify a location that is within the agent environment of that block. Your agents still "live" somewhere else before entering, causing this error