question

Sia Sengchoon193 avatar image
0 Likes"
Sia Sengchoon193 asked Sia Sengchoon193 edited

Can built-in parameter function parameterize the content presented by coding?

I would like to ask if it is possible to use the built-in parameterization function of flexsim to parameterize the content presented by coding? such as table content

Will it work? What is the effect and what will be the impact?

1656353528065.png

The table above is written and presented in coding, mainly to adjust the number of machines

Below is the built-in parameterized form of flexsim, and his source reference is linked above.

1656353695028.png

1656353718568.png

But when running optimization, this error screen occasionally pops up, but it should be a naming problem, and it should be solved very well

ok one.fsm

FlexSim 21.1.5
parametersflexscript codingparameter
1656353528065.png (180.5 KiB)
1656353695028.png (183.4 KiB)
1656353718568.png (260.4 KiB)
ok-one.fsm (358.9 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

·
Kavika F avatar image
1 Like"
Kavika F answered Sia Sengchoon193 edited

Hey @Sia Sengchoon193, you've got some errors to clean up that may point you in the right direction. When resetting the model, I got these:

exception: FlexScript exception: Invalid down cast. Object is not an instance of the target type. at MODEL:/Tools/ParameterTables/Parameters2>variables/parameters/1/Value/onSet
exception: FlexScript exception: Invalid down cast. Object is not an instance of the target type. at MODEL:/Tools/ParameterTables/Parameters2>variables/parameters/2/Value/onSet
exception: FlexScript exception: Invalid down cast. Object is not an instance of the target type. at MODEL:/Tools/ParameterTables/Parameters2>variables/parameters/3/Value/onSet

This tells me that there's something going wrong with my values in my Parameters2 table. After checking them, it seems you're trying to Delete and Copy Group Members, but the reference for these parameters doesn't go to a group - it goes to a Global Table. If you want to manipulate how many members there are of a group, you don't need to use a Global Table - you can simply use parameters and attach their references to a group.

Add all objects of the same time to a group that you want to parameterize (i.e., all openers in a group). Then in the Parameters2 table, open the variable's properties and click the dropper next to the reference. Select the group from the toolbox and click Delete and Copy Group Members. This will make it so that as you change the parameter, the number of copies of that object are created.

1656370150441.pngWhen you change the parameter and reset the model, all the copies will be stacked on top of each other, but rest assured that they're all there. You can drag them apart from each other if you want to, but when you run the experimenter, it should be able to alter those parameters while running to get you the optimizations you desire.

1656370450561.png

solution.fsm


1656370450561.png (28.5 KiB)
1656370173242.png (178.1 KiB)
solution.fsm (350.8 KiB)
· 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.

Sia Sengchoon193 avatar image Sia Sengchoon193 commented ·

@Kavika F

That's right, when I change the parameters and reset the model, all copies will be stacked on top of each other, that's why I use coding haha, just to solve this problem

But after using coding, there is no way to use the built-in functions of flexsim to parameterize and optimize

0 Likes 0 ·
Kavika F avatar image Kavika F ♦ Sia Sengchoon193 commented ·
Sorry I don't understand what you're trying to say. Are you using FlexScript to change positions of the copies? And what built-in functions are you trying to use to parameterize and optimize that can't be used because of said coding?
0 Likes 0 ·
Sia Sengchoon193 avatar image Sia Sengchoon193 Kavika F ♦ commented ·

@Kavika F yes, but I figured out that it's better to parameterize the object directly, not the table

Thank you very much for your answer though, it's very helpful and inspired me a lot

1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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