¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method ContinuousProductionScheduling ( |
| | | MacroPlan macroPlan, |
| | | UnitPeriodTimeBases uptbs |
| | | ) |
| | | { |
| | | Description: 'ä¸å¨å
è¿ç»æäº§' |
| | | TextBody: |
| | | [* |
| | | debuginfo( "å¼å§è®¾ç½®è¿ç»æäº§" ); |
| | | |
| | | // ä¸å¨çå¼å§æ¶é´ã循ç¯ç´¢å¼ã |
| | | indexStartDate := macroPlan.StartOfPlanning().Date().StartOfWeek(); |
| | | |
| | | needHandleUPTBs := selectsortedset( uptbs, Elements, tempUPTB, tempUPTB.StartDate().StartOfWeek() = indexStartDate, tempUPTB.StartDate() ); |
| | | |
| | | |
| | | while ( needHandleUPTBs.Size() > 0 ) { |
| | | debuginfo( "-------------------------------------------", "æ£å¨å¤ççå¨å¼å§æ¶é´ï¼", indexStartDate.Format( "Y-M2-D2" ), |
| | | " æ£å¨å¤ççå¨ç»ææ¶é´ï¼", ( indexStartDate.StartOfNextWeek() - 1 ).Format( "Y-M2-D2" ), " å¤çç个æ°ï¼", needHandleUPTBs.Size() ); |
| | | |
| | | // éè¦å¤çæ å¿ |
| | | needHandleFlag := false; |
| | | // ç¬¬ä¸æ¬¡åºç°äº§è½æ¥æ |
| | | firstAppearCapacityDate := Date::MinDate(); |
| | | // ç¬¬ä¸æ¬¡åºç°äº§è½æ¥æãå¤çè¿ç»æäº§ç¨å°ã |
| | | firstAppearCapacityDate1 := Date::MinDate(); |
| | | |
| | | // è¯å«æ¯å¦éè¦è¿ç»æäº§ |
| | | traverse ( needHandleUPTBs, Elements, uptb ) { |
| | | // ç»ç¬¬ä¸æ¬¡äº§è½èµå¼ |
| | | if ( firstAppearCapacityDate.IsMinInfinity() and uptb.UsedCapacity().HoursAsReal() > 0.0 ) { |
| | | firstAppearCapacityDate := uptb.StartDate(); |
| | | firstAppearCapacityDate1 := uptb.StartDate(); |
| | | } |
| | | |
| | | // 夿æ¯å¦éè¦è¿ç»æäº§ |
| | | if ( not firstAppearCapacityDate.IsMinInfinity() and firstAppearCapacityDate <> uptb.StartDate() and uptb.UsedCapacity().HoursAsReal() > 0.0 ) { |
| | | if ( ( firstAppearCapacityDate + 1 ) = uptb.StartDate() ) { |
| | | firstAppearCapacityDate := uptb.StartDate(); |
| | | } else { |
| | | needHandleFlag := true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // å¤çè¿ç»æäº§ |
| | | if ( needHandleFlag ) { |
| | | // ç´¢å¼å¼å§æ¶é´ |
| | | handleIndexStartDate := firstAppearCapacityDate1 + 1; |
| | | // éè¦å¤ççUPTBçæå¤§æ¶é´ |
| | | handleIndexEndDate := maxobject( needHandleUPTBs, Elements, tempUPTB, true, tempUPTB.StartDate() ).StartDate(); |
| | | |
| | | // debuginfo( "éè¦å¤ççå¨å¼å§æ¶é´ï¼", indexStartDate.Format( "Y-M2-D2" ), " éè¦å¤ççå¨ç»ææ¶é´ï¼", handleIndexEndDate.Format( "Y-M2-D2" ), |
| | | // " ç¬¬ä¸æ¬¡åºç°äº§è½çæ¥æï¼", firstAppearCapacityDate1.Format( "Y-M2-D2" ) ); |
| | | needFillUPTB := select( needHandleUPTBs, Elements, tempUPTB, tempUPTB.StartDate() = handleIndexStartDate ); |
| | | |
| | | while ( guard( needFillUPTB.UsedCapacity().HoursAsReal(), -1 ) <= 0.0 and handleIndexStartDate <= handleIndexEndDate ) { |
| | | targetUPTB := minselect( needHandleUPTBs, Elements, tempUPTB, tempUPTB.StartDate() > handleIndexStartDate and tempUPTB.UsedCapacity().HoursAsReal() > 0.0, tempUPTB.StartDate() ); |
| | | |
| | | // ç§»å¨å¨æä»»å¡ |
| | | if ( not isnull( needFillUPTB ) and not isnull( targetUPTB ) ) { |
| | | this.MobileCycleTask( needFillUPTB, targetUPTB ); |
| | | } |
| | | |
| | | handleIndexStartDate := handleIndexStartDate + 1; |
| | | needFillUPTB := select( needHandleUPTBs, Elements, tempUPTB, tempUPTB.StartDate() = handleIndexStartDate ); |
| | | } |
| | | } |
| | | |
| | | indexStartDate := indexStartDate.StartOfNextWeek(); |
| | | needHandleUPTBs := selectsortedset( uptbs, Elements, tempUPTB, tempUPTB.StartDate().StartOfWeek() = indexStartDate, tempUPTB.StartDate() ); |
| | | } |
| | | *] |
| | | } |