Count all agents that are in certain state

Viewed 42

Community,

I would like to collect statistics on my "Customer" agent-population. The agent population lives in main. The agent states are described according to the below screenshot.

In main, I want to store agent statistics in a DataSet. Therefore, I tried: count(customers,c->c.inState(greenState))

The following error message appears:

"greenState" cannot be resolved to a variable.

Could someone help me out and explain what is wrong and provide a solution?

Thank you very much! :)

Statechart of Customer Agent

1 Answers

You should reference the greenstate from where it exists inside your agent. count(customers,c->c.inState(Customer.greenState))

Related