Permutation not found in FlexSim 2021

Permutation not found in FlexSim 2021

tsuji_ryusuke
Advocate Advocate
212 Views
7 Replies
Message 1 of 8

Permutation not found in FlexSim 2021

tsuji_ryusuke
Advocate
Advocate

[ FlexSim 21.0.4 ]

I was doing OptQuest with permutations in FlexSim 2020.

39838-1622006055715.png


However, I noticed that FlexSim 2021 does not have permutation items.

In FlexSim 2021, I know that the setting information has been moved from the "Optimizer Design" tab to the "Model Parameter Table". However, I couldn't find it there either.

39839-1622006096247.png


How can I do OptQuest with permutations in FlexSim 2021?

Accepted solutions (1)
213 Views
7 Replies
Replies (7)
Message 2 of 8

JordanLJohnson
Autodesk
Autodesk
Accepted solution

You can use the Sequence variable. Instead of adding N permutation variables, you specify that the sequence length is N. OptQuest will see a single sequence variable as N permuation variables in a permuation group.

.


Jordan Johnson
Principal Software Engineer
>

Message 3 of 8

tsuji_ryusuke
Advocate
Advocate

@Jordan Johnson

Thank you for your reply. I have tried using sequence variable. But it didn't work.

I will attach the model created in 2020 and the model created in 2021.


I will explain the model.

Three types of objects are created in queue 1. The object is assigned the label "Type", but this information refers to the value in "Global Table 2".


The setup time of Processor1 is changed according to the Type information of the object set up immediately before. Refer to "Global Table 1" for setup time information.

For example, if the type of the object set up last time is "3" and the type of the object set up this time is "1", the setup time will be "5". The first time will be ignored.

40044-20210602-1.png

This is a scenario in which the OptQuest is used to rearrange the values in "Global Table 2" to find the combination that minimizes the setup time.

Am I doing something wrong with the FlexSIm 2021?

Permutation_2020.fsm

Permutation_2021.fsm

0 Likes
Message 4 of 8

JordanLJohnson
Autodesk
Autodesk

Here is a modified version of the model you sent:

permutation-2021_1.fsm

First, you don't need GlobalTable2 anymore. That table's purpose was to define the sequence of rows to use in GlobalTable1. Instead, you just need a single parameter. A sequence parameter holds all the values of the sequence, so you only need one. I set the Sequence Length to Table("GlobalTable1").numRows, so that the number of values in the sequence will match the number of rows in the table.

I renamed the first parameter "Sequence" and then I used it in the model with code like this:

Model.parameters.Sequence[3] // get the 3rd sequence value

A sequence parameter's value is an array, so you can get any of the values of that array, anywhere in your model.

Then I set up an experiment to demonstrate how you change the whole sequence for a single parameter value.

Let me know if that makes sense.

.


Jordan Johnson
Principal Software Engineer
>

0 Likes
Message 5 of 8

tsuji_ryusuke
Advocate
Advocate

@Jordan Johnson

Thank you for your reply. This solution is all I wanted to know!

This content was very helpful.


I'm really thankful to you!

0 Likes
Message 6 of 8

tsuji_ryusuke
Advocate
Advocate

@Jordan Johnson

I have additional questions.


Model.parameters.Sequence [3] // get the 3rd sequence value

Is it possible to define this as a variable using Flexscript?


I wrote the following but it didn't work.

Model.parameters ["Sequence"]. evaluate (3)


Do you have any good advice?

0 Likes
Message 7 of 8

tsuji_ryusuke
Advocate
Advocate

@Jordan Johnson

I was able to resolve myself.

It worked with the following description.

Model.parameters ["Sequence"]. evaluate () [3]


Thank you very much.

Message 8 of 8

JordanLJohnson
Autodesk
Autodesk

In your case,

Model.parameters["Sequence"].value[3]

would also work

.


Jordan Johnson
Principal Software Engineer
>

0 Likes