question

AmyTsai avatar image
0 Likes"
AmyTsai asked Felix Möhlmann commented

Multiple Objectives in Optimization: Max Output & Min Stay Time

Dear FlexSim Community,

In my current model, I am using Optimization 5, where the objective is set to maximize output. However, I would like to add another objective—to minimize stay time—so that the optimization process considers both factors simultaneously.

Is it possible to define multiple objectives in the optimization settings? If so, how should I configure the objective column to include minimizing stay time? Are there any additional settings or adjustments I need to make to achieve this?

I appreciate any guidance or insights you can provide. Thank you in advance for your help! jobshop Experimenter 27 SC3.fsm

FlexSim 22.2.0
optimization
5 |100000

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

AmyTsai avatar image
0 Likes"
AmyTsai answered Felix Möhlmann commented

@Felix Möhlmann

Many thanks for your advice.

I try to add staytime function that you suggest as below but system display " Error in objective function equation". Did I use the wrong format?

2025-04-02.png

I appreciate any guidance or insights you can provide. Thank you in advance for your help!



2025-04-02.png (4.7 KiB)
· 5
5 |100000

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

Felix Möhlmann avatar image Felix Möhlmann commented ·
Do you have a performance measure called "Staytime PFM(ELM100)"? Other than that I can't say what's wrong without seeing the model.
0 Likes 0 ·
AmyTsai avatar image AmyTsai Felix Möhlmann commented ·

Thank you very much for your helpful response and clarification.

At the moment, I haven’t included stay time in the parameters, which is why I’m unable to select it as a PFM objective in the optimization settings. May I ask how I can add stay time as a parameter so that it appears and can be used as one of the objective functions?

Additionally, I would like to add the third objective—minimizing the number of product changeovers. Specifically, I’d like to measure and reduce how often a station switches from processing one product type (e.g., Product A) to another (e.g., Product B). Each switch would count as one product change, and my goal is to minimize the total number of these changes.

In total, I’m hoping to set three objectives in Optimization 5: maximize output, minimize stay time, and minimize product changeovers. Would this be possible, and do you have any recommendations on how to implement this setup?

Thank you again for your time and support. I really appreciate your guidance as we continue working on our model. jobshop Experimenter 27 SC3 -最佳化.fsm

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann AmyTsai commented ·

Staytime is available as a statistic on each fixed resource and you can use the sampling tool to add it as a performance measure. If you want to measure the staytime over multiple objects, use a (Composite) Staytime Chart and sample that for the PFM.

capture1.png

For the number of changeovers you could use the "If Label Value Changes" option for the setup time as a 'hook'. You can leave the time at 0. Choosing the option is an easy way to get code that checks if the type changed though. In that code you can add a line that increments a label on the object or a global variable. A performance measure can then read that label/global variable.

jobshop-experimenter-27-sc3-1.fsm

0 Likes 0 ·
Show more comments
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

You can just add a second objective to the optimization job. It will try to find optimal scenarios for both and mark scenarios that represent 'good' tradeoffs.

1743578746439.png

https://docs.flexsim.com/en/25.0/GettingData/AdvancedDataGathering/RunningJobs/RunningJobs.html#opt

Putting both types of performance measure into a single objective function would also be possible if you have specific values in mind of how the output and staytime should be weighted respectively.


1743578746439.png (8.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.