| Quintiq file version 2.0 | 
| #parent: #root | 
| Method CaptureForOTS ( | 
|   LibOpt_Task task | 
| ) | 
| { | 
|   TextBody: | 
|   [* | 
|     nrdecimals := 3;  | 
|     opt := this.Run().Optimization().astype( Optimization );   | 
|     mp := opt.MacroPlan();  | 
|     runcontext := select( this, Run.RunContext.astype( RunContextForCapacityPlanning ), rc, true, true );  | 
|      | 
|     if ( runcontext.IsOTSCollectAllKPIData() or not runcontext.IsMetaIteration() ) // for meta optimizer it becomes quite expensive to collect all KPIs each iteration. So we have an optimizer setting option to turn this off  | 
|     {   | 
|       this.KPICampaign( mp.GetKPICampaign().Round( nrdecimals ) );  | 
|       campaignscore := 0.0;  | 
|       transscore := 0.0;  | 
|       uncoveredpenalty := 0.0; | 
|       sequencepenalty := 0.0;   | 
|       utilscore := 0.0;  | 
|       RollbackKPIMeta::GetCampaignScore( runcontext, mp, campaignscore, transscore, utilscore ); | 
|       RollbackKPIMeta::GetCampaignCombiSlackScore( mp, uncoveredpenalty, sequencepenalty, runcontext.UseCampaignSequenceOptimizer() );  | 
|       this.OptCampaignCampaignScore( campaignscore.Round( nrdecimals ) );  | 
|       this.OptCampaignTransitionScore( transscore.Round( nrdecimals ) );  | 
|       this.OptCampaignUncoveredPenalty( uncoveredpenalty.Round( nrdecimals ) );  | 
|       this.OptCampaignUtilizationScore( utilscore.Round( nrdecimals ) );  | 
|       this.OptCampaignSequencePenalty( sequencepenalty.Round( nrdecimals ) );  | 
|        | 
|       this.KPIFulfillment( mp.GetKPIFulfillment().Round( nrdecimals ) );  | 
|       this.KPIFulfillmentPercentage( mp.GetKPIFulfillmentInPercentage().Round( nrdecimals ) );  | 
|        | 
|       this.KPIFulfillmentTarget( mp.GetKPIFulfillmentTarget().Round( nrdecimals ) );  | 
|       this.KPIFulfillmentTargetAbsolute( mp.GetKPIFulfillmentTargetAbsolute().Round( nrdecimals ) );  | 
|       this.KPIFulfillmentTargetOpt( mp.GetKPIFulfillmentTargetOpt().Round( nrdecimals ) );  | 
|       this.KPIFulfillmentTargetPercentage( mp.GetKPIFulfillmentTargetPercentage().Round( nrdecimals ) );  | 
|        | 
|       this.KPIInputLotSize( mp.GetKPIInputLotSizeContinuous().Round( nrdecimals ) );  | 
|       this.KPILotSizeTrip( mp.GetKPILotSizeTripContinuous().Round( nrdecimals ) );  | 
|       this.KPILotSizeOperation( mp.GetKPILotSizeOperationContinuous().Round( nrdecimals ) );  | 
|       this.KPILotSizeTotal( mp.GetKPILotSizeTotal().Round( nrdecimals ) );  | 
|        | 
|       this.KPIInventoryMixBalancing( mp.GetKPIInventoryMixBalancing().Round( nrdecimals ) );  | 
|        | 
|       this.KPITargetInventoryLevel( mp.GetKPITargetInventoryLevel().Round( nrdecimals ) );  | 
|       this.KPITargetInventoryPercentage( mp.GetKPITargetInventoryLevelInPecentage().Round( nrdecimals ) );  | 
|        | 
|       this.KPIMaximumInventoryLevel( mp.GetKPIMaximumInventoryLevel().Round( nrdecimals ) );  | 
|        | 
|       this.KPIMinimumInventoryLevel( mp.GetKPIMinimumInventoryLevel().Round( nrdecimals ) );  | 
|        | 
|       this.KPIMaximumSupply( mp.GetKPIMaximumSupply().Round( nrdecimals ) );  | 
|        | 
|       this.KPIMinimumSupply( mp.GetKPIMinimumSupply().Round( nrdecimals ) );  | 
|        | 
|       this.KPIMinimumUnitCapacity( mp.GetKPIMinimumUnitCapacity().Round( nrdecimals ) );  | 
|       this.KPIUnitCapacityNotMet( mp.GetKPIUnitCapacityNotMet().Round( nrdecimals ) );  | 
|        | 
|       this.KPIPostponementPenalty( mp.GetKPIPostponementPenalty().Round( nrdecimals ) );  | 
|        | 
|       this.KPIProcessMaximumQuantity( mp.GetKPIProcessMaximumQuantity().Round( nrdecimals ) );  | 
|        | 
|       this.KPIProcessMinimumQuantity( mp.GetKPIProcessMinimumQuantity().Round( nrdecimals ) );  | 
|        | 
|       this.KPISalesDemandPriority( mp.GetKPISalesDemandPriority().Round( nrdecimals ) );  | 
|        | 
|       this.KPIStockingPointCapacity( mp.GetKPIStockingPointCapacity().Round( nrdecimals ) );  | 
|        | 
|       this.KPIServiceLevel( mp.GetKPIServiceLevel().Round( nrdecimals ) );  | 
|        | 
|       this.KPISupplyTarget( mp.GetKPISupplyTarget().Round( nrdecimals ) );  | 
|        | 
|       this.KPIUnitCapacity( mp.GetKPIUnitCapacity().Round( nrdecimals ) );  | 
|        | 
|       this.KPITotalExpiredQuantity( mp.GetKPITotalExpiredQuantity().Round( nrdecimals ) );  | 
|        | 
|       this.KPIBalanceViolation( mp.GetKPIBalanceViolation().Round( nrdecimals ) ); | 
|        | 
|       this.KPIFixedCost( mp.GetKPIFixedCost().Round( nrdecimals ) );  | 
|       this.KPIChangeover( mp.GetKPIChangeover().Round( nrdecimals ) );  | 
|       this.KPIDirectCost( mp.GetKPIDirectCost().Round( nrdecimals ) );  | 
|       this.KPIInventoryHoldingCost( mp.GetKPIInventoryHoldingCost().Round( nrdecimals ) );  | 
|       this.KPIInventorySupplyCost( mp.GetKPIInventorySupplyCost().Round( nrdecimals ) );  | 
|       this.KPIInventoryTurns( mp.GetKPIInventoryTurns().Round( nrdecimals ) );  | 
|       this.KPIMargin( mp.GetKPIMargin().Round( nrdecimals ) );  | 
|       this.KPIOnTimeFulfillment( mp.GetKPIOnTimeFulfillment().Round( nrdecimals ) );  | 
|       this.KPIOnTimeInFull( mp.GetKPIOnTimeInFull().Round( nrdecimals ) );  | 
|       this.KPISales( mp.GetKPISales().Round( nrdecimals ) );  | 
|       this.KPIVolume( mp.GetKPIVolume().Round( nrdecimals ) ); | 
|        | 
|       this.KPIBlending( mp.GetKPIBlending( runcontext.SmallestFeasibilityTolerance() ).Round( nrdecimals ) ); | 
|        | 
|       kpi := RealVector::Construct( this.RollbackKPI() ); | 
|       opt.BT_ScoreL0( guard( kpi.Get( 0 ), 0.0 ) );  | 
|       opt.BT_ScoreL1( guard( kpi.Get( 1 ), 0.0 ) );  | 
|       opt.BT_ScoreL2( guard( kpi.Get( 2 ), 0.0 ) );  | 
|       opt.BT_ScoreL3( guard( kpi.Get( 3 ), 0.0 ) );  | 
|       opt.BT_ScoreL4( guard( kpi.Get( 4 ), 0.0 ) );  | 
|       opt.BT_ScoreL5( guard( kpi.Get( 5 ), 0.0 ) );  | 
|       opt.BT_ScoreL6( guard( kpi.Get( 6 ), 0.0 ) );  | 
|      | 
|       this.CreateKPIParts( task.Scope() ); | 
|     } | 
|   *] | 
|   InterfaceProperties { Accessibility: 'Module' } | 
| } |