admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
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
Quintiq file version 2.0
#parent: #root
Method UpdateParameters (Period_MP periodstart, Period_MP periodend, Number maxnumberofthreads)
{
  Description: 'Updates attributes of the AlgorithmRun'
  TextBody:
  [*
    param := periodstart.MacroPlan().Algorithm_Parameter();
    this.MaxNumberOfThreadsBenchmarking( maxnumberofthreads );
    this.HasOverwrittenManualPlanning( param.IsOverrideLockedPlanning() );
    this.IsInventoryOptimizationRun( param.IsInventoryOptimizationRun() );
    this.PeriodFirstStart( periodstart.Start() );
    this.PeriodFirstEnd( periodstart.PeriodEnd() );
    this.PeriodLastStart( periodend.Start() );
    this.PeriodLastEnd( periodend.PeriodEnd() );
    this.IsPostProcessing( param.IsPostProcessing() ); 
    this.IsUsingSelectedUnits( param.IsUsingSelectedUnits() );
    this.HasTotalSupplyUser( param.HasTotalSupplyUser() );
    this.TotalSupplyUser( param.TotalSupplyUser() );
    this.IsMiddleOutSmartPlan( param.IsMiddleOutSmartPlan() );
    this.IsUpstreamSmartPlan( param.IsUpstreamSmartPlan() );
    this.IsSync( param.IsSync() ); 
     
    this.IsOnlyPlanOneStepUpstream( param.IsOnlyPlanOneStepUpstream() );
    if( param.IsForceNoAutoScaling() ) 
    {
      this.IsAutoScalingEnabled( false ); 
    }
    
    globalparameters := periodstart.MacroPlan().GlobalParameters_MP();
    
    // Save the parameters of the sliding window approach in the algorithm run
    // Only enable the sliding windows approach if a lotsize goal has been added to the strategy
    // Otherwise there are no integer variables and the sliding windows approach would thus only slow down the optimizer run
    isslidingwindowsrun := globalparameters.UseSlidingWindowsApproach()
                           and ( this.UseLotCost() or this.UseLotSize() );
    
    this.IsSlidingWindowsRun( isslidingwindowsrun );
    if( isslidingwindowsrun )
    {
      this.NumberOfPeriodsInWindow( globalparameters.NumberOfPeriodsInWindow() );
      this.NumberOfPeriodsPerSlide( globalparameters.NumberOfPeriodsPerSlide() );
    }
  *]
}