Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method FixDecisionVariables_Debug ( 
 | 
  CapacityPlanningSuboptimizer_CapacityPlanningAlgorithm program, 
 | 
  RunContextForCapacityPlanning runcontext, 
 | 
  LibOpt_Scope scope 
 | 
) 
 | 
{ 
 | 
  TextBody: 
 | 
  [* 
 | 
    subopt := this;  
 | 
    nrfixed := 0;  
 | 
    traverse( scope.GetOperationInOptimizerRunConst(), Elements, operation )  
 | 
    { 
 | 
      periods := subopt.GetPeriodsForOperation( scope, operation ); 
 | 
      traverse( periods, Elements, period )  
 | 
      { 
 | 
        var := program.PTQtyVariables().Get( operation, period ); 
 | 
        pt := select( operation, PeriodTaskOperation, po, true, po.UnitPeriod().Period_MP() = period );  
 | 
        valuetofix := guard( pt.Quantity(), 0.0 );  
 | 
        subopt.FixVariableStyleGuide( var, valuetofix ); 
 | 
        nrfixed++;  
 | 
      } 
 | 
    } 
 | 
     
 | 
    /* >> 
 | 
    userperiodtasks := selectset(  runcontext, UserPeriodTask, pto, true, true );  
 | 
    this.FixUserPeriodTask( userperiodtasks, program ); // don't alter the user period task operations 
 | 
    */ 
 | 
     
 | 
    // fixing trips  
 | 
    nrfixed := 0;  
 | 
    traverse( scope.GetProductInTripInOptimizerRun(), Elements, productintrip ) 
 | 
    { 
 | 
      var := program.TripNewSupplyVariables().Get( productintrip );  
 | 
      subopt.FixVariableStyleGuide( var, productintrip.Quantity() ); 
 | 
      nrfixed++;  
 | 
    } 
 | 
     
 | 
    /* 
 | 
      // Freeze variables for SalesDemands 
 | 
    nrfixed := 0;  
 | 
    nrunfixed := 0;    
 | 
    traverse( scope.GetLeafSalesDemandInPeriodInRun(), Elements, lsdip, scope.Contains( lsdip.ProductInStockingPoint_MP().PISPInOptimizerRun() ) ) 
 | 
    { 
 | 
        var := program.SalesDemandQtyVariables().Get( lsdip );      // Fulfilled quantity 
 | 
        if ( mustfixduetocurrentlevel )  
 | 
        { 
 | 
          subopt.FixVariableStyleGuide( var, lsdip.FulfilledQuantity() ); 
 | 
          nrfixed++;  
 | 
        } 
 | 
        else 
 | 
        { 
 | 
          var.LowerBound( lsdip.SalesDemandQtyVarInitLowerBound() );  
 | 
          var.UpperBound( lsdip.SalesDemandQtyVarInitUpperBound() );  
 | 
          nrunfixed++;  
 | 
        } 
 | 
    }  
 | 
     
 | 
    traverse( scope.GetAggregatedSalesDemandInPeriodInRun(), Elements, asdip ) 
 | 
    { 
 | 
      traverse ( asdip, DisaggregatedSalesDemandInPeriod, dasdip, 
 | 
                 scope.Contains( dasdip.AsPlanningBaseSalesDemandInPeriod().PISPIPInOptimizerRun() ) ) 
 | 
      { 
 | 
         var := program.DisaggregatedSalesDemandQtyVariables().Get( dasdip ); 
 | 
         if ( mustfixduetocurrentlevel )  
 | 
         { 
 | 
            subopt.FixVariableStyleGuide( var, dasdip.FulfilledQuantity() ); 
 | 
            nrfixed++;  
 | 
         }   
 | 
         else  
 | 
         { 
 | 
            var.LowerBound( dasdip.SalesDemandQtyVarInitLowerBound() );  
 | 
            var.UpperBound( dasdip.SalesDemandQtyVarInitUpperBound() );  
 | 
            nrunfixed++;  
 | 
         } 
 | 
      } 
 | 
    } 
 | 
    msg := msg + 'sales demands fixed, unfixed= ' + [String]nrfixed + ','+ [String] nrunfixed; 
 | 
    debuginfo(  msg ); 
 | 
  *] 
 | 
  InterfaceProperties { Accessibility: 'Module' } 
 | 
} 
 |