Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method UpdateMinMaxBound ( 
 | 
  Real bound, 
 | 
  MPVariable variable 
 | 
) 
 | 
{ 
 | 
  Description: 'Updates the minimum lowerbound and maximum upperbound of the scaling type' 
 | 
  TextBody: 
 | 
  [* 
 | 
    // Select the scaling type associated with this variable 
 | 
     
 | 
    scalingtypename := CapacityPlanningSuboptimizer::GetVariableScaleType( typeofexpression( variable ).ShortName() ); 
 | 
     
 | 
    algorithmrun := this.MacroPlan().GetLastAlgorithmRun();  
 | 
    scalingtype := algorithmrun.GetScalingType( scalingtypename ); 
 | 
     
 | 
    // Update the minimum/maximum bound of this scaling type 
 | 
    newbound := abs( bound ); 
 | 
    if( newbound <> 0 and newbound.IsFinite() ) 
 | 
    { 
 | 
       //'moving all updates on variables into the handle feasible, so methods can be read only. Originally we call with the unscaled(non cplex value) then divide to get cplex bound 
 | 
       //  so now we start with the actual cplex bound in the call so no need to scale by dividing. Only difference would be squashing tiny values. Hence commenting out following:   
 | 
      /* >>                              
 | 
      varscalefactor := CapacityPlanningSuboptimizer::GetVariableScaleFactor( typeofexpression( variable ) );  
 | 
      newbound := newbound / varscalefactor; 
 | 
      <<*/ 
 | 
       
 | 
      if( newbound < scalingtype.MinBound() ) 
 | 
      { 
 | 
        scalingtype.MinBound( newbound ); 
 | 
        scalingtype.VariableNameMinBound( variable.Name() ); 
 | 
      } 
 | 
      if( newbound > scalingtype.MaxBound() ) 
 | 
      { 
 | 
        scalingtype.MaxBound( newbound ); 
 | 
        scalingtype.VariableNameMaxBound( variable.Name() ); 
 | 
      } 
 | 
    } 
 | 
  *] 
 | 
  InterfaceProperties { Accessibility: 'Module' } 
 | 
} 
 |