0

I recently hit a severe performance wall in an AnyLogic model and decided to do some method profiling. The top-level culprit was com.anylogic.engine.Engine.mc(), but what does it do, and how do we speed it up?

Profiler Snapshot

Dylan Knowles
  • 2,726
  • 1
  • 26
  • 52

2 Answers2

2

Ideally, never use conditional transitions, only message-based, timeout-based and agent-arrival-based ones. Otherwise, your condition-based transition keeps checking all the time if it's condition has been met yet.

Benjamin
  • 10,603
  • 3
  • 16
  • 28
  • Agreed! That tends to be the optimization I use after I've clearly laid out my thoughts in a statechart. In the model that sparked this Q&A I hadn't noticed that I had left a conditional transition. I was really paying for it in execution speed and didn't want to see others get caught in the same trap. Hopefully our comments help others in the future! – Dylan Knowles Jul 20 '17 at 07:00
  • Hi Dylan, didn't see you were the author (and respondent) :-) – Benjamin Jul 20 '17 at 19:01
1

It was explained to me that com.anylogic.engine.Engine.mc() is where conditions in events and transitions are checked. If Engine.mc() is slowing you down, check your condition events and condition transitions!

Dylan Knowles
  • 2,726
  • 1
  • 26
  • 52