Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method RunSmartPlanFromPlanningMatrix ( 
 | 
  ProductInStockingPointInPeriodPlannings smartplanpispips, 
 | 
  Real userqty, 
 | 
  ScenarioManager scenariomanager 
 | 
) 
 | 
{ 
 | 
  Description: 'Will call the RunSmalPlan with some default parameters' 
 | 
  TextBody: 
 | 
  [* 
 | 
    //Pre-set smart plan parameters 
 | 
    hastotalsupplyuser := true; 
 | 
    run := this.Optimization().GetLastSmartPlanAlgorithmRun( false /*issmartplanforperiodtask*/ ); 
 | 
    totalsupplyuser := userqty; 
 | 
     
 | 
    smartplansetting:= this.SmartPlanSetting(); 
 | 
    // Get the smart plan settings based on the latest smart plan run 
 | 
    isoverwritemanual := smartplansetting.OverwriteLockedPlanning(); 
 | 
    isupstreamsmartplan := smartplansetting.IsUpstream(); 
 | 
    ismiddleoutsmartplan := smartplansetting.IsMiddleOut();                             
 | 
    isonlyplanonestepupstream := smartplansetting.OnlyPlanOneStep(); 
 | 
    isusingselectedunits := smartplansetting.LimitUnitBySmartPlan(); 
 | 
     
 | 
    units := smartplansetting.UnitForSmartPlan( relget );   
 | 
     
 | 
    strategy := select( scenariomanager, Strategy, strategy, strategy.Name() = smartplansetting.Strategy() ); 
 | 
     
 | 
    periodstart := this.FirstPlanningPeriod(); 
 | 
    periodend := this.LastPlanningPeriod(); 
 | 
    AlgorithmRun::GetLastOptimizationHorizon( run, this, periodstart, periodend ); 
 | 
     
 | 
    //info('total supply matrix:', totalsupplyuser ) 
 | 
    this.RunSmartPlan( true /*issmartplan*/, 
 | 
                       false /*issmartplanforperiodtask*/,  
 | 
                       smartplanpispips, 
 | 
                       hastotalsupplyuser, 
 | 
                       totalsupplyuser,  
 | 
                       isupstreamsmartplan, 
 | 
                       ismiddleoutsmartplan, 
 | 
                       isonlyplanonestepupstream, 
 | 
                       strategy, 
 | 
                       isoverwritemanual, 
 | 
                       periodstart, 
 | 
                       periodend, 
 | 
                       isusingselectedunits, 
 | 
                       units,  
 | 
                       null( Process_MP ),  
 | 
                       false ); // not re-using StrategyMacroPlan 
 | 
  *] 
 | 
} 
 |