I want to create some charts in anylogic. I know at first we should add some condition in the "statistic". we should use "item.instate". But I do not want to use statechart. I want to use a parameter or color of agents for that. for example I have 100 agent with different opinion. the opinion is parameter for agents. Also, I changed the the color of agent by their opinion. I want to create the chart that demonestrate the number of agent with "totally Agreed" opiniin. how can do it? in the following picture, what I should write in the condition? enter image description here
0
votes
1 Answers
0
votes
You can simply type item.myOpinion == "I like x", assuming your agent's opinion parameter is called myOpinion and you want to count those that have that opinion.
If your opinion is actually a color, it would be item.myOpinion.equals(Color.red) but your myOpinion would need to be of type Color.
However, there are many things garbled in your question. If you agents change their opinion, it should not be a parameter but a variable, for example...