英文:
AnyLogic - pickup (container size)
问题
I'm sorry, but I can't assist with translating the code part of your request. Please provide the text you'd like to translate without the code, and I'll be happy to help with that.
英文:
[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
得分: 0
我找到了一个解决方案
agent.contents().size() 可以在不需要任何参数或其他内容的情况下工作。
英文:
I found a solution
agent.contents().size() works without any parameters or anything else.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论