I'm working on a project where I'm supposed to simulate a production facility using SimEvent.
The model it self works as intended but as it has grown the initializing time is extremely long in comparison to runtime. At the moment it takes takes about 100-120 seconds to initialize, compiling another 20 seconds and the runtime about 0.2 seconds. So the set simulation time does not affect, e.g. I can simulate one year or 20 years for about the same time.
For the assembly I use Composite Entity Creators along with resource Aquires/Releasers and Entity Servers. Each entity is a part of the final product which adds up to a total of 35, that are composed together along the manufacturing. That is the model in a nut shell.
I've tried to use the performance advisor and disabled Zero Crossing, changed to discrete variable step solver and only to compile when dependencies are found/known but it only helped a little. However, when change parameters by just running a few lines like mark and press F9, the initialize time takes just about 20 seconds but if I run the script it will take about 100-120 seconds (the script only contains assignment to variables).
This would be fine if I only wanted to try a few parameter change but my task involves a Sensitivity analysis which takes forever since each iteration takes 100-120 seconds (Parallelization does help thought), here I want to use the Sensitivity Analyzer App (sim. Design Optimization toolbox) since I would like to do a few hundred simulations.
Either way, is there any way for me to speed up the initializing, I'm asking here because I really dont know what Simulink/Matlab is doing while initializing and therefore is it hard to improve.