question

Dennis_orlando_ Cc avatar image
0 Likes"
Dennis_orlando_ Cc asked Joerg Vogel commented

I need help with global tables.

1628546156393.png

So i have this diagram and i need to create a system with 3 different boxes, the first one need to go to processor 1,2, 3 then sink, the second box need to go to processor 1,2,4 and then sink and box number 3 needs to go to processor 2,3,4,5 and then sink.

The problem is that I need to do this sistem with global tables, i will appreciate any help!

FlexSim 21.2.0
global tableflexsim 21.2.0
1628546156393.png (62.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.

1 Answer

·
Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Joerg Vogel commented

If you must do it with global tables then it will probably be a student project. By academic integrity we are bound not to provide a model solution.
We can still help and give some hints. A table cell is an address by two numbers:

let us say the row number is static or has got a constant value, the column number is variable. You create at each item two labels. Please look for videos to learn what are labels. You can call them as you like. Typically the value for the row number is often called “Type”.
The second label is variable. You may call it “colmn”. The start value is for example 0. An On Entry trigger in the queue increment this value by one. you find a property to increment a label in the picklist of triggers. Please look yourself for the use of triggers or event driven activities in process flow. There are some tutorials dealing basic features in FlexSim in the manual.
If you have now two labels at each item, called “Type” and “colmn”. The label “colmn“ is incremented on entry event by trigger, then you can read a value in a global table called eg “myTable” in a cell:

Table(“myTable”)[item.Type][item.colmn]

This cell value can be directly the output port number the queue sends items to. The bold type is a direct hint for a function in a queue properties. Picklist properties can be “Port by case” or “by Expression”. The above code line seems to be a good choice for a field of those picklist properties. The first output port is addressed by 1, the second output port is addressed by 2, the third output port is addressed by 3, …

At each output you have connected your processors and a sink. If you want an item enters the sink, the table cell value must contain the number which port number of the queue leads to the sink.

now your project should be completed.

· 2
5 |100000

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

Dennis_orlando_ Cc avatar image Dennis_orlando_ Cc commented ·
Hi, do you now where can i find some examples of what you are explaining? because i been trying to do this model and its really hard for me, im new to the model and i´ve already taken the tutorials at the flexsim web but not about global tables


.
0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Dennis_orlando_ Cc commented ·

Please take a look into the references of the manual for global tables.

https://docs.flexsim.com/en/21.1/Reference/Tools/GlobalTables/

There is a FlexScript Class Reference, too.

https://docs.flexsim.com/en/21.1/Reference/CodingInFlexSim/FlexScriptAPIReference/FlexScriptClassReference.html

Therein is a Table Class.

https://docs.flexsim.com/en/21.1/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/Table.html

A table cell is node which you read or set by a row number and column number. It is similar to any table calculation program. Only the syntax defers.
table[row] [column] this is only a primitive example without any functional behavior.

You replace table by a reference to an existing global table name:

Table(“myTable”)[2][4] = 2.07;

This sets a value of 2.07 in the cell in row 2 fourth column.

double myValue = Table(“myTable”)[3][1];

This line of code reads a value of 3rd row first column and assign this to a variable called “myValue” as a double precision floating value.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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