0
votes

In my AnyLogic model there is a source where the parameter agent.type is one of Options from an OptionList called Types.

I want to create a Histogram that shows how many agents there are with each of the different possible Types.

I can do it by setting up a variable for each Type that increments the count() using a longwinded function, but I would prefer to use a dataset or histogram_data optionsHistogram using the OptionsList as the Horizontal axis value, and the count of the number of agents with that type as the Vertical axis value.

Is this possible, and what would you recommend as the best way to achieve this?

Thanks

1

1 Answers

0
votes

A histogram is used to plot the spread of one type of data.

If you want to plot the number of agents by type (and that is defined by an OptionList), you should use simple bar chart and use a statistic on your agent population as below: enter image description here

You can then plot it in a bar chart using this setup: enter image description here

PS: There is a lot of info about how those agent-pop statistics work in the help, worth a read.