Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Function CalcEISLotSize 
 | 
{ 
 | 
  TextBody: 
 | 
  [* 
 | 
    value := 0.0;  
 | 
    eis := this.MacroPlan().OptimizerMetaEIS();  
 | 
    if ( not isnull( eis ) 
 | 
         and eis.IsNeedEstimatedImprovementScores()  
 | 
         and eis.LotSizeLevel() = eis.FocusLevelForEIS()  
 | 
         and eis.LotSizeWeight() > 0 
 | 
         and not this.IsValidPlannedLotSize()  
 | 
         and not this.Operation().LotSize() = 0 )  
 | 
    { 
 | 
      requiredlot := ceil( this.Quantity() / this.Operation().LotSize()); 
 | 
      load := requiredlot * this.Operation().LotSize();   
 | 
      value := maxvalue( load - this.Quantity(), 0.0 ) 
 | 
                * eis.LotSizeWeight();  
 | 
     
 | 
      value := value / pow(  eis.BaseForTried(), [Real]this.MetaOptimizerTried() );                          
 | 
    } 
 | 
    this.EISLotSize( value ); 
 | 
  *] 
 | 
  InterfaceProperties { Accessibility: 'Module' } 
 | 
} 
 |