Best way to create parameters for this schedule?

Best way to create parameters for this schedule?

rajankur6494
Advocate Advocate
74 Views
6 Replies
Message 1 of 7

Best way to create parameters for this schedule?

rajankur6494
Advocate
Advocate

[ FlexSim 23.1.2 ]

Hi Team,

I am working on schedule optimization problem where there are 10 flavors and each flavor is having 10 variants. There is a changeover time associated when there is a switch from one variant to other variant or one flavor to another flavor. We have the changeover matrix to find the changeover time as below:

1721717312910.png

I would like to use the optimizer in this problem. As far as I know that we can use a sequence type parameter with length of 100 (10*10) as below:

1721717636728.pngand let the optimizer decide the best sequence but I don't think that it is the best way to use optimizer.

I would like to know if there are some alternate ways to create the parameter and use the optimizer.

Thank you!

0 Likes
Accepted solutions (1)
75 Views
6 Replies
Replies (6)
Message 2 of 7

moehlmann_fe
Explorer
Explorer
Accepted solution

How do the changeober items work when both the variant and the flavour change. Do they add up? If so then it likely doesn't make sense to ever change both at the same time. Since a flavour change takes more time across the board than a variant change, you'd change to a new flavour, run all variants within that flavour and then change the flavour again.

This means you'd only need a sequence of flavours and a sequence of variants within each flavour. At 'only' 10! permuations each, you can find the the best sequence for each numerically in very little time.

If only the larger time is counted when both are changed, only changing flavour when absolutely necessary still holds true. But you could change the variant at the same time without time loss, potentially allowing for a more optimal variant sequence with the next flavour.

Message 3 of 7

rajankur6494
Advocate
Advocate

Hi @Felix Möhlmann,

In case where both (flavor and variant) changes are happening at the same time, flavor change will be dominant.

Do you mean that we can create a 2 sequence as parameter- 1 for flavor and 1 for variant and we can use optimizer to get the best sequence?

Also, when I am saying 10 variants per flavor, this is the max number but there are flavor having variants 6, 7, 8 and 9 as well.

Thanks for your quick response!

0 Likes
Message 4 of 7

moehlmann_fe
Explorer
Explorer

As long as minimizing the changeover times is the only concern yes, because as I said, I don't see any point to switch between flavours if not all variants of the current flavour are done yet.

And with a sequence of 10, you don't really even need the optimizer. The number of permutations is low enough to test all of them and get the optimal sequence right away.

The attached model contains example code that finds the sequence with the least changeover time.

best-order-fm.fsm

For flavours with fewer variants you'd just remove the non-valid numbers from the initial sequence array.

0 Likes
Message 5 of 7

rajankur6494
Advocate
Advocate

Hi @Felix Möhlmann,

Thanks for your support!

I am checking on the script.

It is little difficult to understand these lines of code. May be this is new way to get all the possible permutations. I would appreciate if you could explain it better.

1722516304970.png


Thank you!

0 Likes
Message 6 of 7

moehlmann_fe
Explorer
Explorer

Your guess is correct, this code builds the sequence that corresponds to the current permutation number. If you have an N numbers you can arrange them in N! (N factorial = 1*2*3*4*...*N) different ways.

As an example, let's assume we have four numbers [1, 2, 3, 4] (N = 4) which gives us 24 permutations. To get the permulation 17th permutation, for example, the code does the following:

There are four possibilities which number is chosen for the first spot in the sequence, which in this case is determined by which 'bracket' the permutation number falls into - 1-6, 7-12, 13-18, 19-24. As you might notice, the bracket size is 6 = 3! = (N-1)! which is what the "divisor" variable in the code is. By dividing our permutation number by it and rounding up to the nearest integer, we get the bracket number, in this case Math.ceil(17/6) = 3. So the third number in the base sequence will be the first number in this permutation.

To continue this until all numbers have been chosen, we now subtract from our permutation number, so that it now falls into the range [1, (N-1)!] and can be used as before but shifting N down by one. We also remove the chosen number from the base sequence and are thus left with [1, 2, 4].

The number in our example would become 17 - 6*(3-1) = 5. (This is equivalent to the modulo operation ((17-1)%6)+1) We continue by dividing this by 2!. Which is again 3, so we choose the third number in our remaining base sequence, the 4.

We subtract from the permutation number again and get 5 - 2*(3-1) = 1. So next we choose the first number and there is only one left.

The 17th permutation would thus be [3, 4, 1, 2]. Using this algorithm we get all possible permutations in a 'neat' order.

1722517946672.png

0 Likes
Message 7 of 7

rajankur6494
Advocate
Advocate

Perfect!

Thank a lot! @Felix Möhlmann

0 Likes