| Quintiq file version 2.0 | 
| #parent: #root | 
| Method GetDemands | 
| { | 
|   TextBody: | 
|   [* | 
|     // Construct of strings, each element correspond to one line in CSV string | 
|      | 
|     // Traverse through all PISPIPs which should be considered in MEIO | 
|     // 1. Should have the correct planning period specification | 
|     // 2. Should be active in MEIO | 
|     // 3. Should not be collapsed ( not active in MEIO or zero upstream leadtime ) | 
|     traverse( this,  | 
|               Product_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriodPlanning.astype( ProductInStockingPointInPeriodPlanningLeaf ),  | 
|               pispip,  | 
|               pispip.MEIO_IsPlanningPeriodInMEIO() | 
|               and pispip.ProductInStockingPoint_MP().IsActiveInMEIO()  | 
|               and not pispip.ProductInStockingPoint_MP().MEIO_IsCollapsedPISP() ) | 
|     { | 
|       // Calculate the expected value and standard deviation for the given pispip.                         | 
|       expected_value := this.GetExpectedValue( pispip ); | 
|       pispip.MEIO_DemandExpectedValue( expected_value );  | 
|       std := this.GetSTD( pispip ); | 
|       pispip.MEIO_DemandStandardDeviation( std );  | 
|     } | 
|   *] | 
| } |