question

Brandon H avatar image
0 Likes"
Brandon H asked Jeanette F commented

Resource to learn about reusing/making templates of things in a model

Goal: Find out where I can find a list of actions I can take to save and reuse multiple different parts of my model.

Issue: I have found resources on the FlexSim Docs site about User Libraries and how to use them but I am still finding myself searching for more resources on how I can save and reuse more of what I have built in my models. One example of something that I stumbled upon was how to use the "Edit Selected Objects" view to "Save File" as a Flexsim Tree and then "Load File" into another model.

Examples: Below are a few items that I would like to save externally to a model and reuse in others but do not have a good idea of how this should be done in FlexSim

- StatisticsCollectors and Calculated Tables
- Model Triggers and code in general
- Parameters
- Dashboards

I understand this is could be a large ask but I am mostly interested in being pointed in the right direction in terms of how best to handle each different type of information here for the purpose of reusing them elsewhere.

FlexSim 23.0.2
user library
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Brandon H commented

The model libraries node allows you manage custom libraries with shared code, global variables and macros with a bit more control. Unfortunately this doesn't cover all aspects of asset management that you might need like the object types you describe, or version control when trying to update a model with later asset versions, but it might get you closer to where you need to be.

· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Brandon H avatar image Brandon H commented ·
This does look helpful and is not something that I have explored yet. Thank you for linking that so I can look into how to use this functionality.
0 Likes 0 ·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Jason Lightfoot edited

All your examples are in more ways depending on coupling data or similar data structures. A coupling datatype is executing a procedure to establish a mutual connection in two attribute nodes in different objects. A template destroys such connections. And it has not any instructions automatically to reestablish them. It depends most time on your intentions, you would like to build in a new model. You would need a setup interface to reestablish those missing connections for all possible situations of use.
You can see currently provided items in libraries as universal optimized templates to achieve what you want to improve. You can build individually new templates, but lastly you get only a vast set of different variants.

· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jason Lightfoot avatar image Jason Lightfoot ♦ commented ·
Templates in FlexSim are a way to manage object through attribute inheritance - including coupling and pointer data. They are not however obviously transportable between models, which is I think the topic of the user's post in relation to other modelled assets they have created.
1 Like 1 ·
Brandon H avatar image Brandon H Jason Lightfoot ♦ commented ·

You both are touching on things that I am after. Ultimately, I am looking to build a library of numerous "sub-models" or templates to be used in other models. What I am trying to understand is out of all of my options in doing this, what option will be the most efficient in terms of, say, maintaining the most references or pointers so that each inclusion of this sub-model or template does not require vast amounts of work reconnecting things.

Understanding that some of this is just unavoidable, my question was for any learning or reference material to help me see the different ways this type of multi-model management could be done.

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Brandon H commented ·

When you use the work 'template' are you also referring to FlexSim's object template functionality? A container can also be a template - which then can be your submodel structures, cells etc. They key to using this to create generic submodels is to use pointers/couplings to reference related objects within the same submodel. Then they will be instantiated correctly in any instances of the template, and will allow an instanced process flow to find the references for that instance too. That way you only have to model the process once. If you find yourself writing model.find() and using paths and names of objects then stop and try to use object pointers - often that will be labels of pointer type or labels with array data of pointers.

Now, the piece we're still missing is transporting those between models where you might have improved an object template in one model and then want to apply that to another model which uses it. I've asked for this many times but feel free to add it as a suggestion on this forum or write to the developers and let them know your requirement.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.