您如何在任何logic中编写具有非全能号码的注入参数

发布于 2025-01-22 22:16:09 字数 708 浏览 6 评论 0原文

我正在尝试为我的任何logic离散事件模型编写代码,该模型注入了特定数量的代理,然后在4周后,该注入的代理数量是基于模型中其他数量的代理(在屏幕快照上以红色圆圈圆圈)。我要考虑的代理的来源之一是双重(它在滑块上),并且注入调用将不接受,它只需要int值。

weeklyLeavingNursing = 0;

if (time()<4) {

    enterHerd.inject(10);

}
 
else {

    enterHerd.inject(10 - (slider.getValue() + weeklyLeavingOpen + weeklyLeavingNursing));

}

有没有办法用int和double值编写代码? 任何想法都将不胜感激。

I am trying to write code for my Anylogic discrete events model which injects a specific number of agents, and then after 4 weeks, this injected number of agents is conditional on other numbers of agents in the model (circled in red on the screenshot). One of the sources of agents that I want to account for is a Double (it is on a slider), and the inject call will not accept it, it only wants int values.

weeklyLeavingNursing = 0;

if (time()<4) {

    enterHerd.inject(10);

}
 
else {

    enterHerd.inject(10 - (slider.getValue() + weeklyLeavingOpen + weeklyLeavingNursing));

}

Is there a way to write the code with both int and Double values?
Any ideas would be greatly appreciated.
Image of the coding and the Anykogic error
Image of the full model and the 3 areas where agents enter the Source

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

z祗昰~ 2025-01-29 22:16:09

只需使用以下函数:

getIntValue()

”在此处输入图像描述”

Just use the following function:

getIntValue()

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文