question

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

Reference parameters in global table and parameter tables

I'm trying to reference a given parameter into multiple places.

1. I want to make a new parameter that refers to another parameter. When I set NumOfPeople value manually to a given number, I want NumOfMachines_Calculated to be automatically set to a given number (Let's say I want them to be equal or I want to divide the main parameter by 2).


2. I also want to do the same thing in a global table. I tried setting the data table values type to Flexscript and use Model.parameters.NumOfPeople to obtain the parameter value but the values never change.


Please see the attached file


1707161649089.png



1707161672556.png



I assume something needs to trigger the values toReferencingParameters.fsm change?

FlexSim 23.2.2
setting a parameter
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

Felix Möhlmann avatar image
2 Likes"
Felix Möhlmann answered Mohamed Eldakroury commented

1. In the On Set code of the NumOfPeople parameter add a line that sets the calculated parameter to the value you want.

For example:

1707204447298.png

2. This works correctly how you set it up. If you read Table("GlobalTable1")[1][1] the returned value will be the parameter.

1707204549925.png


1707204447298.png (12.4 KiB)
1707204549925.png (5.4 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.

Mohamed Eldakroury avatar image Mohamed Eldakroury commented ·

Thank you, that worked!

0 Likes 0 ·