| | |
| | | { |
| | | TextBody: |
| | | [* |
| | | debuginfo( "需要圆整的时间(单位:小时)", timeDifference, " 需要圆整的产能周期的开始时间:", uptb.StartDate().Format( "Y-M2-D2" ) ); |
| | | debuginfo( "需要圆整的时间(单位:小时)", timeDifference, " Free capacity(单位:小时)", uptb.FreeCapacity().HoursAsReal(), " ChangeoverDuration(单位:小时)", uptb.ChangeoverDuration().HoursAsReal(), " 需要圆整的产能周期的开始时间:", uptb.StartDate().Format( "Y-M2-D2" ) ); |
| | | //timeDifference := uptb.FreeCapacity().HoursAsReal() - uptb.ChangeoverDuration().HoursAsReal(); |
| | | nextUnitPeriodTimeBase := ifexpr( isnull( uptb.Next().astype( UnitPeriodTimeBase ) ), select( uptbs, Elements, tempUPTB, tempUPTB.Start() = uptb.End() ), uptb.Next().astype( UnitPeriodTimeBase ) ); |
| | | //debuginfo( "考虑库存和lotsize" ); |
| | | //while ( timeDifference > 0 and not isnull( nextUnitPeriodTimeBase ) ) { |
| | |
| | | { |
| | | TextBody: |
| | | [* |
| | | traverse ( uptbs, Elements, uptb, true ) { |
| | | traverse ( uptbs, Elements, uptb, true/*uptb.StartDate() <= Date::Construct( 2024, 4, 23 )*/ ) { |
| | | if ( ( uptb.End().Date() - uptb.StartDate() ) > 1 ) { |
| | | debuginfo( "开始时间:", uptb.StartDate().Format( "Y-M2-D2" ), " 结束时间:", uptb.End().Date().Format( "Y-M2-D2" ), " 时间区间:", ( uptb.End().Date() - uptb.StartDate() ) ); |
| | | this.ProcessingTimeIntervalIsGreaterThanOneDay( macroPlan, uptb, uptbs ); |
| | | // debuginfo( "开始时间:", uptb.StartDate().Format( "Y-M2-D2" ), " 结束时间:", uptb.End().Date().Format( "Y-M2-D2" ), " 时间区间:", ( uptb.End().Date() - uptb.StartDate() ) ); |
| | | // this.ProcessingTimeIntervalIsGreaterThanOneDay( macroPlan, uptb, uptbs ); |
| | | } else if ( ( uptb.End().Date() - uptb.StartDate() ) = 1 ) { |
| | | debuginfo( "开始时间:", uptb.StartDate().Format( "Y-M2-D2" ), " 结束时间:", uptb.End().Date().Format( "Y-M2-D2" ), " 时间区间:", ( uptb.End().Date() - uptb.StartDate() ) ); |
| | | this.ProcessingTimeIntervalIsEqualToOneDay( macroPlan, uptb, uptbs ); |
| | |
| | | Description: '处理时间区间等于1天' |
| | | TextBody: |
| | | [* |
| | | if ( uptb.UsedCapacity() = uptb.TotalAvailableCapacity() ) { |
| | | if ( uptb.UsedCapacity() = uptb.TotalAvailableCapacity() or ( uptb.UtilizationPercentage() * uptb.MaximumLoadPercentage() / 100 ) = 100 or uptb.FreeCapacity().HoursAsReal() = 0 ) { |
| | | debuginfo( "天已经是整班,无需处理(使用产能等于可用产能)" ); |
| | | } else if ( uptb.UsedCapacity().HoursAsReal() = 0 ) { |
| | | debuginfo( "天已经是整班,无需处理(使用产能等于0)" ); |
| | |
| | | this.ZeroCapacityReplenishment( macroPlan, uptb.UsedCapacity().HoursAsReal(), uptb, uptbs ); |
| | | } else { |
| | | debuginfo( "执行圆整" ); |
| | | this.CapacityRounding( macroPlan, uptb.TotalAvailableCapacity().HoursAsReal() - uptb.UsedCapacity().HoursAsReal(), uptb, uptbs ); |
| | | this.CapacityRounding( macroPlan, uptb.TotalAvailableCapacity().HoursAsReal() - ( uptb.UsedCapacity() + uptb.ChangeoverDuration() ).HoursAsReal(), uptb, uptbs ); |
| | | } |
| | | } else { |
| | | debuginfo( "天出现异常" ); |
| | |
| | | minimumCapacityThatCanBeBorrowed := minimumQuantityThatCanBeBorrowed / pto.Operation().Throughput(); |
| | | nextUnitPeriodTimeBase := ifexpr( isnull( uptb.Next().astype( UnitPeriodTimeBase ) ), select( uptbs, Elements, tempUPTB, tempUPTB.Start() = uptb.End() ), uptb.Next().astype( UnitPeriodTimeBase ) ); |
| | | while ( timeDifference > 0 and not isnull( nextUnitPeriodTimeBase ) and minimumCapacityThatCanBeBorrowed > 0 ) { |
| | | acceptableCapacity := ifexpr( ( nextUnitPeriodTimeBase.TotalAvailableCapacity().HoursAsReal() - nextUnitPeriodTimeBase.UsedCapacity().HoursAsReal() ) > 0, |
| | | acceptableCapacity := /*ifexpr( ( nextUnitPeriodTimeBase.TotalAvailableCapacity().HoursAsReal() - nextUnitPeriodTimeBase.UsedCapacity().HoursAsReal() ) > 0, |
| | | nextUnitPeriodTimeBase.TotalAvailableCapacity().HoursAsReal() - nextUnitPeriodTimeBase.UsedCapacity().HoursAsReal(), |
| | | 0.0 ); |
| | | 0.0 )*/ |
| | | ifexpr( nextUnitPeriodTimeBase.FreeCapacity().HoursAsReal() > 0, |
| | | nextUnitPeriodTimeBase.FreeCapacity().HoursAsReal(), |
| | | 0.0 ); |
| | | unifiedProcessingTimeOfComplementZero := minvalue( timeDifference, minimumCapacityThatCanBeBorrowed, acceptableCapacity ); |
| | | debuginfo( "接纳的周期时间:", nextUnitPeriodTimeBase.StartDate().Format( "Y-M2-D2" ), String::Tab(), |
| | | "接纳的周期能接受的产能:", acceptableCapacity, String::Tab(), |
| | | "剩余补零的产能:", timeDifference, String::Tab(), |
| | | "统一转移的产能:", unifiedProcessingTimeOfComplementZero, String::Tab() |
| | | ); |
| | | this.UnifiedProcessingOfComplementZeroLogic( unifiedProcessingTimeOfComplementZero, pto, uptb, macroPlan ); |
| | | if ( unifiedProcessingTimeOfComplementZero > 0.0 ) { |
| | | this.UnifiedProcessingOfComplementZeroLogic( unifiedProcessingTimeOfComplementZero, pto, nextUnitPeriodTimeBase, macroPlan ); |
| | | } |
| | | minimumCapacityThatCanBeBorrowed := minimumCapacityThatCanBeBorrowed - unifiedProcessingTimeOfComplementZero; |
| | | timeDifference := timeDifference - unifiedProcessingTimeOfComplementZero; |
| | | if ( isnull( nextUnitPeriodTimeBase.Next() ) ) { |