question

sara S2 avatar image
0 Likes"
sara S2 asked sara S2 commented

How to set the index of the min value in array?

Hello,

How to set the index that corresponds to the position of the min value in a given array? (figure 1)

(FlexSim 19.0.0)

Regards.

trying1.fsm

Other
Other (please specify)
pull from listpuller
figure.png (39.5 KiB)
trying1.fsm (121.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

tannerp avatar image
1 Like"
tannerp answered sara S2 commented

@sara S2,

You can accomplish this through custom code as follows:

The problem is just that the SItemsType label is not currently an array. Once you make it an array, the code will work.

trying1 (2)_1.fsm


find-min-index.png (9.4 KiB)
1594157963832.png (9.9 KiB)
trying1-2-1.fsm (122.3 KiB)
· 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.

sara S2 avatar image sara S2 commented ·

@tanner.p, thank you for your help.

0 Likes 0 ·