question

Omar Aguilera Rico avatar image
0 Likes"
Omar Aguilera Rico asked Allister Wilson edited

Change of variables in optimizer design by code

Hi. The code that is shown in the Script window is to modify the Type, Lower Bound, Upper Bound, Step, Group but only changes the Type. Because it does not change Lower Bound, Upper Bound, Step, Group to "N / A", since I'm assigning it with setnodestr (). Is something wrong or is it with another command? Apparently it does not change the type of numeric cell to string.

binary-dont-change.fsm

FlexSim 19.0.2
codeoptimizeroptimizer design
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

Allister Wilson avatar image
1 Like"
Allister Wilson answered Allister Wilson edited

You can see how the optimiser GUI handles it by right clicking in the experimenter window / View / Explore Structure.

Once you're in the tree view for the experimenter window, take a look at experimentcontrol/tabcontrol/Optimizer Design/Variables/TheTable/Choose>menupopup, that node contains subnodes for each variable type with the code that's run when you select the type from the dropdown.

It looks like it sets the Type value as a string, then calls the UpdateFields event function on the table view (experimentcontrol/tabcontrol/Optimizer Design/Variables/TheTable>eventfunctions/UpdateFields).
That function in turn, sets up the other cells depending on the selected variable type, you could execute that function yourself, or extract the functionality you need from it.

5 |100000

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