限制AnyLogic中一个代理在一个块内的循环次数?

huangapple go评论40阅读模式
英文:

How to limit the number of loop of one agent in a block in anylogic?

问题

我正在研究一个模型,在这个模型中,顾客首先占用接待区(在接待处点餐),然后释放接待区并移动到占用餐桌(坐在餐桌上)。现在我已经使用了选择输出(参见图像),这使得顾客可以在不占用额外餐桌的情况下再点一杯酒,因为他们已经占用了一个餐桌。

现在我想将这个循环限制在8次之内。也就是说,一个顾客最多可以点8杯酒(一个代理可以在系统中进行8次服务/延迟)。

英文:

I am working on a model, where customer seize reception (order at reception for food) and then releases the reception and moves to seize dining table (sit at table). Now I have used select output (see image) which allows the customer to have another drink without seizing additional dining table because they already have seized one dining table.

Now I want to limit this loop to the number 8. That is one customer can have a maximum of 8 drinks (one agent can be in the system for 8 services/delay).

限制AnyLogic中一个代理在一个块内的循环次数?

答案1

得分: 0

将一个名为counterint变量放入您的客户代理中,并在客户每次循环时将其增加1。

您需要设置流程图块以“知道”它是客户在流动。

然后,在其中一个块的代码部分,您可以编写agent.counter ++;

英文:

Put a int variable (name it counter) into your customer agent and add 1 to it every time the customer makes a loop.

You need to setup the flow chart blocks to "know" that it is customers flowing through.

Then, in one of the block's code sections, you can write agent.counter ++;

huangapple
  • 本文由 发表于 2023年5月18日 10:27:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/76277345.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定