question

Sia Sengchoon193 avatar image
1 Like"
Sia Sengchoon193 asked Dewriffic16 commented

How to group different objects together and parametrize ?

I want to build a parametric table to run the optimization

But I have a problem that the things in the group will disappear after parameterization

The scene that I want parameters is a workspace,

There are 4 work machines and 1 operator inside,

I want to optimize how many workspaces I need to meet my needs

1655414576218.png

so I group them first

1655414633443.png

like this

1655414673610.png

Then create a parametric table

1655414742164.png

Then set the reference of the parameter, and set Delete and Copy Group Members

1655414794856.png

At this time, there are still original members in the group.

1655414905391.png

But when I set it up to reset and run it once, there is only one type of member left in the group

1655415062219.png

I don't know why it happens? Do I need to set something or create a trigger?


test.fsm

FlexSim 21.1.5
parametersobject groupgroupmember
1655414576218.png (64.5 KiB)
1655414633443.png (99.0 KiB)
1655414673610.png (59.5 KiB)
1655414742164.png (96.1 KiB)
1655414794856.png (158.7 KiB)
1655414905391.png (147.1 KiB)
1655415062219.png (112.7 KiB)
test.fsm (149.5 KiB)
· 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.

Kavika F avatar image
0 Likes"
Kavika F answered Dewriffic16 commented

Hey @Sia Sengchoon193, great question! There's a few things I'd like to point out that may help you with your analysis.

First is that when you group the Processors and Operator together into one group and try to parameterize how many there are with a Parameter, it will only add/remove one type of object. Therefore, when you change the parameter and reset the model, the operator disappears - FlexSim thinks you just want processors.

Secondly, the reason you're only seeing 1 processor after updating the parameter is that the processors stack on top of each other when created; if you move one you'll see more underneath.


One solution is to put everything you want to replicate on a plane (Library > Visual); when things are in a plane, you can move the plane and they all move together; you can copy planes and everything inside is copied (like a mass selection). If you put the plane in a group and then parameterize the group (add and delete members), you can actually duplicate entire planes (image below). [Here's a link on how to put things in planes if you don't just drop them into one]

1655420991376.png

One downside is that the connections to things outside of the plane are not kept.

Another solution would be to put all the processors in one group and all the operators in another group and then parameterize them individually (not in planes). Then they will scale up and keep their port connections. This would be really useful to use in an Experimenter too, which can run hundreds of iterations on different combinations of parameters.

parameterize group.fsm


1655420991376.png (300.6 KiB)
· 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.

Jordan Johnson avatar image
2 Likes"
Jordan Johnson answered

The "Delete and Copy Objects" code in the On Set trigger works like this:

  1. Delete objects in the group until there is only 1
  2. Copy that object until there are enough object

The new copies have the exact same location as the original object.

If you want to turn machines on or off, I wouldn't use that pickoption. Instead, I would have the queue send a message to itself, and when it gets the message, it closes the input ports of all the processors, according the parameter.

test_1.fsm


test-1.fsm (149.7 KiB)
5 |100000

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