question

Steven Chen avatar image
0 Likes"
Steven Chen asked Steven Chen edited

Uncertain Amount of Variables for OptQuest

Hello,

A model has several orders with different request amount and different product types.

Processors needs to setup while changing product type.

I try to arrange process schedule of orders to minimize total process.

For example, three products and three processors with different cycle time:

Order:

ItemA : 200

ItemB : 100

ItemC : 150

Solution 1:

ProcA-ItemA*200

ProcB-ItemB*100

ProcC-ItemC*150

Solution 2:

ProcA-ItemA*100

ProcB-ItemA*100

ProcC-ItemB*100

ProcA-ItemC*50

ProcB-ItemC*50

ProcC-ItemC*50

Is it possible way to make this as variable for OptQuest, so I may get best solution about how to schedule process?

FlexSim 17.0.3
optquest
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
0 Likes"
Jordan Johnson answered Steven Chen edited

We have clients that do this on a daily basis; the list of jobs comes in, and they use the optimizer to get the most effective sequence they should do the jobs. This allows them to know how many machines to use during that day.

It sounds like you are looking for the optimal sequence of orders, to maximize throughput or minimize total time to complete all orders. This is completely possible. First, you will need a table of orders, and their sequence. Something like this usually works:

OrderID Sequence
455 1
456 2
457 3
... ...

Once you have this table, make sure the model uses this table, meaning that it does orders in the sequence shown in the table.

So now your model will run any sequence you give it, even if that sequence is terrible. This is what the optimizer needs. To optimize the sequence of orders, you will need to add one variable per order. The value of that variable should be the value in the table. Make the type of that variable a permutation variable, which are used for sequences.

This setup works for an individual set of orders. If you want to optimize a new order sequence, you will need to update the table. You will also likely need to add or remove variables from the optimizer.

· 3
5 |100000

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

Steven Chen avatar image Steven Chen commented ·

@jordan.johnson, thanks for your help.

But I hope OptQuest can separate each one order into several sequences, I'm not sure if it can do it.

By the way, I notice there is a command "optquest()", maybe there is a way to add/remove variables of Experimenter by using program? So I can make it automatic once the orders table changed.

0 Likes 0 ·
Jordan Johnson avatar image Jordan Johnson ♦♦ Steven Chen commented ·

If the sequence of Orders is set (maybe first come, first serve?), and you want OptQuest to sequence the jobs within each order, this is possible. You can set the Group value on a permutation variable, so that each permutation variable belongs to a group. Each group will get it's own sequence.

If you want OptQuest to seqence the orders first, and then sequence the jobs within each order, you would use the group approach above, and add an additional group for the order sequence.

As far as automation goes, that is harder. The optquest() command assumes a certain node structure in the tree. All you should need to automate is making that node structure. Here are the steps, although there's a lot to figure out:

  1. Create the variables as experiment variables. You cannot create an optimization variable, unless it is tied to an experiment variable. I would make a single variable manually, look at it's structure in Tools/Experimenter/variables, and then write a script that re-creates that structure for as many variables as you need.
  2. Once all the experiment variables have been made, execute the node MAIN:/project/exec/optquest/definitionLogic/updateOptQuestVars. This code creates the corresponding optimizer variables.
  3. Set the type (Permutation) and group number nodes in each optimizer variable.

That should get you started. Also, if the structure of these nodes changes in a future version, you will need to update the script.

0 Likes 0 ·
Steven Chen avatar image Steven Chen Jordan Johnson ♦♦ commented ·

The count of orders is fixed, and count of jobs is uncertain. I was tried to make OptQuest to decide how many jobs is good. It's fine for now, I can schedule how many jobs by self and let QptQuest to sequence them. Thanks for your help!

0 Likes 0 ·