- It is not easy to build and maintain a large model as you have described.
- My approach uses heavy coding and custom entities without sub-models. Needs a thorough understanding of JaamSim's under-the-hood logic.
- Flexible and scalable in its aimed context (not generalizable), but maintaining code and especially data is an issue.
- It should now be better to follow an approach utilizing sub-model logic.
I also have quite a bit of time with simulations and coding/customizing/developing including JaamSim for my own interest.
I just would like to share my experience in developing a large model similar to the one you described, though mine had one echelon.
It models a production environment with an emphasis on planning strategies under demand, operations, and supply-side uncertainties.
Before moving forward, I should mention that my approach heavily depends on coding in Java. And, I haven't used sub-model logic, which was not available (or not flexible enough) at that time. But one needs to be quite comfortable with the logic of JaamSim's design and its main simulation entities. I use one large input file which is a CSV file with almost everything, e.g. bom, part attributes, planning parameters, shopfloor structure, operational parameters, etc. So, that I can easily scale and build my models to any size with changes to the input file,
Below is the very rough flow of the logic in building my model:
1. Decide the structure of the input file (keeping dependent and independent variables in mind), and write a custom DataReader class to handle read-in data file and create necessary data structures/objects for use in FileToArray/Matrix/HashMap entities.
2. A ModelBuilder class with custom logic to prepare simulation content by using JaamSimModel's defineEntity and setInput methods. You need to loop all necessary data structures/objects you have prepared in the DataReader class. This sort of mimics the reverse of reading from a cfg file. But, it is adapted to inputs from the input file.
3. Maintain one JaamSimModel object with all entities loaded onto it. Then, use its save method to write all back to a cfg file.
4. Another class to run the model with experimental design is required. It updates created data objects according to DOE and feeds into FileToArray/Matrix/HashMap entities at the start of each run.
5. Maintain several additional cfg files to be loaded after the main model's cfg file for additional tuning to the already created entities as well as adding new entities. E.g. a cfg file for demand generators, another for workstations, one another to handle KPI's logs, etc for ease of editing separately in a text editor.
6. Mostly run in headless mode due to the size of the model and requirements of DoE to obtain reasonable run times. But, use GUI for debugging, if necessary.
7. And, of course, keep everything in Git to track changes to cfg and data files.
This has worked for my own purposes. However, I can't say it is the best approach to utilize. A better one would be to design sub-models with customized logic and then populate the model with its clones with the correct attributes/parameters. When I have ample time, I plan to replace my custom entity classes e.g. AdvancedMachine, AdvancedQueue, AdvancedSKU, etc which are heavily coded, direct subclasses of CompoundEntity class of JaamSim. Unfortunately, I am currently busy. But I would like to hear others' experiences with sub-models and their clones in similar contexts.