简体   繁体   English

如何在 AnyLogic 中设置“预热期”

[英]how to set 'warm-up period' in AnyLogic

I want to set the warm-up period in AnyLogic Personal Learning Edition.我想在AnyLogic个人学习版中设置预热期。 I searched for the warm-up period place in AnyLogic, but I couldn't find any thing about the warm-up period.我在AnyLogic中搜索了warm-up period的地方,但是我找不到任何关于warm-up period的东西。

Is there a warm up period in Anylogic or something like this? Anylogic 中是否有预热期或类似的东西?

There is no default warm-up setting as it would not make sense given the vast flexibility of the tool and user needs.没有默认的预热设置,因为鉴于工具和用户需求的巨大灵活性,它没有意义。

It is easy, however, to set it up yourself.然而,自己设置它很容易。 As usual, there are many different options, here is one:像往常一样,有许多不同的选择,这里是一个:

  1. create a variable v_WarmupDuration on Main, set it to whatever many time units you need在 Main 上创建一个变量 v_WarmupDuration,将其设置为您需要的任何时间单位
  2. any data object you want to only record after the warmup period, ensure it only captures data if time() > v_WarmupDuration .任何您只想在预热期后记录的数据对象,请确保它仅在time() > v_WarmupDuration捕获数据。

Events can have a custom initial time which you can use v_WarmupDuration for.事件可以有一个自定义的初始时间,你可以使用 v_WarmupDuration 。 Functions that log data can only do so if time() > v_WarmupDuration , and so on.记录数据的函数只能在time() > v_WarmupDuration等情况下这样做。

Alternatively, log all your data as normal but add time stamps to them.或者,像往常一样记录所有数据,但为它们添加时间戳。 Then, you can然后你可以

Creating a warmup variable works fine for metrics you create yourself.创建预热变量适用于您自己创建的指标。

But if you want to use the built in functionality like histograms created from timeMeasureStart and timeMeasureEnd blocks in Anylogic, you will also need to add an extra select option so eg assuming you set v_WarmupDuration to 60 minutes, then you need a select block with a decision on false that goes straight to sink block or the next element after the timeMeasureEnd.但是如果你想使用内置的功能,比如在 Anylogic 中从 timeMeasureStart 和 timeMeasureEnd 块创建的直方图,你还需要添加一个额外的 select 选项,例如假设你将 v_WarmupDuration 设置为 60 分钟,那么你需要一个 select 块来决定如果为 false,则直接进入 sink 块或 timeMeasureEnd 之后的下一个元素。

Condition if true: time(MINUTE) > v_warmupDuration条件如果为真:time(MINUTE) > v_warmupDuration

That way, the warmup period will not accumulate into the dataset of the timeMeasureEnd.这样,预热期就不会累积到 timeMeasureEnd 的数据集中。

If you want to set this as a parmeter to an experiment, then...如果你想将其设置为实验的参数,那么......

  1. Add a variable to the experiment page off the screen eg v_warmupMins在屏幕外的实验页面添加一个变量,例如 v_warmupMins
  2. Add a control like a slider on the experiment page and link to the variable v_warmupMins在实验页面添加一个控件,如 slider 并链接到变量 v_warmupMins
  3. Add a parameter to hold the warmup time in the Main canvas eg p_warmupMins在 Main canvas 中添加一个参数来保存预热时间 eg p_warmupMins
  4. On the experiment properties, set the parameter p_warmupMins = v_warmupMins在实验属性上,设置参数 p_warmupMins = v_warmupMins
  5. to programmatically add this time onto the StopTime, add this to the Before Simulation Runs getEngine().setStopTime( getEngine().getStopTime(MINUTE) + v_warmupMins );要以编程方式将此时间添加到 StopTime,请将其添加到 Before Simulation Runs getEngine().setStopTime( getEngine().getStopTime(MINUTE) + v_warmupMins );

Now when i run experiment with slider set to 60 mins, it adds 60 mins onto the stoptime and runs the experiment without accumulating metrics until that time has passed.现在,当我将 slider 设置为 60 分钟运行实验时,它会在停止时间上增加 60 分钟,并运行实验而不累积指标,直到该时间过去。

Hope that helps.希望有所帮助。

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

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