1

In my Anylogic model I have an output that gets a value after simulation end (see picture 2). I want to add this output value to the presentation of an optimization experiment (see picture 1), so that it shows the output value of the Best iteration. Can anybody tell me how to add an output value to the presentation of an optimization experiment?

enter image description here

enter image description here

Ella
  • 125
  • 6

1 Answers1

0

Manually. In the "After Simulation run" code section of your opt-experiment, you can access your output: If it lives on Main, you would be able to access it via root.outputMAPE.

So you need to check after each individual sim run, if you currently have best iteration. If so, you update a local variable in the optimization experiment and plot that: enter image description here

Benjamin
  • 10,603
  • 3
  • 16
  • 28
  • Thanks for your answer. However, I did what you said but the variable bestSoFar remains empty during and after the optimization experiment – Ella Feb 12 '22 at 09:45
  • You can easily replace calling `isCurrentSolutionBest()` with some custom code where you check yourself if you reached something "best". Just use another variable `bestSoFar` and check yourself :) – Benjamin Feb 12 '22 at 17:07