| Quintiq file version 2.0 | 
| #parent: #root | 
| Method CreateSupportData ( | 
|   LibOpt_Task task, | 
|   RunContextForCapacityPlanning runcontext | 
| ) | 
| { | 
|   TextBody: | 
|   [* | 
|     starttime := OS::PrecisionCounter();  | 
|     optimization := this.Optimization().astype( Optimization );  | 
|     macroplan := optimization.MacroPlan();  | 
|      | 
|     macroplan.IsOptimizerRunning( true ); // will generate propagation for estimated improvement scores | 
|      | 
|     optimization.StorePreviousPlanningSpecificationValuesForShelfLife();  | 
|      | 
|     optimization.SetOptimizerPuzzle( task.Scope().GetOptimizerPuzzleInOptimizerRun(), optimization.GetOptimizerPeriods( runcontext.FirstPeriod_MP(), runcontext.LastPeriod_MP() ) );  | 
|      | 
|     lanelegs_foroptimization := selectset( macroplan.GetUnits(), Elements.AllChildren.AsChildren.LaneLegForOptimization, laneleg, true ); | 
|      | 
|     // Clean forbidden disaggregated sdips | 
|     macroplan.SynchronizeDisaggregatedSalesDemandInPeriod( true );  | 
|      | 
|     if ( runcontext.UseCampaignSequenceOptimizer() )  | 
|     { | 
|       optimization.GenerateCampaignCombis();  | 
|     } | 
|      | 
|     this.MetaOptimizerCreateSupportDataShiftOptimizer( macroplan, task.Scope().GetOptimizerPuzzleInOptimizerRun(), runcontext );  | 
|      | 
|     // Select the instances for optimization | 
|     if ( not runcontext.IsSmartPlan() ) // for smart plan we do not need to create objects ( these are created on the fly searching upstream/downstream, also adding period for shelf life) | 
|     { | 
|       periods := selectset( macroplan, Period_MP, period, true, period.IsInOptimizerPuzzle() );  | 
|        | 
|       updatedtrips := construct( Trips ); | 
|       // Create all possible combi of trips as optimizer input | 
|       optimization.CreateTrips( lanelegs_foroptimization, periods, updatedtrips ); | 
|        | 
|       if ( runcontext.IsMetaIteration() )  | 
|       { | 
|         optimization.CreatePeriodTaskOperations( periods );  | 
|       } | 
|       optimization.ShelfLifeExtendHistoricalPeriods( false, null(  ProductInStockingPoint_MPs, owning ) ); // temporarily add period to accomodate shelf life if needed | 
|     } | 
|      | 
|     Transaction::Transaction().Propagate(); // need relations for created data. Need it in same transaction because of pit pruning | 
|        | 
|     endtime := OS::PrecisionCounter();  | 
|     durationsec := ( endtime - starttime ) / OS::PrecisionCounterFrequency();  | 
|     debuginfo( 'Time for creating support data ( incl. propagation):', durationsec, 'sec' ); | 
|   *] | 
|   InterfaceProperties { Accessibility: 'Module' } | 
| } |