Capacity Calculation for Resource Units

  • Determine <capacity calendar> for <resource unit>.

    The capacity calendar is used to identify working and non-working days. The calendar can also be used to define a generic capacity percentage for specific calendar periods. The generic capacity percentage applies to all resource and resource unit that uses the same calendar.

    • If a calendar exists for <resource unit> with at least one working day, the program uses the calendar on <resource unit>:
      <capacity calendar> = SELECT * FROM SC_CALENDAR where, calendar_id = SELECT calendar_id FROM SC_RESOURCE_UNIT where, resource_unit_id = <resource unit> AND EXISTS (SELECT 'X' FROM SC_CALENDAR_PERIOD where, calendar_id = <capacity calendar> and work_period_flag = 'Y')
    • Else, if a calendar exists for <resource> of <resource unit> with at least one working day, the program uses the calendar on <resource>:
      <capacity calendar> = SELECT * FROM SC_CALENDAR where, calendar_id = SELECT calendar_id FROM SC_RESOURCE where, resource_id = <resource> AND EXISTS (SELECT 'X' FROM SC_CALENDAR_PERIOD where, calendar_id = <capacity calendar> and work_period_flag = 'Y')
    • Else, if a calendar exists in the production facility of <resource> with at least one working day, the program uses the production facility calendar.
      <production facility> =  SELECT * FROM SC_LOCATION where, location_id = SELECT location_id FROM SC_RESOURCE where, resource_id = <resource>
      <capacity calendar> = SELECT * FROM SC_CALENDAR where, calendar_id = SELECT calendar_id FROM SC_LOCATION where, location_id = <production facility> AND EXISTS (SELECT 'X' FROM SC_CALENDAR_PERIOD where, calendar_id = <capacity calendar> and work_period_flag = 'Y')
      
    • Else, if a calendar exists in the logistics company of <production facility> with at least one working day, the program uses the logistics company calendar.
      <logistics company> = SELECT * FROM SC_LOCATION where, location_id = SELECT logistics_company_id FROM SC.LOCATION where location_id = <production facility> 
      <capacity calendar> = SELECT * FROM SC_CALENDAR where, calendar_id = SELECT calendar_id FROM SC_LOCATION where, location_id = <logistics company> AND EXISTS (SELECT 'X' FROM SC_CALENDAR_PERIOD where, calendar_id = <capacity calendar> and work_period_flag = 'Y')
      
  • Determine <shift pattern> for <resource unit>.

    Shift patterns are time-phased and have effective dates. A shift pattern can be periodic, for example, a pattern that repeats every 5 days. A shift pattern is used to specify the shift details, such as shift start and end days in the pattern periodicity, shift start and end times in the day, efficiency, utilization rate, number of machine or labor units, and the nominal capacity hours

    • If a shift pattern exists for <resource unit>, the program uses the shift pattern on the <resource unit>:
      <shift pattern> = SELECT * FROM SC_SHIFT_PATTERN_LINE where, shift_pattern_id = SELECT shift_pattern_id FROM SC_RESOURCE_UNIT where, resource_unit_id = <resource unit>
    • Else, if a shift pattern exists for <resource> or for <resource unit>, the program uses the shift pattern on <resource>:
      <shift pattern> = SELECT * FROM SC_SHIFT_PATTERN_LINE where, shift_pattern_id = SELECT shift_pattern_id FROM SC_RESOURCE where, resource_id = <resource>
    • Else, the program uses the default shift pattern that the SCP_DEFAULT_RESOURCE_SHIFT_PATTERN_ID SCV configuration parameter specifies.
      <shift pattern> = SELECT * FROM SC_SHIFT_PATTERN_LINE where, shift_pattern_id = SCP_DEFAULT_RESOURCE_SHIFT_PATTERN_ID
  • Determine the <shift pattern start day>.
    The start day for the shift pattern is based on the periodicity specified on the pattern definition. If periodicity is not 7 (weekly), then the start day aligns with the effective from date of the shift pattern. Else, the value of the SCV configuration parameter SCP_CAPACITY_WEEKLY_PATTERN_START_DAY determines the start day.
    <shift pattern periodicity> = SELECT periodicity FROM SC_SHIFT_PATTERN_LINE WHERE shift_pattern_id = <shift pattern>.shift_pattern_id
    • If <shift pattern periodicity> <> 7, then <shift pattern start day> = day of SELECT effective_from_date FROM SC_SHIFT_PATTERN_LINE where, shift_pattern_id = <shift pattern>.shift_pattern_id → Use the weekday of the effective from date, such as Monday, Tuesday, etc.
    • If <shift pattern periodicity> = 7, then use the value of the SCP_CAPACITY_WEEKLY_PATTERN_START_DAY SCV configuration parameter determines the start day: 1 = Monday, 2 = Tuesday, etc.
  • Retrieve regular capacity from shift pattern definition.
    • For each day between <planning horizon start date> and <planning horizon end date>, retrieve regular capacity using the nominal capacity hours on the shift pattern.
    • Exclude the capacity for any date that falls outside the effective period of the shift pattern.
  • Determine the <shift pattern adjustment>s. During certain periods of time, the <resource unit> can be assigned to add-on or override shift patterns. For example, these shift pattern adjustments are used to increase capacity during high season or to reduce capacity during low season. Shift pattern adjustments are defined for a resource unit, and for a specific period.
    • For each day between <planning horizon start date> and <planning horizon end date>, retrieve <shift pattern adjustment>s = SELECT shift_pattern_id FROM SC_RESOURCE_UNIT_SHIFT_PATTERN_ADJUSTMENT where, resource_unit_id = <resource unit> AND day BETWEEN effective_from_date AND effective_to_date

      There can be multiple shift pattern adjustments for a resource unit.

    • For each <shift pattern adjustment>, retrieve <adjusted capacity> as described in the ‘’ Determine the <shift pattern start day>’’ and ‘’ Retrieve regular capacity from shift pattern definition’’ steps mentioned above.
      • If the adjustment type of <shift pattern adjustment> = Addon, then retrieve the overtime capacity using the nominal capacity hours on the shift pattern adjustment.
      • If the adjustment type of <shift pattern adjustment> = Override, then retrieve the new regular capacity using the nominal capacity hours on the shift pattern adjustment.

      Adjustments are applied only on the days that fall between the effective from dates and effective to dates of the shift pattern adjustments.

      If both Override and Addon adjustments exist with the same effective dates, then both adjustments are used: regular capacity is replaced with override adjustment capacity and addon adjustment capacity is saved as overtime capacity.

      If more than one Override or more than one Addon adjustments are defined on the same date, an error message is logged, and no adjustments are used for the current resource unit.

  • Calculate the capacities for the <resource unit>.

    Regular, overtime and net capacities are calculated for a resource unit using its capacity calendar and shift pattern definition. If any, shift and shift pattern adjustments are considered.

    For each day between <planning horizon start date> and <planning horizon end date>, one record is created in SC_RESOURCE_UNIT_SHIFT_CAPACITY:

    • resource_unit_id = <resource unit>
    • capacity_date = day
    • shift_start_time = <shift pattern>.shift_start_time
    • shift_end_time = <shift pattern>.shift_end_time
    • regular_capacity_hours =
      • If <shift pattern adjustment> exists AND <shift pattern adjustment>.adjustment_type = Override, then <shift pattern adjustment>.nominal_capacity_hours
      • Else, <shift pattern>.nominal_capacity_hours
    • over_time_capacity_hours =
      • If <shift pattern adjustment> exists AND <shift pattern adjustment>.adjustment_type = AddOn, then <shift pattern adjustment>.nominal_capacity_hours
      • Else, considered as Null
    • maintenance_hours = Null
    • regular_efficiency =
      • If <shift pattern adjustment> exists AND <shift pattern adjustment>.adjustment_type = Override, then <shift pattern adjustment>.nominal_capacity_hours
      • Else, <resource unit>.efficiency_factor
    • over_time_efficiency =
      • If <shift pattern adjustment> exists AND <shift pattern adjustment>.adjustment_type = AddOn, then <shift pattern adjustment>.efficiency
      • Else, considered as Null
    • regular_utilization_rate =
      • If <shift adjustment> exists then <shift adjustment>.utilization_rate
      • Else, if <shift pattern adjustment> exists AND <shift pattern adjustment>.adjustment_type = Override, then <shift pattern adjustment>.utilization_rate
      • Else, <resource unit>.utilization_rate
    • over_time_efficiency =
      • If <shift pattern adjustment> exists AND <shift pattern adjustment>.adjustment_type = AddOn, then <shift pattern adjustment>.utilization_rate
      • Else, considered as Null
    • work_day_percentage = working_day_capacity_percent of the period in <capacity calendar> that contains the capacity_date
    • net_regular_capacity_hours = regular_capacity_hours x regular_utilization_rate x instance_qty x work_day_percentage / 100
    • net_overtime_capacity_hours = overtime_capacity_hours x overtime_utilization_rate x instance_qty x work_day_percentage / 100
    • net_capacity_hours = regular_capacity_hours + overtime_capacity_hours - maintenance_hours
    • resource_capacity_source = “Generated”
    • status = “Open”
  • Aggregate the resource unit capacities to capacities for the <resource>s.

    Using the links in the resource relations defined in the SC_RESOURCE_RELATION table, aggregate the capacities calculated for resource units to their corresponding resources.

    For each capacity date, regular, overtime and net capacities are summed from resource units, and the averages of the utilization rates, efficiencies and workday percentages are taken from the resource units, and one record is created in SC_RESOURCE_UNIT_SHIFT_CAPACITY:

    • resource_id = SC_RESOURCE_RELATION.resource_id
    • capacity_date = SC_RESOURCE_UNIT_SHIFT_CAPACITY.capacity_date
    • shift_start_time = Minimum of SC_RESOURCE_UNIT_SHIFT_CAPACITY.shift_start_time
    • shift_end_time = Minimum of SC_RESOURCE_UNIT_SHIFT_CAPACITY.shift_end_time
    • regular_capacity_hours = Sum of SC_RESOURCE_UNIT_SHIFT_CAPACITY.regular_capacity_hours
    • over_time_capacity_hours = Sum of SC_RESOURCE_UNIT_SHIFT_CAPACITY.over_time_capacity_hours
    • maintenance_hours = Sum of SC_RESOURCE_UNIT_SHIFT_CAPACITY.maintenance_hours
    • regular_efficiency = Average of SC_RESOURCE_UNIT_SHIFT_CAPACITY.regular_efficiency
    • over_time_efficiency = Average of SC_RESOURCE_UNIT_SHIFT_CAPACITY.over_time_efficiency
    • regular_utilization_rate = Average of SC_RESOURCE_UNIT_SHIFT_CAPACITY.regular_utilization_rate
    • work_day_percentage = Average of SC_RESOURCE_UNIT_SHIFT_CAPACITY.work_day_percentage
    • net_regular_capacity_hours = Sum of SC_RESOURCE_UNIT_SHIFT_CAPACITY.net_regular_capacity_hours
    • net_overtime_capacity_hours = Sum of SC_RESOURCE_UNIT_SHIFT_CAPACITY.net_overtime_capacity_hours
    • net_capacity_hours = Sum of SC_RESOURCE_UNIT_SHIFT_CAPACITY.net_capacity_hours
    • resource_capacity_source = “Generated”
    • status = “Open”