| Quintiq file version 2.0 | 
| #parent: #root | 
| FunctionOverride CalcFreeCapacityRatio | 
| { | 
|   TextBody: | 
|   [* | 
|     freecapacity := Duration::Zero(); | 
|      | 
|     if( this.TotalCapacity() > Duration::Zero() ) | 
|     { | 
|       freecapacity := ( this.FreeCapacity().HoursAsReal() / this.TotalCapacity().HoursAsReal() ) * this.Period_MP().Duration(); | 
|      | 
|       if( this.Unit().IsForCapacityAggregation() ) | 
|       { | 
|         freepercentage := 1 - ( this.ParentOfUnitDimension().UtilizationPercentage() / 100 ); | 
|         freecapacity := freepercentage * this.TotalAvailableCapacity(); | 
|       } | 
|     } | 
|      | 
|     this.FreeCapacityRatio( freecapacity ); | 
|   *] | 
| } |