| Quintiq file version 2.0 | 
| #parent: #root | 
| Method RunBenchmarking ( | 
|   LibOBT_RunTask runtask, | 
|   Strategy strategy, | 
|   LibOBT_RunTaskSetting setting | 
| ) | 
| { | 
|   TextBody: | 
|   [* | 
|     this.CleanData();  | 
|     Transaction::Transaction().Propagate(); // removing some operations - need to update all  | 
|     this.Optimization().TempAlgorithmRunStore().AlgorithmRun( relflush );  | 
|     this.DuplicateStrategySettings( strategy, false /* not re-using strategy macroplan*/ );  | 
|     this.Optimization().IsForcedNoAutoScaling( true ); // no scaling | 
|      | 
|     // Update the optimizer status to running | 
|     sm := Util::GetScenarioManagerStream();  | 
|     sm->UpdateScenarioOptimizerStatus( this.MDSID(), Translations::MP_GlobalParameters_GetOptimizerRunningStatus(), "", "" ); | 
|      | 
|      | 
|     // Since it is a benchmarking run, it is not a smart plan run | 
|     issmartplan := false;  | 
|     issmartplanforperiodtask := false; | 
|     hastotalsupplyuser := false; | 
|     totalsupplyuser := 0.0; | 
|     isupstreamsmartplan := false; | 
|     ismiddleoutsmartplan := false; | 
|     isonlyplanonestepupstream := false; | 
|      | 
|     // since it is benchmarking, it is not postprocessing  | 
|     ispostprocessing := false; | 
|     isforcednoautoscaling := true; | 
|      | 
|     // Since it is a benchmarking run, the locked planning should be overwritten | 
|     isoverwritelockedplanning := runtask.OverrideManualPlanning(); | 
|      | 
|     // Since it is a benchmarking run, it is not an inventory optimization run and we do not limit the selected units | 
|     isinventoryoptimization := false; | 
|     isuseselectedunits  := false; | 
|      | 
|     this.Algorithm_Parameter().Update( issmartplan, issmartplanforperiodtask,  | 
|                                               hastotalsupplyuser, totalsupplyuser, isupstreamsmartplan, ismiddleoutsmartplan, isonlyplanonestepupstream, | 
|                                               ispostprocessing, | 
|                                               isforcednoautoscaling, | 
|                                               isoverwritelockedplanning, | 
|                                               isinventoryoptimization, | 
|                                               isuseselectedunits,  | 
|                                               false ); // run is async | 
|      | 
|     // Updates the parameters of the run | 
|      | 
|     firstperiod := minselect( this, PlanningPeriod, p, not p.IsHistorical() and p.StartDate() >= runtask.StartDate(), p.StartDate() );  | 
|     lastperiod := maxselect( this, PlanningPeriod, p, p.StartDate() <= runtask.EndDate(), p.StartDate() );  | 
|      | 
|     algorithmrun := this.UpdateParameters( null( ProductInStockingPointInPeriodPlannings ), // since it is benchmarking, it is not smart plan | 
|                                            this.StrategyMacroPlan(),  | 
|                                            firstperiod, lastperiod, | 
|                                            setting ); | 
|      | 
|     algorithmrun.UpdateForBenchmarking( runtask.ID(), | 
|                                         runtask.TestInstanceID(), | 
|                                         runtask.LibOBT_Benchmarker().LibOBT_BenchmarkerParameter().TotalThreadsAllowed(), // upper bound for nr of threads used | 
|                                         setting.Description(), | 
|                                         runtask.LibOBT_Benchmarker().LibOBT_BenchmarkerParameter().IsBenchmarkingRun() ); | 
|      | 
|     // Split as different job to release scenario manager dataset. | 
|     s := this->RunCapacityPlanningAlgorithm( algorithmrun,  | 
|                                              null( ProductInStockingPointInPeriodPlannings ), // No Smart plan, so no Smart plan pispips | 
|                                              firstperiod,  | 
|                                              lastperiod,  | 
|                                              null( Units ), | 
|                                              null( Process_MP ),  | 
|                                              this.OptimizerPuzzleWorld() ) | 
|      | 
|     s->Exception()->MacroPlan::HandleErrorBenchmarkRun( this, algorithmrun, runtask.ID() ); | 
|   *] | 
|   InterfaceProperties { Accessibility: 'Module' } | 
| } |