question

Sunny avatar image
0 Likes"
Sunny asked Steven Hamoen commented

Is it possible to lookup Global Table that a cell has multiple value?

Hello,everyone! This passage is asking help for the global table .

At the model ,the items enters into different machine according to the Global Table- "Steps ".The numbers in table represent which machine items would enter.I have tried to use the itemlist to realize this with only one number at one cell.

I wonder is it possible to lookup Global Table that a cell has multiple value?

For example ,if we could look up the Global Table like the following Table in FlexSim to control the number of Machine and the process time .

Is it possible to lookup Global Table in FlexSim that a cell has multiple value?

Thanks for your reply in advance!

FlexSim 19.0.0
global tablelookup
ao96j.png (9.4 KiB)
j5ep6.png (8.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.

Steven Hamoen avatar image
1 Like"
Steven Hamoen answered Steven Hamoen commented

@Sunny

The problem is that your array is not always 2 but sometimes also 1. So you should first get the size of your array and use that size in the random function. So your code could look something like this:

  1. int arraySize = Table("Step")[value.Type][value.process].as(Array).length;
  2.  
  3. int theMachine = duniform(1, arraySize);
  4.  
  5. int arraySize = Table("Step")[value.Type][value.process].as(Array)[theMachine];
· 8
5 |100000

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

Steven Hamoen avatar image
0 Likes"
Steven Hamoen answered Sunny commented

@Sunny

I think you should solve it like this:

  1. return Table("Step")[value.Type][value.process].as(Array)[1]

Of course the last 1 could also be 2 if you want to get the 2nd value out of the array

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

Steven Hamoen avatar image
0 Likes"
Steven Hamoen answered Sunny edited

@Sunny Looks like you are looking for a multidimension table. I think there are at least 2 solutions:

1. Use an array to put in a global table: (this could actually also be done with a list)

2. Use the treestructure of a table to actually generate a real 3 dimensional table:


arrayintable.png (5.9 KiB)
treeintable.png (8.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.