| Quintiq file version 2.0 | 
| #parent: #root | 
| Method RunOptimizer ( | 
|   structured[ProductInStockingPointInPeriodPlanning] smartplanpispips, | 
|   Boolean hastotalsupplyuser, | 
|   Boolean isonlyplanonestepupstream, | 
|   Boolean isoverwritemanual | 
| ) id:Method_DialogSmartPlan_RunOptimizer | 
| { | 
|   #keys: '[137862.0.112808159]' | 
|   Body: | 
|   [* | 
|     // runs the optimizer based on last selected options | 
|      | 
|     isUsingSelectedUnits := CheckboxIsSelectedUnits.Checked(); | 
|     units :=  DataHolderSelectedUnitsForSmartPlan.Data(); | 
|     run := MacroPlan.Optimization().GetLastRegularAlgorithmRun(); | 
|     issmartplan := true; | 
|     issmartplanforperiodtask := false; | 
|     isupstreamsmartplan := RadioButtonGroupSmartPlanDirection.BoundValue() = SmartPlanSetting::Upstream(); | 
|     ismiddleoutsmartplan := RadioButtonGroupSmartPlanDirection.BoundValue() = SmartPlanSetting::MiddleOut(); | 
|     totalsupplyuser := 0.0; | 
|     if( hastotalsupplyuser ) | 
|     { | 
|       totalsupplyuser := ApplicationMacroPlanner.FormatStringToReal( EditFieldTotalSupply.Text() ); | 
|     } | 
|      | 
|     strategy := DropDownListStrategy.Data(); | 
|     periodstart := MacroPlan.FirstPlanningPeriod(); | 
|     periodend := MacroPlan.LastPlanningPeriod(); | 
|     AlgorithmRun::GetLastOptimizationHorizon( run, MacroPlan, periodstart, periodend ); | 
|      | 
|     MacroPlan.RunSmartPlan( issmartplan, | 
|                             issmartplanforperiodtask, | 
|                             smartplanpispips, | 
|                             hastotalsupplyuser, | 
|                             totalsupplyuser, | 
|                             isupstreamsmartplan, | 
|                             ismiddleoutsmartplan, | 
|                             isonlyplanonestepupstream, | 
|                             strategy, | 
|                             isoverwritemanual, | 
|                             periodstart, | 
|                             periodend, | 
|                             isUsingSelectedUnits, | 
|                             units, | 
|                             null( Process_MP ), | 
|                             false ); | 
|      | 
|      | 
|     //YY: TODO  | 
|     //Undo after caling job | 
|     //Application.RemoveHistory(); | 
|   *] | 
| } |