| Quintiq file version 2.0 | 
| #parent: #root | 
| Method AddConstraintForOperationNewSupplies ( | 
|   const OperationOutput output, | 
|   const Period_MP period, | 
|   const Period_MP excludeperiod, | 
|   CapacityPlanningSuboptimizer_CapacityPlanningAlgorithm program, | 
|   Real coefficient, | 
|   MPConstraint const, | 
|   Real scalefactor_periodtaskqty_const, | 
|   const LibOpt_Scope scope | 
| ) const | 
| { | 
|   TextBody: | 
|   [* | 
|     // soh yee Jan-26-2015 (created) | 
|     operation := output.Operation(); | 
|     // The operation must be part of the operations for optimization | 
|     if( not isnull( operation ) ) | 
|     { | 
|       var := program.PTQtyVariables().Find( operation, period );  | 
|      | 
|       // If the PTQty variable does not exist, then this PT is not valid for this optimizer run | 
|       // ( because its newsupply/dependent demand is related to a pispip that is out of scope ) | 
|       if( not isnull( var ) ) | 
|       { | 
|         // Term: coefficient *      factor         * scale * PTQty variable | 
|         // UoM:  [coeff UoM] * [Unit to Output PISP] *  [-]  *    [Unit] | 
|         const.NewTerm( coefficient * PeriodTaskOperation::GetNewSupplyQuantity( 1.0, output, 1.0 ) * scalefactor_periodtaskqty_const, var );                    | 
|       } | 
|     } | 
|   *] | 
|   InterfaceProperties { Accessibility: 'Module' } | 
| } |