question

Henry Paipa avatar image
0 Likes"
Henry Paipa asked Jason Lightfoot edited

Define availability of a 3D Object, as a parameter

Hi Community,

I need to define as parameter the availability of a 3D Object (Unloading docks), but these are in a Group. Could you support me with some logic, that allows me to create this activity. I will be grateful for your support. Thank you.


1697711848762.png

Answers - Parameters.fsm

FlexSim 23.2.1
warehousingwarehouse optimization modelmodel parameters tableunloadingdocks
5 |100000

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

Jacob W2 avatar image
1 Like"
Jacob W2 answered Henry Paipa commented

Hi @Henry Paipa,

One way I've done this before is by adding and removing the object from the group. This means that if you are using the group as a resource, the object can no longer be used because it isn't a part of the group. Here is the code that I used to do this.


if(newValue == 1){
if(Group("Queues").isMember(reference) == 1){
return 0;
}
else{
Group("Queues").addMember(reference);
}
}
else{
if(Group("Queues").isMember(reference) == 0){
return 0;
}
else{
Group("Queues").removeMember(reference);
}
}

This was set up in a binary parameter with newValue representing the binary value input by the user.

parameter.png


parameter.png (27.1 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.

Henry Paipa avatar image Henry Paipa commented ·

I'm sorry, I don't understand, can you help me with an example? I would appreciate it. @Jacob W2

0 Likes 0 ·
Jacob W2 avatar image Jacob W2 ♦ Henry Paipa commented ·

Hi @Henry Paipa,

This is a basic model that demonstrates how the code I posted above works. Each of the processors are part of a group, "Processors". That group is referenced for a resource in the process flow. When the parameter for a specific processor is turned on or off, 1 for on, 0 for off, the object is either added or removed from the group "Processors". This means that if they aren't part of the group, they won't be used as a resource in the process flow.

Parameter availability.fsm

1 Like 1 ·
Henry Paipa avatar image Henry Paipa Jacob W2 ♦ commented ·

This is just what I needed. I really appreciate it. Words can't express how thankful I am. @Jacob W2

0 Likes 0 ·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited

If you want to add/ remove a group of objects (acting as a cell) to/from the model you can place them in a visual tool as a container and then and just those containers to a FlexSim Group which you can reference in the parameter table in order to alter the quantity of those cells in the model.

If you don't like the visual z-fighting that having lots of container planes in the model can cause, consider using the library from this post to give you more options on how they are depicted and how you interact with them.

5 |100000

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