OptQuest Optimization
OptQuest Optimization
OptQuest Optimization
OptQuest
Investigating every possible scenario can be extremely time-consuming and in many cases, impossible. OptQuest for Flexsim replaces the inaccuracy of trial-and-error with a potent search engine that pinpoints the best decision. Users can quickly determine what combination of variables results in achieving their objectives. OptQuest incorporates metaheuristics to guide its search algorithm toward better solutions. This approach remembers which solutions worked well and recombines them into new, better solutions. In addition, this technique does not get trapped in local solutions or get thrown off course by noisy (uncertain) model data.
Metaheuristics
Metaheuristics is a family of optimization approaches Metaheuristics that includes scatter search, genetic algorithms, simulated annealing, Tabu search, and their hybrids. Tabu search uses search history and memory uses management to guide the problem-solving process. In its simplest form, memory prohibits the search from reinvestigating solutions that have already been evaluated. In OptQuest, memory functions encourage search diversification and intensification. These memory components divert the search from locally optimal solutions to find a globally optimal solutions. Scatter Search is population-based metaheuristic that Scatter Search operates on a collection of reference points with the goal of finding high-quality solutions to an optimization problem.
Decision Variables
The first part of designing an optimization is to define the decision part of designing an optimization is to define the variables for the model. The main decision variables for an optimization can usually be chosen by restating the problem you want to solve. For example, one problem may be: how many machines do we need in this area to get the best throughput? This statement defines the decision variables for the model, the maximum content value of the processor, and the throughput value of the model. Note that these two variables have different roles. The maximum content is a value we want to change and experiment with, while the throughput is our feedback, reflecting the results of our changes. Examples of decision variable could be; number of forklifts required, the speed of the conveyors, batch size or racks capacity.
Decision Variables
To add a decision variable, click on the Add button in the Variables panel. This adds a new variable to the variables table. Select this variable by selecting any cell on the row of the new variable, then click the Modify button. This brings up a window to edit this new variable. Each decision variable has an associated name, which will be used by OptQuest. Each variable also has an associated type, like continuous, integer, or user-controlled. User-controlled variables are the "feedback" variables. They are not changed by the OptQuest experimentation, but are used as output variables to get feedback for how well different scenarios do. All other variable types will be changed and experimented with during the optimization.
Decision Variables
Once you have specified the variable name and type, click on the Browse button to associate this variable with a node in the model. This will open a Tree Browse window to select the node that holds this maximum content value. You must select a node that has number data on it, or the optimization will not work properly.
Constraints
Once you have defined your decision variables, you will want to define constraints for the optimization. During the optimization, the optimizer constraints During the optimization, the optimizer will try several scenarios on the decision variables. Constraints are used to nullify certain scenarios if these constraints are not properly met, so that the optimizer doesn't choose an invalid scenario as the optimum. Each constraint has an expression, such as : Production > 1000 IdlePercentage <= 0.10 TotalCost < 350000 To add a constraint, press the Add button, and then fill in the equations button, column.
Objective Function
The objective function is an expression that you want to maximize or function is an expression that you want to minimize. This could be a simple expression like "Throughput" if you have a decision variable called Throughput. It could also be a revenue vs. cost estimation. For example, if each product produced yields $5.00, and the cost for each machine (weighted by the length of the simulation run) is $50, then the objective function could be "(Throughput*5.00) - (MaxNrofProcessors*50.00)". Some other examples are: Maximize Profits Minimize Picking Times Maximize Production and Minimize WIP
Stop Conditions
Maximum Time for Optimization This is the maximum real time that the optimizer will spend in its optimization. AutoStop If this box is checked, the AutoStop If this box is checked, optimization stops when the value of the objective function stops improving. The Flexsim current setting is to stop when the objective function value of the best solution found does not vary by at least 0.0001 after 100 iterations.
Scenarios
Maximum Scenarios this is the maximum number of different scenarios that the optimizer will try. A scenario is one configuration in the optimizer's search. Current Scenario this is the current scenario number being tested. Current Scenario this is the current scenario number being tested. Current Solution this is the value of the objective function for the Current Solution this is the value of the objective function for current scenario. Best Solution this is the value of the object function for the best the object scenario so far. Simulation Time per Scenario/Real Time per Scenario this is the Time per Scenario/Real Time per Scenario maximum simulation time that the optimizer will spend for each scenario. The optimizer stops a scenario as soon as this is met.
Replications
If you want to run the simulation several times for a given scenario to increase confidence of the mean of the objective function, use the Replications panel to specify how many replications to run.
Perform multiple replications per scenario if this box is checked, the scenario optimizer will perform more that one replication per scenario. Minimum number of replications this is the minimum number of replications to run for each scenario. If there is no Early Exit Criterion then the optimizer will always run the minimum number of replications.
Replications
Maximum number of replications this is the maximum number of replications to run for each scenario. If there is an Early Exit Criterion then the optimizer will run the scenario until the criterion is met, up to this maximum number, after which the optimizer will stop the scenario. Early Exit Criterion this allows the optimizer to stop running further Early Exit Criterion replications for the same scenario, based on the criteria you select. If you've selected "Confidence Interval Satisfied" the optimizer will stop replications once it can determine the objective function's true mean for the scenario with the given confidence and error percentages. For example if you specify an 80% confidence and a 5% error, then the optimizer will stop running replications as soon as it is 80% confident that the true mean of the objective function is within 5% of the mean sampled. If "Best Solution Outside Confidence" is chosen, then the optimizer will stop replications for a given scenario if it can determine, within the given confidence and allowable error percentages, that the best solution can never be met with this scenario.
Optimizing
Once you have configured the parameters, press the Apply button to apply your configuration, then press the Optimize button, and wait until a message appears telling you that the optimization has finished and don't do anything until the optimization has finished.
How many machines of each type do I need to accomplish the maximum profit?
The models has 2 processes. The first part of the process can use two different type of machines, machines type A (up to 7 of them) or machines type B (up to 5) . Each kind has a different process time and operational cost. The faster machines are also the most expensive. At the last part of the process only one kind of machines could be used, machines type C (up to 8) . The inventory between the first and the second process remains under 31 flowitems due to space constraints. As an assumption all the products are sold when finished.
Sale price per unit= $45. Sale price per unit= $45.
Type B machines for the first process. Type B machines for the first process. Process Time= 108 seconds. Process Time= 108 seconds. Operation cost per hour = $2,600 pesos. Operation cost per hour = $2,600 pesos. Quantity of machines = 1 to 5. Quantity of machines = 1 to 5.
The best solution automatically found: The best solution automatically found: Use 5 type A machines, 2 type B and 8 type C to get a production Use 5 type A machines, 2 type B and 8 type C to get a production of 2,186 units with a profit of $47,570 pesos. of 2,186 units with a profit of $47,570 pesos.
Data from the last scenario analyzed. Data from the last scenario analyzed.
Minimum and maximum range of the Minimum and maximum range of the quantity of machines to be evaluated. quantity of machines to be evaluated.
Objective Function: Maximize Profit Objective Function: Maximize Profit Profit = Incomes Operational Cost Profit = Incomes Operational Cost Sale Price per unit = $45.00 pesos Sale Price per unit = $45.00 pesos Operational Cost: Machine type A = $4,000 Operational Cost: Machine type A = $4,000 Machine type B = $2,600 Machine type B = $2,600 Machine type C = $3,200 Machine type C = $3,200
After a few minutes 280 different scenarios were After a few minutes 280 different scenarios were analyzed in order to find the biggest profit: analyzed in order to find the biggest profit: $47,570 (Best Solution) $47,570 (Best Solution)
The last analyzed scenario showed The last analyzed scenario showed a lost of $5,540 pesos per hour a lost of $5,540 pesos per hour
Model Layout
Global Table
Continue
// text variable for storign the names of the outpot port objects connected to this object: string compare_name; // were creating a foor loop which be repetead as many times as the total output ports // numbers of this object or until the destination output number is found for(int index=1; index<=total_output_ports; index++) { // this variable stores the name of the object with the output number "index": compare_name = getname(outobject(current,index)); // if the name of the output object match the name of the next destination from the // table... if(comparetext(compare_name,next_process_name)==1) { destination = index; // then the destination is found (which is correct // output port number) index = total_output_ports; // this breaks the loop condition in order to // exit from it } // if the destionation is not found and all the possible loops were evaluated... if(destination==0 && index==total_output_ports) { // we send a warning message with some information of where the error could be found // and stop the model run. if(msg(concat("Routing not found for product ", numtostring(getitemtype(item),0,0)), concat("Check name on column ", numtostring(column,0,0)," of the table ", table, ". Verify that all the outpot connections are properly set from the object", getname(current)))==1) stop(); } } return destination; // returns the next destination output port number
Finish
Any additional questions you may have are always welcome: jorgetoucet@flexsim.com.mx