Models at scale

121 views
Skip to first unread message

Trevor Miles

unread,
Apr 10, 2023, 11:08:44 AM4/10/23
to JaamSim Users Discussion Group
Hi All

I have used Jaamsim 'casually' for some time, and have a long history in DES going back to the 1980's.

I want to test some supply chain planning concepts using Jaamsim, particularly the Glenday Sieve. I believe I have managed to construct a multi-tier supply chain pull model that operates through re-order points at multiple storage locations, with multi-stage manufacturing.

The issue is that I have only one item/entity type, and really I would like to do this with at least 100 entity types and many demand points and facilities.

I don't think building this large model using the UI is feasible. Using a text editor doesn't seem much better. I have thought of writing a program that generates the Jaamsim cfg file. This could be easier using sub-models for demand points, warehousing, manufacturing sites, transportation lanes, and suppliers. I have the demand points and warehouse sub-models, but not the others.

I thought I would put this out to the community to see if there is something that I have overlooked.

Harry King

unread,
Apr 10, 2023, 1:15:26 PM4/10/23
to JaamSim Users Discussion Group
Hi Trevor,

I suggest the following:
  • Use sub-models for the major components of your model.
  • Use a text editor for a model of this size. It is fine to use drag and drop to build the sub-models and to add graphical elements, but the heavy lifting should be done with a text editor.
  • Use Git for version control as you build the model. 
  • Use the Group feature to avoid entering the same inputs for multiple objects. Even better, you can use the new prototype and clone feature to accomplish the same thing as a Group in a more readable fashion. See the release notes for 2023-01 for more information.
JaamSim was developed specifically for building huge models such as the one you are planning. Let me know if you run into any problems.

Harry
Message has been deleted
Message has been deleted

abal...@gmail.com

unread,
Apr 25, 2023, 5:36:18 AM4/25/23
to JaamSim Users Discussion Group
Hi Trevor,
--- --- ---
TLDR;
- 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.

Best regards,
Ahmet
Reply all
Reply to author
Forward
0 new messages