您如何在任何logic中编写具有非全能号码的注入参数
我正在尝试为我的任何logic离散事件模型编写代码,该模型注入了特定数量的代理,然后在4周后,该注入的代理数量是基于模型中其他数量的代理(在屏幕快照上以红色圆圈圆圈)。我要考虑的代理的来源之一是双重(它在滑块上),并且注入调用将不接受,它只需要int值。
weeklyLeavingNursing = 0;
if (time()<4) {
enterHerd.inject(10);
}
else {
enterHerd.inject(10 - (slider.getValue() + weeklyLeavingOpen + weeklyLeavingNursing));
}
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需使用以下函数:
Just use the following function: