question

Alixe avatar image
0 Likes"
Alixe asked Logan Gold commented

How to create multiple objects at once?

Hello,


I am trying to simulate a supply chain. There are multiple processing (20) and demand (39) locations. The processing locations all have the same set of objects and relationships.

Source --> Queue 1 --> Processor 1 --> Queue 2 --> Processor 2 --> Queue 3 --> Processor 3 --> Queue 4 --> Processor 4 --> Queue 5 --> Sink (= Demand Location)

I have created 1 processing location, but would like to replicate this 'mini model' to all the other processing locations. Is there a way for me to edit Flexscript code such that I can iteratively create these objects / relationships?


I also need to connect these processing locations. This would involve having all Queue is connect to all Processor is and all Queue 5s connect to all the Sinks.


Please let me know if there any manageable way to do this without manually repeating the work. Thank you!

FlexSim 25.0.4
flexscript
5 |100000

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

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Logan Gold commented

You could put the processing lines into a container object. This allows you to copy the entire line as if it was a single object. If you put it into a group, you can then also use the "Copy And Delete Group Members" option when referencing the group in a parameter.

While it's possible to also create the connections between all objects, this would result in a lot of visual clutter if you have 20 queues with 39 connections each. I would suggest to instead use a list. All queues push to the same list and all demand locations pull from the same list. The "Pull Requirement" field of the pulling objects can then be used to filter what items they can receive.

container-example.fsm


· 2
5 |100000

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