question

SudheerReddy avatar image
0 Likes"
SudheerReddy asked Ryan Clark commented

OptQuest to maximize the through put and minimize the Queue waiting time


Can we use optquest to max through put and min the waiting time of Queues1,2,3,4.

After processor 1 it neds to take a decison which queue to enter so that avg waiting time is min and maximizes the throughput

1630581619510.png


Seq.fsm

FlexSim 21.1.3
optquestflexsim 21.1.3
1630581619510.png (94.0 KiB)
seq.fsm (226.2 KiB)
· 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.

SudheerReddy avatar image SudheerReddy commented ·

@Jordan Johnson

After Processor 1 I need to choose out of 4 queues , one queue which ever queue is having less stay time average.

Can I choose option variable as shown in image. With four options to choose from ?

Below is the code I am trying to use for parameter in option variable

Model.find("Queue").as(Object).stats.staytime.average

How to proceed further in setting this parameter


1630599407097.png

0 Likes 0 ·
1630599407097.png (23.0 KiB)
Jordan Johnson avatar image Jordan Johnson ♦♦ SudheerReddy commented ·

Hi Sudheer, choosing the queue with the lowest average staytime is an algorithm, or logic built in to the model; it's not really an input parameter. If you have a group of queues, finding the queue with the lowest avg staytime can be done with code like this:

Array queues = Group("Group1").toFlatArray();
double minAvgStaytime = 0;
treenode minQueue;
for (int i = 1; i <= queues.length; i++) {
  Object queue = queues[i];
  double avgStaytime = queue.stats.staytime.average;
  if (i == 1 || avgStaytime < minAvgStaytime) {
    minAvgStaytime = avgStaytime;
    minQueue = queue;
  }
}

return minQueue;
1 Like 1 ·
SudheerReddy avatar image SudheerReddy Jordan Johnson ♦♦ commented ·
@Jordan Johnson yeah I understood know.

If Choose the Queue based on your logic, then we are automatically minimizing the avg staytime right then which in turn gives maximum through.

Then no need to use optquest in this scenario. Correct me if I am wrong

0 Likes 0 ·
Show more comments

1 Answer

Roi Sánchez avatar image
0 Likes"
Roi Sánchez answered Ryan Clark commented

Of course you can. You need to somehow create a variable that models the criteria to choose which queue to take after Processor1. This variable will be your input parameter. Then you need to create two performance measures: throughput of the line and waiting time in Queues.

After that, you just need to set up the Optimization study. For more info you can check this out:

· 2
5 |100000

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

Salma F2 avatar image Salma F2 commented ·

Exactely Roi I agree with this approach to find optimal solution using optquest. However I have a question about this new paradigm of Reinforcement learning and training the simulation model, I definetely do not understand why we need to use reinforcement learning to find optimlal solution while coupling simulation with optquest did provide good solution?

0 Likes 0 ·
Ryan Clark avatar image Ryan Clark Salma F2 commented ·

Hi @Salma F2,

Please post your question as a new post. This will make it easier for us to address your question. Please see Best practices for using this Answers site - FlexSim Community for more details.

Feel free to link to this post in your new question for clarity. Also feel free to use "@" to tag anyone on this post that you think would be able to help you answer your question. Thanks!

0 Likes 0 ·