0
votes

[Screenshot] I'm sorry it's in german..

1I have a problem with a pickup element in AnyLogic. I have two agents: pallets and pieces.

If an order arrives I combine the two with a pickup element (pallet in inPort) with "at least 4 pieces" and I also set up a parameter on the Agent pallet with the name amountofpieces.

I now want to know exactly how many pieces there are in the container pallet, so that I can add the amount of pieces to my stock variable.

With: Agent.amountofpieces = container.contents().size() I get a error note.

Also Agent.amountofpieces = pallet.contents().size() is not working.

I later want to add it to a variable (name: stock). My code now is: stock += + Agent.amountofpieces.

Do you maybe have an idea how to solve it?

Or is there another posibility to get the amount of agents that went out as "one" new agent?

1
did you try "agent" instead of "Agent"? Java is case-sensitive and these two have massively different meanings. Also, what is the error? Do share some screenshots :) - Benjamin
I added a screenshot, the error message states: agent cannot be resolved to a variable. - Carlos

1 Answers

0
votes

I found a solution :)

agent.contents().size() works without any parameters or anything else.