Anylogic:Change source;“到达”定义为由在运行时
主题与流程建模库,源有关。目的是在模拟过程中为源的“速率”和“汇总时间”更改。
在模拟过程中切换到“速率”效果很好。当切换到“室内时间”时,我会面临问题 - 我似乎无法通过SET_RATE函数来控制Arrartial时间。我什至尝试将到达率进行铁制(在代码中注释) - 但这也无效。有什么建议吗?
if (comboArrival.getValueIndex()==0)
{
source.set_arrivalType(sourceRate.INTERARRIVAL_TIME);
source.set_rate(arrivalRate/60, PER_MINUTE);
//source.set_rate(1.0, PER_MINUTE);
}
else
{
source.set_arrivalType(sourceRate.RATE);
source.set_rate(arrivalRate/60/60);
}
Topic is related to Process Modeling Library, Source. Objective is to change between "Rate" and "Interarrival time" for Source during the simulation.
Switching to "Rate" during the simulation works fine. When switching to "Interarrival time" I face problems - I cannot seem to control the interarrival time with the set_rate function. I've even tried to hardcode the arrival rate (commented in code) - but that did not work either. Any suggestions?
if (comboArrival.getValueIndex()==0)
{
source.set_arrivalType(sourceRate.INTERARRIVAL_TIME);
source.set_rate(arrivalRate/60, PER_MINUTE);
//source.set_rate(1.0, PER_MINUTE);
}
else
{
source.set_arrivalType(sourceRate.RATE);
source.set_rate(arrivalRate/60/60);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
到达时间是动态的。您可以简单地在其字段中放置一个变量并更改变量。
现在您需要做的就是更改
actible
,例如,您仍然需要将到达类型更改为Arrival类型,因为您已经在更改变量值之前就已经做了。
The interarrival time is dynamic. You can simply put a variable in its field and change the variable.
Now all you need to do is change
variable
e.g.Of course you would still need to change the arrival type to interarrival time as you are already doing before changing the variable value.
在设置源的属性时 - 我必须确保首先选择“临时时间”。从Arrarival时间转换为动态速度工作。当我尝试设置源为速率的属性,然后动态切换到Arrarival时间时,我一直面临问题。
When setting up the Properties for Source - I had to make sure that the "Interarrival Time" was selected first. Switching from Interarrival time to Rate dynamically worked. When I tried to set up the Properties for Source as Rate and then switch dynamically to Interarrival time, I kept facing problems.