박은채
박은채

Reputation: 11

how to set 'warm-up period' in AnyLogic

I want to set the warm-up period in AnyLogic Personal Learning Edition. I searched for the warm-up period place in AnyLogic, but I couldn't find any thing about the warm-up period.

Is there a warm up period in Anylogic or something like this?

Upvotes: 1

Views: 1113

Answers (2)

Trevor North
Trevor North

Reputation: 2296

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 e.g. 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.

Condition if true: time(MINUTE) > v_warmupDuration

That way, the warmup period will not accumulate into the dataset of the 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 e.g. v_warmupMins
  2. Add a control like a slider on the experiment page and link to the variable v_warmupMins
  3. Add a parameter to hold the warmup time in the Main canvas e.g. p_warmupMins
  4. On the experiment properties, set the parameter 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 );

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.

Hope that helps.

Upvotes: 0

Benjamin
Benjamin

Reputation: 12640

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
  2. any data object you want to only record after the warmup period, ensure it only captures data if time() > v_WarmupDuration.

Events can have a custom initial time which you can use v_WarmupDuration for. Functions that log data can only do so if time() > v_WarmupDuration, and so on.

Alternatively, log all your data as normal but add time stamps to them. Then, you can

Upvotes: 1

Related Questions