How to define Constraints?
FlexSim does not like the 4,5,8
How to define Constraints?
FlexSim does not like the 4,5,8
OptQuest doesn't allow you to specify a "not equal to" constraint.
Comparisons allowed by OptQuest for constraints are greater-than-or-equal to (>=) and less-than-or-equal-to (<=).
Given these rules imposed by the underlying optimization engine, I can't think of a way to implement your constraint requirements as-is.
Constraints are actually a less efficient way to disallow certain input, anyway, because the optimizer will still use the full range of [Variable1] when generating solutions, and then compare those solutions against the defined constraints, throwing out solutions that are out of bounds, thereby wasting the time it took to find that solution.
A more efficient approach will require you to modify your model logic a bit, but will work and also scale better.
Instead of defining your input data in terms of constraints, better would be not to include bad values as inputs at all.
Say your [Variable1] is a label, and valid values are [1, 2, 6, 7, 9, 10]. Right now you're allowing the optimizer to directly set values 1-10 on your label, then generate solutions for all these values, than throw out those that don't meet the constraint criteria. Better would be to use a table to map from the value chosen by OptQuest to the set of valid inputs that you define:
1 | 1 |
2 | 2 |
3 | 6 |
4 | 7 |
5 | 9 |
6 | 10 |
OptQuest could still reference [Variable1] as that same label, but you change the variable bounds to 1-6. Then instead of using the label's value directly, anywhere that you referred to that label, you would instead do a table lookup, using the label value as the lookup row:
MyTable[labelval][1]
In this way you are mapping the optimizer's chosen value to a set of valid inputs.
Comment back if you have any questions.
Anywhere that you referred to that label's value, you would instead do a table lookup, using the label's value as the row of the lookup.
@Ben Wilson
example.fsm
Some product can not do some machines
I use pull strategy
EX. Product1 can use machine 1, 2, 6, 7, 9, 10
Product2 can use machine 1, 2, 5, 6, 8, 10
I do not know where to put the code you put into the model. Can you give me an example.
Regards
7 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved