Kevin Kok Khah Whey
2023-11-07 5ae534ab606e6f2ba5ea60914224d665b0447d5a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Quintiq file version 2.0
#parent: #root
Method SetMessageBenchmarking (
  RunContextForCapacityPlanning runcontext
)
{
  TextBody:
  [*
    if ( runcontext.IsOTS() ) 
    {
      mp := this.MacroPlan(); 
      
      pispip := counter( mp, Product_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriodPlanning, p, true ); 
      sdipcount := counter( mp, SalesSegment_MP.SalesDemandInPeriod, sdip, true, true); 
      pit := counter( mp, Unit.Lane.LaneLeg.Trip.ProductInTrip, pit, true, true )
      
      ptocount := counter( mp, Unit.Operation.PeriodTaskOperation, pto, true, true ) 
      triplot := counter(  mp, Unit.Lane.LaneLeg.Trip, trip, true, trip.HasLotSize() )
      ptolot := counter( mp, Unit.Operation.PeriodTaskOperation, pto, true, pto.Operation().HasLotSize() )
      ptoonetime := counter( mp, Unit.Operation.PeriodTaskOperation, pto, true, pto.Operation().HasOneTimeCost() ); 
      inputlot := counter(  mp, Unit.Operation.PeriodTaskOperation.DependentDemand, dd, dd.ProductInStockingPointInPeriodPlanning().ProductInStockingPoint_MP().HasInputLotSize() ) 
      ptominqty := counter( mp, Unit.Operation.PeriodTaskOperation, pto, true, pto.Operation().HasMinimumQuantity() ); 
      hassmooth := exists( mp, StrategyMacroPlan.StrategyLevelMacroPlan.KPIWeightMacroPlan, k, true, k.KPIName() ~ 'mooth' )
      hasblend := exists( mp, StrategyMacroPlan.StrategyLevelMacroPlan.KPIWeightMacroPlan, k, true, k.KPIName() ~ 'lending' )
      hasmix := exists( mp, StrategyMacroPlan.StrategyLevelMacroPlan.KPIWeightMacroPlan, k, true, k.KPIName() ~ 'mix' ) 
      postponenr := sum( mp, SalesSegment_MP.SalesDemandInPeriod, sdip, sdip.CanBePostponed(), sdip.PostponementSpecification().MaxPostponementPeriod() ) 
      nrlevel := mp.StrategyMacroPlan().MaxActiveLevel(); 
      periods := counter( mp, PlanningPeriod, p, true, not p.IsHistorical() )
      products := counter( mp, Product_MP, p, true, true )
      spoints := counter( mp, StockingPoint_MP, s, true, true ); 
      pisp := counter(  mp, Product_MP.ProductInStockingPoint_MP, pisp, true, true ) 
      up := counter( mp, Unit.PlanningUnitPeriod, up, true, true )
      
      sep := '_'; 
      msg := 'pispip:' + [String]pispip + sep +
             'sdip:' + [String] sdipcount + sep + 
             'pit:' + [String] pit + sep + 
      'ptocount:' + [String]ptocount + sep +  
      'triplot:' + [String]triplot + sep +
      'ptolot:' + [String]ptolot + sep +
      'ptoonetime:' + [String]ptoonetime + sep +
      'inputlot:' + [String]inputlot + sep +
      'ptominqty:' + [String]ptominqty + sep +
      'hassmooth:' + ifexpr( hassmooth, 'true', 'false' ) + sep +
      'hasblend:' + ifexpr( hasblend, 'true', 'false' ) + sep +
      'hasmix:' + ifexpr( hasmix, 'true', 'false' ) + sep +
      'postponenr:' + [String]postponenr + sep +
      'nrlevel:' + [String]nrlevel + sep +
      'periods:' + [String]periods + sep +
      'products:' + [String]products + sep +
      'sp:' + [String]spoints + sep +
      'pisp:' + [String]pisp + sep +
      'up:' + [String]up + sep
      
      runcontext.Run().Comment( msg ); 
    }
  *]
  InterfaceProperties { Accessibility: 'Module' }
}