question

Mohamed Eldakroury avatar image
0 Likes"
Mohamed Eldakroury asked Mohamed Eldakroury commented

Process times by lookup table and a parameter

ProcessTimeLookup.fsmI am trying to vary the cycle time of a processor based on number of operators using a global table lookup table. The goal is to achieve faster processing times when I set up my parameter to a higher value. Here is how I did it.

- I named my table rows similar to the processor names and I use current.name to find the table row.

- I am using a parameter (NumOperators) that controls the number of operators. I use that parameter to lookup the column number. If the parameter is equals to 2, I want to go get the cycle times from column 2, and so on.

- I want to use triangular distribution for the cycle times, so I changed the table data type to Flexscript and I pasted the code from another dummy processor that uses a triangular distribution (I am no expert in Flexscript, so probably this is not the best practice here since I'm getting errors.

I am getting "FlexScript exception: Property "dataType" accessed on invalid node. at <no path>" Error

There is probably a better way to do what I want to do. This is not the main model. My model is much larger and have 30+ processors and I am trying to find a good practice to lookup the table for every processor without have to manually change the cycle time data for every processor.

Please let me know if I'm on the right path or if there's a smarter/easier way to do that.

FlexSim 23.2.2
global table
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

Regan Blackett avatar image
0 Likes"
Regan Blackett answered Mohamed Eldakroury commented

@Mohamed Eldakroury the errors you are seeing relate to the code in your table being lifted from an object event. There is some extra stuff in there that assumes the code is executing from an object that doesn't apply in a table cell. Specifically reference to the Object variables 'current' and 'item' and how those references are created via code are not valid.

When using a distribution in an object's properties, the menu options also include a call to 'getstream(current)' as the final parameter of the distribution. This sets the random number stream used by the distribution to be set by the object. This also doesn't apply to a table cell, and should be replaced with a unique number for the Wiring and Inspection machines. In your table cells you just need the call to the triangular expression like this:

  1. triangular(5, 15, 10, 1)
· 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.