How can I take the destination ports of an ítem using a Global table? Is just to decide if the ítem goes to the first or to the second processor.
How can I take the destination ports of an ítem using a Global table? Is just to decide if the ítem goes to the first or to the second processor.
It gets easier, if you add or replace the port column with number values instead of strings.
I set up the example model you attached to use port numbers as integers rather than strings, as per Jörg's suggestion. The row number of the table is determined by the "Type" label on the objects.
"myTab" Table to define an ID label at items and the output port for a queue.
partID | Port |
100 | 2 |
200 | 3 |
300 | 1 |
400 | 1 |
500 | 3 |
600 | 2 |
700 | 2 |
Add label "anID" On Creation in source at item with value:
Table("myTab")[duniform(1,Table("myTab").numRows)][1]
Here I choose randomly one of the value of column "partID"
Queue Tab Flow Function Send to Port:
Table.query("SELECT Port FROM myTab WHERE $1.anID = partID",item)[1][1]
Here I do a table query to get the port number by a match of anID label on item with partID in global table "myTab".
13 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved