question

Lambert avatar image
0 Likes"
Lambert asked Lambert commented

Delete and Copy Out Objects with lower bound zero

Hi,

I have several parameters for number of operators, which are referenced to dispatchers (with on set "delete and copy out objects").

However, when I set lower bound to 0, it always keeps at least one operator object.

1674680699193.png

Is there a way so that if a parameter is 0, the simulation won't create any objects for that parameter?

Thank you in advance!

FlexSim 23.0.2
copy objects
1674680699193.png (58.6 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.

1 Answer

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Lambert commented

Here's an example by changing the OnSet code and putting a label pointer on the reference object. It adds the label firstOutObject in order to create copies but rather than deleting it, disconnects it from the referenceObject (dispatcher in your case).

ParameterOnSet_DisconnectFirstOutobject.fsm

It assumes:

  • you will reset once with at least 1 outobject connected (when it stores the pointer).
  • there is only one input connection between the object on port 1 and the connection rank will not alter the model when it connects and disconnects when the parameter changes.



· 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.

Lambert avatar image Lambert commented ·

Hey Jason, thank you for your help.

Would you be able to modify the code, so that when an operator is "disconnected", he is also removed from a group where he belonged beforehand?

I want to do this because when they are disconnected, they still count as "idle" in state charts graphs that I have for different operators groups.


thank you very much in advance

0 Likes 0 ·
Lambert avatar image Lambert Joerg Vogel commented ·
thank you, will try now!
0 Likes 0 ·