question

laitriminh avatar image
0 Likes"
laitriminh asked laitriminh commented

OptQuest equation

Hello everyone,

I'm facing an issue in finding the optimal position for 2 queues and 1 processor so that the average WIP (Work in Progress) at the upper two queues is minimized. The constraint here is that these 2 queues and 1 processor shouldn't overlap.

I asked the community and fortunately received suggestions on how to set up these constraints. However, when I start running the optimizer, the resulting .csv file shows that although the objective of minimizing the WIP at the two queues is achieved (Rank 1), the coordinates do not adhere to the constraints I set, causing objects to overlap.

I've attached the Flexsim file (version 2019) and some images, and I would greatly appreciate any help from the community.

best regard,

laitriminh


Cải tiến.fsm

1.png1.png

FlexSim 19.0.0
optquestoptimizer design
1.png (25.4 KiB)
1.png (22.7 KiB)
cai-tien.fsm (413.2 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.

1 Answer

·
Jordan Johnson avatar image
1 Like"
Jordan Johnson answered Joerg Vogel commented

Here is your full constraint equation:

   ([Q7 x] < [Q8 x] - 2) 
OR ([Q8 x] < [Q7 x] - 2) 
OR ([bon tam x] < [Q8 x] - 7.5) 
OR ([Q8 x] < [bon tam x] - 7.5) 
OR ([bon tam x] < [Q7 x] - 7.5) 
OR ([Q7 x] < [bon tam x] - 7.5)

Because you are using the OR operator, the solution counts as feasible if any of the terms in that expression are true. For example, if [Q7 x] < [Q8 x] - 2, then none of the other statements are checked, so there are no constraints on other parameters. My guess is you need to look more at using additional constraints in addition to OR.

Edit:

This answer originally recommended using AND. OptQuest doesn't support AND in constraint expressions. To achieve the same result, use more than one constraint. All constraints are AND-ed together. All constraints must be satisfied for a solution to be valid.

So in this case, you probably need three constraints.

([Q7 x] < [Q8 x] - 2 OR ([Q8 x] < [Q7 x] - 2) 
([bon tam x] < [Q8 x] - 7.5) OR ([Q8 x] < [bon tam x] - 7.5)
([bon tam x] < [Q7 x] - 7.5) OR ([Q7 x] < [bon tam x] - 7.5)
· 6
5 |100000

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

laitriminh avatar image laitriminh commented ·

Got the idea! Thank you

0 Likes 0 ·
laitriminh avatar image laitriminh commented ·

I've modified the equation as you suggested, but when I start running the optimization, I still encounter an 'Error Constraint Equation.' I'm not sure why this is happening.

1704325517132.png

1704325556826.png

0 Likes 0 ·
1704325517132.png (31.0 KiB)
1704325556826.png (25.1 KiB)
Joerg Vogel avatar image Joerg Vogel laitriminh commented ·

@laitriminh, Can you explore, which equation causes this error. Please add or remove parts of it until you can identify where this error happens.

EDIT: may I suggest that you use variable names without a space character in it. It seems odd, but there existed a period in time, when it was not allowed to use any possible sequence of characters for variable names. you can replace a space character by an underscore.

0 Likes 0 ·
laitriminh avatar image laitriminh Joerg Vogel commented ·

I removed the space. I tried each part individually, and the optimization engine worked fine. However, when I combined 2 or 3 parts together, I encountered an error called 'Constraint Equation Error'

1704361201168.png

  1. ([bx] < [q8x] - 7.5) OR ([q8x] < [bx] - 7.5)
  2. (([q7x] < [q8x] - 2) OR ([q8x] < [q7x] - 2)) AND (([bx] < [q8x] - 7.5) OR ([q8x] < [bx] - 7.5))
  3. (([q7x] < [q8x] - 2) OR ([q8x] < [q7x] - 2)) AND (([bx] < [q8x] - 7.5) OR ([q8x] < [bx] - 7.5)) AND (([bx] < [q7x] - 7.5) OR ([q7x] < [bx] - 7.5))

Section Equation 1 works fine, but when additional sections are added, there's an error in the constraint equation (Equations 2 and 3).

Cải tiến.fsm

1 Like 1 ·
1704361201168.png (20.1 KiB)
cai-tien.fsm (384.3 KiB)
Show more comments

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.