0
votes

I'm building a DES queue model in AnyLogic. I have built several models before where I make use of defining my own agent type to store agent parameters that change how they flow through a queue network, for example. In the past this has not caused errors. However, after building a new and incredibly simple M/M/1 queue model (source, service and sink) and defining a new agent type "MyAgent", even if I don't save or access any agent attributes I've been getting the error:

Exception during discrete event execution:

class com.anylogic.engine.Agent cannot be cast to class modeltest.MyAgentTest (com.anylogic.engine.Agent and modeltest.MyAgentTest are in unnamed module of loader 'app')

It seems that perhaps the newly defined agent is not being recognized? In all of the source, service and sink blocks etc the agent type is set to "MyAgentTest"/

Any tips for troubleshooting? I've already tried rebuilding the simple model from scratch and I'm still getting the same error. If I only use a source/sink then the model runs without error. If I introduce a delay block the model will not error if the service time is very small, but if I make it larger it will error and changing it back to the original magnitude afterwards maintains the error.

I'm using AnyLogic version 8 University 8.7.2.

1

1 Answers

0
votes

Try going to the service properties. Under the "Advanced" tab, is Agent Type selected as "MyAgent" or as "Agent"? Similarly, go to the source properties and check the tab Agent and make sure "MyAgent" is selected.

Let me knows if this solves it. enter image description here