Capacity Calculation for Resources
- Determine the <capacity calendar> for the <resource>. A capacity calendar is used to identify working and non-working days. Calendars can also be used to define a generic capacity percentage for specific calendar periods. The program uses the generic capacity percentage for all resources and resource units that use the same calendar.
- If a calendar exists for <resource> 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')
- If a calendar exists for <resource> with at least one working day, the program uses the calendar on <resource>:
- Determine <shift pattern> for the <resource>.
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>, 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
- If a shift pattern exists for <resource>, the program uses the shift pattern on <resource>:
- Determine <shift pattern start day>.
The start day for the shift pattern is based on the periodicity specified on the pattern definition. If <shift pattern periodicity> is not 7 (weekly), then the start day aligns with the effective from date of the shift pattern. Else, the value of the SCP_CAPACITY_WEEKLY_PATTERN_START_DAY SCV configuration parameter 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 the SCP_CAPACITY_WEEKLY_PATTERN_START_DAY SCV configuration parameter determines the start day: 1 = Monday, 2 = Tuesday, etc.
- Retrieve regular capacity from the shift pattern definition.
- For each day between <planning horizon start date> and <planning horizon end date>, retrieve regular capacity, using the nominal capacity hours in the shift pattern.
- Exclude capacity for any date that falls outside the effective period of the shift pattern.
- Determine <shift pattern adjustment>s.
A <resource> can have add-on or override shift patterns for specific periods. For example, shift pattern adjustments increase capacity during high season or reduce capacity during low season. Shift pattern adjustments are defined for a resource and for a specific period. A resource can have multiple shift pattern adjustments.
- For each day between <planning horizon start date> and <planning horizon end date>, retrieve <shift pattern adjustment>s
<shift pattern adjustment>s = SELECT shift_pattern_id FROM SC_RESOURCE_SHIFT_PATTERN_ADJUSTMENT where resource_id = <resource> AND day BETWEEN effective_from_date AND effective_to_date - For each <shift pattern adjustment>, retrieve <adjusted capacity>, the program performs the ‘’Determine the <shift pattern start day>’’ and ‘’Retrieve regular capacity from shift pattern definition’’ steps as mentioned above. For each <shift pattern adjustment>:
- If adjustment type of <shift pattern adjustment> = Addon, the program retrieves the overtime capacity, using the nominal capacity hours in the shift pattern adjustment.
- If the adjustment type of <shift pattern adjustment> = Override, the program retrieves the new regular capacity, using the nominal capacity hours in the shift pattern adjustment.
Note:- Adjustments are applied only on the days that fall between the effective-from date and effective-to date of the shift pattern adjustment.
- If Override and Addon adjustments exist for the same effective dates, the program uses both adjustments.
- Regular capacity is replaced with override adjustment capacity.
- Addon adjustment capacity is saved as overtime capacity.
- If more than one Override or Addon adjustment exists for the same date, an error message is logged, and no adjustments are used for the current resource.
- For each day between <planning horizon start date> and <planning horizon end date>, retrieve <shift pattern adjustment>s
- Determine <shift adjustment>s.
Shift adjustments can increase or decrease the available machine or labor units or adjust the utilization rate for a shift. Shift adjustments are defined for a resource and for a specific period. The type of shift adjustment is always Override. A resource can have multiple shift adjustments.
- For each day between <planning horizon start date> and <planning horizon end date>, retrieve <shift adjustment>s.
<shift adjustment>s = SELECT shift_id FROM SC_RESOURCE_SHIFT_ADJUSTMENT where resource_id = <resource> AND day BETWEEN effective_from_date AND effective_to_dateFor each <shift adjustment>, retrieve:
- Overtime utilization rate
- Overtime number of machine or labor units
The program uses the utilization rate and number of machine or labor units on the shift adjustment. Adjustments are applied only on days that fall between the effective-from dates and effective-to dates of the shift adjustment.
- For each day between <planning horizon start date> and <planning horizon end date>, retrieve <shift adjustment>s.
- Calculate the capacities for <resource>.
The program calculates regular, overtime, and net capacities for a resource using the capacity calendar and the shift pattern definition. The calculation considers shift pattern adjustments and shift adjustments, when such adjustments exist. For each day between <planning horizon start date> and <planning horizon end date>, the program creates one record in SC_RESOURCE_SHIFT_CAPACITY with the following values:
- resource_id = <resource>
- capacity_date = day
- shift_start_time = <shift pattern>.shift_start_time
- shift_end_time = <shift pattern>.shift_end_time
- instance_qty =
- When <resource>.capacity_type = “Machine”:
- If <shift adjustment> exists, then instance_qty = <shift adjustment>.num_machine_units
- Else, instance_qty = <resource>.num_machine_units
- When <resource>.capacity_type = “Labor”:
- If <shift adjustment> exists, then <resource>.capacity_type = <shift adjustment>.num_labor_units
- Else, <resource>.capacity_type = <resource>.num_labor_units
- When <resource>.capacity_type = “Machine”:
- regular_capacity_hours =
- If <shift pattern adjustment> exists and <shift pattern adjustment>.adjustment_type = Override, then regular_capacity_hours = <shift pattern adjustment>.nominal_capacity_hours
- Else, regular_capacity_hours =<shift pattern>.nominal_capacity_hours
- over_time_capacity_hours =
- If <shift pattern adjustment> exists and <shift pattern adjustment>.adjustment_type = AddOn, then over_time_capacity_hours = <shift pattern adjustment>.nominal_capacity_hours
- Else, over_time_capacity_hours = Null
- maintenance_hours = Null
- regular_efficiency =
- If <shift pattern adjustment> exists and <shift pattern adjustment>.adjustment_type = Override, then regular_efficiency = <shift pattern adjustment>.nominal_capacity_hours
- Else, regular_efficiency = <resource>.efficiency_factor
- over_time_efficiency =
- If <shift pattern adjustment> exists and <shift pattern adjustment>.adjustment_type = AddOn, then over_time_efficiency = <shift pattern adjustment>.efficiency
- Else, over_time_efficiency = Null
- regular_utilization_rate =
- If <shift adjustment> exists, then regular_utilization_rate = <shift adjustment>.utilization_rate
- Else, if <shift pattern adjustment> exists and <shift pattern adjustment>.adjustment_type = Override, then regular_utilization_rate = <shift pattern adjustment>.utilization_rate
- Else, regular_utilization_rate = <resource>.utilization_rate
- over_time_efficiency =
- If <shift pattern adjustment> exists and <shift pattern adjustment>.adjustment_type = AddOn, then over_time_efficiency = <shift pattern adjustment>.utilization_rate
- Else, over_time_efficiency = 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”