简体   繁体   English

从 AnyLogic 中的参数绘制分布值

[英]Draw distribution values from a parameter in AnyLogic

How can I change draw a value from a distribution stored in a parameter during runtime?如何在运行时从存储在参数中的分布中更改绘制值?

Let's suppose my parameter value is "triangular (0.5 , 1 , 1.5)", for example.例如,假设我的参数值为“triangular (0.5 , 1 , 1.5)”。 In my model, this parameter is called parDelayUnloading.在我的模型中,此参数称为 parDelayUnloading。 I have many delays along my model that refer to the same parameter.我的模型中有很多延迟,它们引用了相同的参数。 I created this parameter because it is easier to change the values at only one place than doing it at each "delay".我创建此参数是因为仅在一个位置更改值比在每个“延迟”时更改值更容易。 A value will be assigned when the simulation starts.模拟开始时将分配一个值。

Note that I want the parameted value to be refreshed each time aa new entity enters the "delay" boxes.请注意,每次新实体进入“延迟”框时,我都希望刷新参数值。 On enter: .....输入时:.....

What should I do?我该怎么办?

Thank you!谢谢!

If you just want to draw values from your distribution, encoded into a parameter, all you need to do is to call the parameter at the appropriate Java code blocks.如果您只想从您的分布中提取值,并将其编码为参数,您需要做的就是在适当的 Java 代码块中调用该参数。 So if you need a value from it to be used for an entity on entering a delay block, you can write agent.whateverINeedItFor = myParameter .因此,如果您需要它的值用于进入延迟块时的实体,您可以编写agent.whateverINeedItFor = myParameter The latter automatically draws a value from your distribution.后者会自动从您的分布中提取一个值。

Hope that makes sense.希望这是有道理的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM