| | |
| | | Description: 'Assign the optimal quantity from optimizer for dependent demand in input group.' |
| | | TextBody: |
| | | [* |
| | | // Tianma fix 20230727 |
| | | // Dependent demand of input group fulfillment |
| | | ptperiod := periodtaskoperation.UnitPeriod().Period_MP(); |
| | | operation := periodtaskoperation.Operation(); |
| | |
| | | dd, |
| | | dd.HasRegularProductForOptimizer() or dd.OperationInput().GetIsProductInOptimizerRun( runcontext.IsPostProcessing() ) ) |
| | | { |
| | | fulfilledqty := 0.0; |
| | | |
| | | if( operation.HasLeadTime() ) // Get the dependent demands that is located at different period from the period of period task. |
| | | { |
| | | // compute dependent demand periods |
| | | pispipperiods := construct( Period_MPs, constcontent ); |
| | | if ( getfromperiodtask ) // in case we are able to get from period tasks, below method refinds periodtask for (operation, ptperiod) i.e. periodtaskoperation and then output dep.demand periods |
| | | { |
| | |
| | | CapacityPlanningSuboptimizer::GetOperationDependentDemandPeriods( ptperiod, operation, &pispipperiods, getfromperiodtask ); |
| | | } |
| | | |
| | | fulfilledqty := 0.0; |
| | | if( operation.HasLeadTime() ) // Get the dependent demands that is located at different period from the period of period task. |
| | | { |
| | | fulfilledqty := sum( pispipperiods, Elements, pispipperiod, |
| | | this.GetOptimalValue( program.PartialOperationDemandQtyVariables().Get( dd.OperationInput(), pispipperiod, ptperiod ) ) ); |
| | | if ( runcontext.IsMetaIteration() and operation.IsBlending() ) // no filtering for numerical sensitive blending operation in meta optimizer |
| | |
| | | } |
| | | else |
| | | { |
| | | fulfilledqty := sum( pispipperiods, Elements, pispipperiod, |
| | | this.GetOptimalValue( program.OperationDemandQtyVariables().Get( dd.OperationInput(), pispipperiod ) ) ); |
| | | // note that in case there is no lead time then the set of dependent demand periods just equals the singleton set {ptperiod} |
| | | fulfilledqty := this.GetOptimalValue( program.OperationDemandQtyVariables().Get( dd.OperationInput(), ptperiod ) ); |
| | | if( runcontext.IsMetaIteration() and operation.IsBlending() ) // no filtering for numerical sensitive blending operation in meta optimizer |
| | | { |
| | | fulfilledqty := sum( pispipperiods, Elements, pispipperiod, |
| | | this.GetOptimalValueUnfiltered( program.OperationDemandQtyVariables().Get( dd.OperationInput(), pispipperiod ) ) ); |
| | | fulfilledqty := this.GetOptimalValueUnfiltered( program.OperationDemandQtyVariables().Get( dd.OperationInput(), ptperiod ) ); |
| | | } |
| | | } |
| | | |
| | | dd.OptimizerFulfilledQuantity( fulfilledqty ); |
| | | } |
| | | *] |