Warm tip: This article is reproduced from stackoverflow.com, please click
anylogic

How do I call out the Agent Type for a custom block?

发布于 2020-04-19 09:19:01

I have a custom block that needs parameter and variable info from the agent passing through it. I would like to design this block for use with different agent types. How do I create a pulldown of all of the available agent types in the current model like in other built-in blocks? I'm assuming it's a parameter with an internal value, but just not sure of the parameter type, method to pull the agent types, etc. See picture below:

enter image description here

Questioner
Kevin Swartz
Viewed
31
Benjamin 2020-02-05 14:38

You use type-casting as below. Note that the "Agent type" setting should stay at the default (and most generic) "Agent"

enter image description here