You are time-study-analyzer - a specialized skill for time study analysis including stopwatch methods, performance rating, and standard time calculation.
Overview
This skill enables AI-powered time study analysis including:
defcalculate_allowances(normal_time: float, allowance_factors: dict):
"""
Calculate allowances and standard time
allowance_factors:
- personal: percentage (typically 5%)
- fatigue: percentage (varies by job)
- delay: percentage (unavoidable delays)
- special: any special allowances
"""
personal = allowance_factors.get('personal', 5)
fatigue = allowance_factors.get('fatigue', 4)
delay = allowance_factors.get('delay', 5)
special = allowance_factors.get('special', 0)
# Total allowance percentage
total_allowance_pct = personal + fatigue + delay + special
# Calculate standard time# Method 1: Add to normal time
allowance_time = normal_time * (total_allowance_pct / 100)
standard_time_add = normal_time + allowance_time
# Method 2: Divide by (1 - allowance factor) - more common
pfd_factor = total_allowance_pct / 100
standard_time_mult = normal_time / (1 - pfd_factor) if pfd_factor < 1else normal_time * 2return {
"normal_time": round(normal_time, 3),
"allowances": {
"personal": personal,
"fatigue": fatigue,
"delay": delay,
"special": special,
"total_percent": total_allowance_pct
},
"standard_time": round(standard_time_mult, 3),
"method": "multiplicative",
"pieces_per_hour": round(60 / standard_time_mult, 1) if standard_time_mult > 0else0
}
4. Sample Size Determination
defdetermine_sample_size(pilot_data: list, confidence: float = 0.95,
accuracy: float = 0.05):
"""
Determine required sample size for time study
pilot_data: initial observations
confidence: confidence level (0.95 or 0.99 typical)
accuracy: desired accuracy as proportion of mean (e.g., 0.05 = ±5%)
"""
n_pilot = len(pilot_data)
mean = np.mean(pilot_data)
std_dev = np.std(pilot_data, ddof=1)
cv = std_dev / mean # Coefficient of variation# Z-score for confidence level
z = stats.norm.ppf(1 - (1 - confidence) / 2)
# Required sample size# n = (z * s / (A * x̄))²# where A is desired accuracy proportion
required_n = (z * std_dev / (accuracy * mean)) ** 2# Adjust for small samples using t-distributionif required_n < 30:
t_value = stats.t.ppf(1 - (1 - confidence) / 2, df=max(n_pilot - 1, 1))
required_n = (t_value * std_dev / (accuracy * mean)) ** 2return {
"pilot_observations": n_pilot,
"pilot_mean": round(mean, 3),
"pilot_std_dev": round(std_dev, 3),
"coefficient_of_variation": round(cv, 3),
"confidence_level": confidence,
"desired_accuracy": accuracy,
"required_sample_size": int(np.ceil(required_n)),
"additional_observations_needed": max(0, int(np.ceil(required_n)) - n_pilot)
}
5. Element Breakdown
defcreate_element_breakdown(task_description: str, elements: list):
"""
Document element breakdown for time study
elements: list of {'name': str, 'description': str, 'type': str, 'breakpoint': str}
"""
breakdown = []
for i, elem inenumerate(elements):
breakdown.append({
'element_number': i + 1,
'name': elem['name'],
'description': elem['description'],
'type': elem.get('type', 'regular'), # regular, occasional, foreign'breakpoint': elem.get('breakpoint', ''), # endpoint description'machine_controlled': elem.get('machine_controlled', False),
'frequency': elem.get('frequency', 1.0) # times per cycle
})
return {
"task": task_description,
"element_count": len(breakdown),
"elements": breakdown,
"element_types": {
"regular": sum(1for e in breakdown if e['type'] == 'regular'),
"occasional": sum(1for e in breakdown if e['type'] == 'occasional'),
"foreign": sum(1for e in breakdown if e['type'] == 'foreign')
}
}