anon-user avatar image
anon-user asked Jeanette F commented

 Optimizer is not taking constraint in consideration.

Hi Flexsim Team,

I am facing issues while adding constraints to the model. I want to get the best-optimized sequence but after adding colorsequence parameter as constant the optimizer is not working.

In the HCM_ColourChangePlanning table column no 63 and 64 have values 0,1 and the constraint is to take all 1 value first in the sequence. I have added this constraint value to performancemesure3 from parameter 15 and applied it in the Optquest but Otmizer results are not acceptable.

For this logic, I have written the code in the process flow attaching the image below.

Could you please help me with how can I make it work to optimizer?

Thanks and Regards,

Brijesh Kumar

1682577193062.pngImage Caption

FlexSim 22.2.4
· 4
5 |100000

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

anon-user avatar image anon-user commented ·
0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ anon-user commented ·
Have you tried using ==0 for the constraint instead of =0?
0 Likes 0 ·
anon-user avatar image anon-user Jason Lightfoot ♦ commented ·
Yes, but still not working.
0 Likes 0 ·
Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi anonymous user, was Jordan Johnson's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Jordan Johnson avatar image
Jordan Johnson answered

All parameters are constant unless you include them in the optimization. Only the parameters you check are allowed to be modified by the optimizer. The easiest way to set a constant is to set the parameter in the model before you run the optimization, and don't include it in the optimization.

Another approach would be to include the parameter in the optimization and write a constraint equation involving the parameter, not the performance measure

[MyParameter] <= 1

If you write a constraint equation using a performance measure, OptQuest has to simulate the solution and then determine if the solution violates constraints. If you write a constraint equation based on parameters, OptQuest can tell that the solution violates the constraint before running a simulation.

Also, you may notice that I used a <= operator and not an = operator. There is a note in FlexSim's user manual that for the version of OptQuest we use, constraints can only contain <= or >= comparisons, so an exact match comparison is not supported.

Here is the closest link:

The note is in the section called Adding Constraints.

5 |100000

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

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.