question

Howard avatar image
0 Likes"
Howard asked Howard commented

How do I pull a group of operators by global table lookup?

I have dedicated group of operator that can only work in specific processor. For example, GroupOperator 5 operators can only work in Processor5.

How do I use a Globle Table lookup for how many people is needed by each task and pull the number of operators in the operator group?

1723498082597.png

globaltabledemohr-globallist-add headcount by task.fsm

FlexSim 24.1.1
acquire resource
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

Jon Abbott avatar image
0 Likes"
Jon Abbott answered Howard commented

To calculate the number of operators in each group, it helps to first set up a new group that includes each group you are interested in counting, and create a new Global Table to store these counts. From there, you can use code like what is in the attached model to count the number of operators in each group, and add it to the new Global Table:

Table operator_table = Table("GlobalTable1");
operator_table.setSize(Group("OperatorGroups").length,2); for(int i=1; i<=Group("OperatorGroups").length; i++) {     operator_table[i][1] = Group("OperatorGroups")[i].name; // name of group     operator_table[i][2] = Group("OperatorGroups")[i].as(Group).length; // number of elements in group }

To count the number of people needed to complete a task using your existing table GlobalTable2_Routing, you can use SQL code like the following:

Table.query("SELECT [Persons Needed] FROM GlobalTable2_Routing WHERE ItemName == $1 AND Destination == $2","Product5","Queue6")[1][1]

Similarly, you can retrieve the operator counts from the new Global Table using code like the following, if the first column in GlobalTable1 is named GroupName and the second column is named CountOfOperators:

Table.query("SELECT [CountOfOperators] FROM GlobalTable1 WHERE GroupName == $1","GroupOperator5")[1][1]

globaltabledemohr-globallist-add-headcount-by-task2.fsm


· 10
5 |100000

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

Howard avatar image Howard commented ·

Hi Jon,

These code does the lookup part for how many people is needed in the global table.

How do I use the number of person needed data and call out the number of operator needed in the 3D environment?

Do I put the code in the Processor's call out for the number of operator?

1723644313432.png

0 Likes 0 ·
1723644313432.png (17.2 KiB)
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Howard commented ·

You could try dynamically setting the property "NumProcessOperators" as part of the setup time code:

current.setProperty("NumProcessOperators",numOperators_var)

where you've looked up the number you need and stored it in the variable numOperators_var


1 Like 1 ·
Jon Abbott avatar image Jon Abbott Jason Lightfoot ♦♦ commented ·

The following code will look up the number of operators needed using your GlobalTable2_Routing table, and would work directly above the line @Jason Lightfoot shared:

Variant numOperators_var = Table.query("SELECT [Persons Needed] FROM GlobalTable2_Routing WHERE Destination == $1 AND ItemName == $2",current.inObjects[1].name,item.name)[1][1];

This assumes that each processor only has one queue feeding into it, which your model currently does. Hope this helps!

0 Likes 0 ·
Show more comments