lazhen
2025-01-09 8afe90b633046db39042aada36b88193062f8cff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Quintiq file version 2.0
#parent: #root
MethodOverride CreateComponents (
  LibOpt_Run run
)
{
  TextBody:
  [*
    
    
    // create CapacityPlanningSubOptimizer
    // note userperiodtasks and userproductintrips are set as relations on this object, pispipssmartplan is empty for this suboptimizer 
    
    //run.DebugScope( true );
    prepostcomp := run.Component( relnew, OptimizerPrePostProcessing, Name := 'PrePostProcessing_FullRun' ); 
    runcontext := RunContextForCapacityPlanning::GetRunContextCapacityPlanning( run ); 
    
    transformerforuserperiodtasks := run.Component( relnew, TransformerFullRun, Name := 'TransformerFullRun'  ); 
    selectorfullpuzzle := run.Component( relnew, SelectorFullPuzzle, Name := 'SelectorFullPuzzle' ); 
    
    suboptimizer := CapacityPlanningSuboptimizer::Create( runcontext.MaxLevel(),                                                    // focuslevel
                                                          false,                                                // ispriorlevelsfixed
                                                          runcontext.IsAutoScalingEnabled(),                    // isupdatescaling
                                                          false,                                                // runpastfocuslevel
                                                          run, 
                                                          'CapacityPlanningSubOptimizerForFullRun',            // name
                                                          false,   // user supply correction carried fwd inventory
                                                          false,   // keep total available supply
                                                          false,   // do not use periodtaskoperation in definition
                                                          false,   // only plan demand smart plan pispips
                                                          false,   // no extra level to minimize ptqty 
                                                          false,   // not applicable
                                                          0.0,     // not applicable
                                                          true,    // apply noise treshold
                                                          run.Optimization().astype( Optimization ).MacroPlan().StrategyMacroPlan().UseHierarchicalSolver(),   // hierarchical cplex goals
                                                          runcontext.SmallestIntegralityTolerance(),
                                                          runcontext.SmallestFeasibilityTolerance(), 
                                                          false,   // full plan for meta 
                                                          false,   // collapse level
                                                          0.0 );   // collapse level weight
                                                          
    
    RollbackKPIMeta::Create( suboptimizer, 
                             RunContextForCapacityPlanning::GetRunContextCapacityPlanning( run ), 
                             0,   // unused
                             0.0, // unused
                             0.0, // unused
                             runcontext.SmallestFeasibilityTolerance(), // blending KPI accuracy
                             true, // unused
                             runcontext.MaxLevel(), 
                             true ); // always accept - just want to see scores in snapshots
    
    prepostcomp.To(  selectorfullpuzzle ); 
    selectorfullpuzzle.To(  transformerforuserperiodtasks ); 
    transformerforuserperiodtasks.To( suboptimizer );
    
    startexcludedproducts := Optimization::GetStartComponentForExcludedProductsOptimization( run ); 
    if ( not isnull( startexcludedproducts ) ) 
    {
      suboptimizer.To( startexcludedproducts ); 
    }
    
    this.ConfigureForOneTransaction( run ); 
    run.InOneTransaction( false );
    suboptimizer.InOneTransaction( false );
  *]
}