I have three sources that generate packages. Each source gets a special tyo assigned to it:
agent.p_type = 0;
agent.p_type = 1;
agent.p_type = 2;
After processing a package, I want to formulate a command in the block: "moveByCrane", which gives me the number of packages by specific type in a pie chart.
My attempt was this:
auftrag1 = count(agent.p_type == 0);
order1 is a variable that is then called in the pie chart.
However, I get an error message that it doesn't work that way. What is the problem?
It appears in "MovebyCrane"
My Code is:
auftragX
variables into type int
MovebyCrane
, count each passing agent as belowcode:
if (agent.p_Type == 0) {
auftrag1 ++;
} else if (agent.p_Type == 1) {
auftrag2 ++;
} else if (agent.p_Type == 2) {
auftrag3 ++;
} else {
error("dsafsdf");
}