formulab 0.10.3 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ie/index.d.ts +7 -0
- package/dist/ie/index.d.ts.map +1 -0
- package/dist/ie/index.js +7 -0
- package/dist/ie/index.js.map +1 -0
- package/dist/ie/learningCurve.d.ts +19 -0
- package/dist/ie/learningCurve.d.ts.map +1 -0
- package/dist/ie/learningCurve.js +65 -0
- package/dist/ie/learningCurve.js.map +1 -0
- package/dist/ie/standardTime.d.ts +17 -0
- package/dist/ie/standardTime.d.ts.map +1 -0
- package/dist/ie/standardTime.js +36 -0
- package/dist/ie/standardTime.js.map +1 -0
- package/dist/ie/timeStudy.d.ts +20 -0
- package/dist/ie/timeStudy.d.ts.map +1 -0
- package/dist/ie/timeStudy.js +52 -0
- package/dist/ie/timeStudy.js.map +1 -0
- package/dist/ie/types.d.ts +84 -0
- package/dist/ie/types.d.ts.map +1 -0
- package/dist/ie/types.js +2 -0
- package/dist/ie/types.js.map +1 -0
- package/dist/ie/vaAnalysis.d.ts +15 -0
- package/dist/ie/vaAnalysis.d.ts.map +1 -0
- package/dist/ie/vaAnalysis.js +45 -0
- package/dist/ie/vaAnalysis.js.map +1 -0
- package/dist/ie/workSampling.d.ts +19 -0
- package/dist/ie/workSampling.d.ts.map +1 -0
- package/dist/ie/workSampling.js +45 -0
- package/dist/ie/workSampling.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/quality/actionPriority.d.ts +18 -0
- package/dist/quality/actionPriority.d.ts.map +1 -0
- package/dist/quality/actionPriority.js +128 -0
- package/dist/quality/actionPriority.js.map +1 -0
- package/dist/quality/cpkToOccurrence.d.ts +13 -0
- package/dist/quality/cpkToOccurrence.d.ts.map +1 -0
- package/dist/quality/cpkToOccurrence.js +35 -0
- package/dist/quality/cpkToOccurrence.js.map +1 -0
- package/dist/quality/index.d.ts +4 -1
- package/dist/quality/index.d.ts.map +1 -1
- package/dist/quality/index.js +3 -0
- package/dist/quality/index.js.map +1 -1
- package/dist/quality/nelsonRules.d.ts +16 -0
- package/dist/quality/nelsonRules.d.ts.map +1 -0
- package/dist/quality/nelsonRules.js +213 -0
- package/dist/quality/nelsonRules.js.map +1 -0
- package/dist/quality/types.d.ts +45 -0
- package/dist/quality/types.d.ts.map +1 -1
- package/package.json +46 -18
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { standardTime } from './standardTime.js';
|
|
2
|
+
export { timeStudy } from './timeStudy.js';
|
|
3
|
+
export { workSampling } from './workSampling.js';
|
|
4
|
+
export { vaAnalysis } from './vaAnalysis.js';
|
|
5
|
+
export { learningCurve } from './learningCurve.js';
|
|
6
|
+
export type { StandardTimeInput, StandardTimeResult, TimeStudyInput, TimeStudyResult, WorkSamplingInput, WorkSamplingResult, ActivityCategory, Activity, VaAnalysisInput, CategorySummary, VaAnalysisResult, LearningCurveModel, LearningCurveInput, LearningCurveResult, } from './types.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ie/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,YAAY,EAEV,iBAAiB,EACjB,kBAAkB,EAElB,cAAc,EACd,eAAe,EAEf,iBAAiB,EACjB,kBAAkB,EAElB,gBAAgB,EAChB,QAAQ,EACR,eAAe,EACf,eAAe,EACf,gBAAgB,EAEhB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,YAAY,CAAC"}
|
package/dist/ie/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// IE (Industrial Engineering) domain formulas
|
|
2
|
+
export { standardTime } from './standardTime.js';
|
|
3
|
+
export { timeStudy } from './timeStudy.js';
|
|
4
|
+
export { workSampling } from './workSampling.js';
|
|
5
|
+
export { vaAnalysis } from './vaAnalysis.js';
|
|
6
|
+
export { learningCurve } from './learningCurve.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ie/index.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { LearningCurveInput, LearningCurveResult } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Learning Curve (Wright's Law)
|
|
4
|
+
*
|
|
5
|
+
* @formula
|
|
6
|
+
* b = ln(learningRate) / ln(2)
|
|
7
|
+
* Unit model: unitTime = firstUnitTime × unitNumber^b
|
|
8
|
+
* Cumulative model: cumulativeAverageTime = firstUnitTime × unitNumber^b
|
|
9
|
+
* cumulativeTotalTime = cumulativeAverageTime × unitNumber
|
|
10
|
+
*
|
|
11
|
+
* @reference Wright, T.P. (1936). "Factors Affecting the Cost of Airplanes".
|
|
12
|
+
* Journal of the Aeronautical Sciences, 3(4), 122-128.
|
|
13
|
+
*
|
|
14
|
+
* @throws {RangeError} First unit time must be a positive number
|
|
15
|
+
* @throws {RangeError} Learning rate must be between 0 and 1 (exclusive)
|
|
16
|
+
* @throws {RangeError} Unit number must be a positive integer
|
|
17
|
+
*/
|
|
18
|
+
export declare function learningCurve(input: LearningCurveInput): LearningCurveResult;
|
|
19
|
+
//# sourceMappingURL=learningCurve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"learningCurve.d.ts","sourceRoot":"","sources":["../../src/ie/learningCurve.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE1E;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,mBAAmB,CAiD5E"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { roundTo } from '../utils.js';
|
|
2
|
+
/**
|
|
3
|
+
* Learning Curve (Wright's Law)
|
|
4
|
+
*
|
|
5
|
+
* @formula
|
|
6
|
+
* b = ln(learningRate) / ln(2)
|
|
7
|
+
* Unit model: unitTime = firstUnitTime × unitNumber^b
|
|
8
|
+
* Cumulative model: cumulativeAverageTime = firstUnitTime × unitNumber^b
|
|
9
|
+
* cumulativeTotalTime = cumulativeAverageTime × unitNumber
|
|
10
|
+
*
|
|
11
|
+
* @reference Wright, T.P. (1936). "Factors Affecting the Cost of Airplanes".
|
|
12
|
+
* Journal of the Aeronautical Sciences, 3(4), 122-128.
|
|
13
|
+
*
|
|
14
|
+
* @throws {RangeError} First unit time must be a positive number
|
|
15
|
+
* @throws {RangeError} Learning rate must be between 0 and 1 (exclusive)
|
|
16
|
+
* @throws {RangeError} Unit number must be a positive integer
|
|
17
|
+
*/
|
|
18
|
+
export function learningCurve(input) {
|
|
19
|
+
const { firstUnitTime, learningRate, unitNumber, model = 'unit' } = input;
|
|
20
|
+
if (!Number.isFinite(firstUnitTime) || firstUnitTime <= 0) {
|
|
21
|
+
throw new RangeError('First unit time must be a positive number');
|
|
22
|
+
}
|
|
23
|
+
if (!Number.isFinite(learningRate) || learningRate <= 0 || learningRate >= 1) {
|
|
24
|
+
throw new RangeError('Learning rate must be between 0 and 1 (exclusive)');
|
|
25
|
+
}
|
|
26
|
+
if (!Number.isFinite(unitNumber) || unitNumber < 1 || !Number.isInteger(unitNumber)) {
|
|
27
|
+
throw new RangeError('Unit number must be a positive integer');
|
|
28
|
+
}
|
|
29
|
+
const b = Math.log(learningRate) / Math.log(2);
|
|
30
|
+
let unitTime;
|
|
31
|
+
let cumulativeAverageTime;
|
|
32
|
+
let cumulativeTotalTime;
|
|
33
|
+
if (model === 'cumulative') {
|
|
34
|
+
// Cumulative average model: T̄(n) = T1 × n^b
|
|
35
|
+
cumulativeAverageTime = firstUnitTime * Math.pow(unitNumber, b);
|
|
36
|
+
cumulativeTotalTime = cumulativeAverageTime * unitNumber;
|
|
37
|
+
// Individual unit time: T(n) = cumTotal(n) - cumTotal(n-1)
|
|
38
|
+
if (unitNumber === 1) {
|
|
39
|
+
unitTime = firstUnitTime;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
const prevCumAvg = firstUnitTime * Math.pow(unitNumber - 1, b);
|
|
43
|
+
const prevCumTotal = prevCumAvg * (unitNumber - 1);
|
|
44
|
+
unitTime = cumulativeTotalTime - prevCumTotal;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
// Unit model: T(n) = T1 × n^b gives the nth unit time directly
|
|
49
|
+
unitTime = firstUnitTime * Math.pow(unitNumber, b);
|
|
50
|
+
// Approximate cumulative average by summing individual unit times
|
|
51
|
+
let cumTotal = 0;
|
|
52
|
+
for (let i = 1; i <= unitNumber; i++) {
|
|
53
|
+
cumTotal += firstUnitTime * Math.pow(i, b);
|
|
54
|
+
}
|
|
55
|
+
cumulativeTotalTime = cumTotal;
|
|
56
|
+
cumulativeAverageTime = cumTotal / unitNumber;
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
unitTime: roundTo(unitTime, 4),
|
|
60
|
+
cumulativeAverageTime: roundTo(cumulativeAverageTime, 4),
|
|
61
|
+
cumulativeTotalTime: roundTo(cumulativeTotalTime, 4),
|
|
62
|
+
learningExponent: roundTo(b, 6),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=learningCurve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"learningCurve.js","sourceRoot":"","sources":["../../src/ie/learningCurve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,aAAa,CAAC,KAAyB;IACrD,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC;IAE1E,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,aAAa,IAAI,CAAC,EAAE,CAAC;QAC1D,MAAM,IAAI,UAAU,CAAC,2CAA2C,CAAC,CAAC;IACpE,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,YAAY,IAAI,CAAC,IAAI,YAAY,IAAI,CAAC,EAAE,CAAC;QAC7E,MAAM,IAAI,UAAU,CAAC,mDAAmD,CAAC,CAAC;IAC5E,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,UAAU,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC;QACpF,MAAM,IAAI,UAAU,CAAC,wCAAwC,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAE/C,IAAI,QAAgB,CAAC;IACrB,IAAI,qBAA6B,CAAC;IAClC,IAAI,mBAA2B,CAAC;IAEhC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AChC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { StandardTimeInput, StandardTimeResult } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Standard Time Calculation
|
|
4
|
+
*
|
|
5
|
+
* @formula
|
|
6
|
+
* normalTime = observedTime × ratingFactor
|
|
7
|
+
* standardTime = normalTime × (1 + allowancePercent / 100)
|
|
8
|
+
*
|
|
9
|
+
* @reference ILO (International Labour Organization). "Introduction to Work Study".
|
|
10
|
+
* @reference Barnes, R.M. (1980). "Motion and Time Study: Design and Measurement of Work".
|
|
11
|
+
*
|
|
12
|
+
* @throws {RangeError} Observed time must be a positive number
|
|
13
|
+
* @throws {RangeError} Rating factor must be between 0 (exclusive) and 2 (inclusive)
|
|
14
|
+
* @throws {RangeError} Allowance percent must be between 0 and 100
|
|
15
|
+
*/
|
|
16
|
+
export declare function standardTime(input: StandardTimeInput): StandardTimeResult;
|
|
17
|
+
//# sourceMappingURL=standardTime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standardTime.d.ts","sourceRoot":"","sources":["../../src/ie/standardTime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAExE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,kBAAkB,CAsBzE"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { roundTo } from '../utils.js';
|
|
2
|
+
/**
|
|
3
|
+
* Standard Time Calculation
|
|
4
|
+
*
|
|
5
|
+
* @formula
|
|
6
|
+
* normalTime = observedTime × ratingFactor
|
|
7
|
+
* standardTime = normalTime × (1 + allowancePercent / 100)
|
|
8
|
+
*
|
|
9
|
+
* @reference ILO (International Labour Organization). "Introduction to Work Study".
|
|
10
|
+
* @reference Barnes, R.M. (1980). "Motion and Time Study: Design and Measurement of Work".
|
|
11
|
+
*
|
|
12
|
+
* @throws {RangeError} Observed time must be a positive number
|
|
13
|
+
* @throws {RangeError} Rating factor must be between 0 (exclusive) and 2 (inclusive)
|
|
14
|
+
* @throws {RangeError} Allowance percent must be between 0 and 100
|
|
15
|
+
*/
|
|
16
|
+
export function standardTime(input) {
|
|
17
|
+
const { observedTime, ratingFactor, allowancePercent } = input;
|
|
18
|
+
if (!Number.isFinite(observedTime) || observedTime <= 0) {
|
|
19
|
+
throw new RangeError('Observed time must be a positive number');
|
|
20
|
+
}
|
|
21
|
+
if (!Number.isFinite(ratingFactor) || ratingFactor <= 0 || ratingFactor > 2) {
|
|
22
|
+
throw new RangeError('Rating factor must be between 0 (exclusive) and 2 (inclusive)');
|
|
23
|
+
}
|
|
24
|
+
if (!Number.isFinite(allowancePercent) || allowancePercent < 0 || allowancePercent > 100) {
|
|
25
|
+
throw new RangeError('Allowance percent must be between 0 and 100');
|
|
26
|
+
}
|
|
27
|
+
const normalTime = observedTime * ratingFactor;
|
|
28
|
+
const allowanceTime = normalTime * (allowancePercent / 100);
|
|
29
|
+
const std = normalTime + allowanceTime;
|
|
30
|
+
return {
|
|
31
|
+
normalTime: roundTo(normalTime, 4),
|
|
32
|
+
standardTime: roundTo(std, 4),
|
|
33
|
+
allowanceTime: roundTo(allowanceTime, 4),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=standardTime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standardTime.js","sourceRoot":"","sources":["../../src/ie/standardTime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,YAAY,CAAC,KAAwB;IACnD,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,GAAG,KAAK,CAAC;IAE/D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,YAAY,IAAI,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,UAAU,CAAC,yCAAyC,CAAC,CAAC;IAClE,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,YAAY,IAAI,CAAC,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;QAC5E,MAAM,IAAI,UAAU,CAAC,+DAA+D,CAAC,CAAC;IACxF,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,gBAAgB,GAAG,CAAC,IAAI,gBAAgB,GAAG,GAAG,EAAE,CAAC;QACzF,MAAM,IAAI,UAAU,CAAC,6CAA6C,CAAC,CAAC;IACtE,CAAC;IAED,MAAM,UAAU,GAAG,YAAY,GAAG,YAAY,CAAC;IAC/C,MAAM,aAAa,GAAG,UAAU,GAAG,CAAC,gBAAgB,GAAG,GAAG,CAAC,CAAC;IAC5D,MAAM,GAAG,GAAG,UAAU,GAAG,aAAa,CAAC;IAEvC,OAAO;QACL,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;QAClC,YAAY,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAC7B,aAAa,EAAE,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;KACzC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TimeStudyInput, TimeStudyResult } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Time Study — Required Number of Observations
|
|
4
|
+
*
|
|
5
|
+
* @formula n = (z × s / (e × x̄))²
|
|
6
|
+
* where z = z-score for confidence level
|
|
7
|
+
* s = sample standard deviation
|
|
8
|
+
* e = accuracy / 100 (fractional)
|
|
9
|
+
* x̄ = sample mean
|
|
10
|
+
*
|
|
11
|
+
* @reference Barnes, R.M. (1980). "Motion and Time Study".
|
|
12
|
+
* @reference Niebel, B.W. & Freivalds, A. (2003). "Methods, Standards, and Work Design".
|
|
13
|
+
*
|
|
14
|
+
* @throws {RangeError} Observations must have at least 2 elements
|
|
15
|
+
* @throws {RangeError} All observation values must be positive
|
|
16
|
+
* @throws {RangeError} Confidence must be between 0 and 1 (exclusive)
|
|
17
|
+
* @throws {RangeError} Accuracy must be a positive number
|
|
18
|
+
*/
|
|
19
|
+
export declare function timeStudy(input: TimeStudyInput): TimeStudyResult;
|
|
20
|
+
//# sourceMappingURL=timeStudy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeStudy.d.ts","sourceRoot":"","sources":["../../src/ie/timeStudy.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,eAAe,CAoChE"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { roundTo } from '../utils.js';
|
|
2
|
+
import { normalInvCDF } from '../math.js';
|
|
3
|
+
/**
|
|
4
|
+
* Time Study — Required Number of Observations
|
|
5
|
+
*
|
|
6
|
+
* @formula n = (z × s / (e × x̄))²
|
|
7
|
+
* where z = z-score for confidence level
|
|
8
|
+
* s = sample standard deviation
|
|
9
|
+
* e = accuracy / 100 (fractional)
|
|
10
|
+
* x̄ = sample mean
|
|
11
|
+
*
|
|
12
|
+
* @reference Barnes, R.M. (1980). "Motion and Time Study".
|
|
13
|
+
* @reference Niebel, B.W. & Freivalds, A. (2003). "Methods, Standards, and Work Design".
|
|
14
|
+
*
|
|
15
|
+
* @throws {RangeError} Observations must have at least 2 elements
|
|
16
|
+
* @throws {RangeError} All observation values must be positive
|
|
17
|
+
* @throws {RangeError} Confidence must be between 0 and 1 (exclusive)
|
|
18
|
+
* @throws {RangeError} Accuracy must be a positive number
|
|
19
|
+
*/
|
|
20
|
+
export function timeStudy(input) {
|
|
21
|
+
const { observations, confidence, accuracy } = input;
|
|
22
|
+
if (!Array.isArray(observations) || observations.length < 2) {
|
|
23
|
+
throw new RangeError('Observations must have at least 2 elements');
|
|
24
|
+
}
|
|
25
|
+
for (let i = 0; i < observations.length; i++) {
|
|
26
|
+
if (!Number.isFinite(observations[i]) || observations[i] <= 0) {
|
|
27
|
+
throw new RangeError('All observation values must be positive');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (!Number.isFinite(confidence) || confidence <= 0 || confidence >= 1) {
|
|
31
|
+
throw new RangeError('Confidence must be between 0 and 1 (exclusive)');
|
|
32
|
+
}
|
|
33
|
+
if (!Number.isFinite(accuracy) || accuracy <= 0) {
|
|
34
|
+
throw new RangeError('Accuracy must be a positive number');
|
|
35
|
+
}
|
|
36
|
+
const n = observations.length;
|
|
37
|
+
const mean = observations.reduce((s, v) => s + v, 0) / n;
|
|
38
|
+
const variance = observations.reduce((s, v) => s + (v - mean) ** 2, 0) / (n - 1);
|
|
39
|
+
const stdDev = Math.sqrt(variance);
|
|
40
|
+
// z-score for two-tailed confidence
|
|
41
|
+
const z = normalInvCDF(1 - (1 - confidence) / 2);
|
|
42
|
+
const e = accuracy / 100;
|
|
43
|
+
const required = Math.ceil((z * stdDev / (e * mean)) ** 2);
|
|
44
|
+
return {
|
|
45
|
+
mean: roundTo(mean, 4),
|
|
46
|
+
stdDev: roundTo(stdDev, 4),
|
|
47
|
+
count: n,
|
|
48
|
+
requiredObservations: required,
|
|
49
|
+
isSufficient: n >= required,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=timeStudy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeStudy.js","sourceRoot":"","sources":["../../src/ie/timeStudy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,SAAS,C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E,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACjF,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAEnC,oCAAoC;IACpC,MAAM,CAAC,GAAG,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IACjD,MAAM,CAAC,GAAG,QAAQ,GAAG,GAAG,CAAC;IAEzB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAE3D,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QACtB,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QAC1B,KAAK,EAAE,CAAC;QACR,oBAAoB,EAAE,QAAQ;QAC9B,YAAY,EAAE,CAAC,IAAI,QAAQ;KAC5B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard Time Types
|
|
3
|
+
*/
|
|
4
|
+
export interface StandardTimeInput {
|
|
5
|
+
observedTime: number;
|
|
6
|
+
ratingFactor: number;
|
|
7
|
+
allowancePercent: number;
|
|
8
|
+
}
|
|
9
|
+
export interface StandardTimeResult {
|
|
10
|
+
normalTime: number;
|
|
11
|
+
standardTime: number;
|
|
12
|
+
allowanceTime: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Time Study Types
|
|
16
|
+
*/
|
|
17
|
+
export interface TimeStudyInput {
|
|
18
|
+
observations: number[];
|
|
19
|
+
confidence: number;
|
|
20
|
+
accuracy: number;
|
|
21
|
+
}
|
|
22
|
+
export interface TimeStudyResult {
|
|
23
|
+
mean: number;
|
|
24
|
+
stdDev: number;
|
|
25
|
+
count: number;
|
|
26
|
+
requiredObservations: number;
|
|
27
|
+
isSufficient: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Work Sampling Types
|
|
31
|
+
*/
|
|
32
|
+
export interface WorkSamplingInput {
|
|
33
|
+
totalObservations: number;
|
|
34
|
+
activityObservations: number;
|
|
35
|
+
confidence: number;
|
|
36
|
+
accuracy: number;
|
|
37
|
+
}
|
|
38
|
+
export interface WorkSamplingResult {
|
|
39
|
+
proportion: number;
|
|
40
|
+
requiredObservations: number;
|
|
41
|
+
isSufficient: boolean;
|
|
42
|
+
marginOfError: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* VA/NVA Analysis Types
|
|
46
|
+
*/
|
|
47
|
+
export type ActivityCategory = 'VA' | 'NVA' | 'NNVA';
|
|
48
|
+
export interface Activity {
|
|
49
|
+
name: string;
|
|
50
|
+
duration: number;
|
|
51
|
+
category: ActivityCategory;
|
|
52
|
+
}
|
|
53
|
+
export interface VaAnalysisInput {
|
|
54
|
+
activities: Activity[];
|
|
55
|
+
}
|
|
56
|
+
export interface CategorySummary {
|
|
57
|
+
count: number;
|
|
58
|
+
totalDuration: number;
|
|
59
|
+
ratio: number;
|
|
60
|
+
}
|
|
61
|
+
export interface VaAnalysisResult {
|
|
62
|
+
totalDuration: number;
|
|
63
|
+
va: CategorySummary;
|
|
64
|
+
nva: CategorySummary;
|
|
65
|
+
nnva: CategorySummary;
|
|
66
|
+
vaRatio: number;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Learning Curve Types
|
|
70
|
+
*/
|
|
71
|
+
export type LearningCurveModel = 'unit' | 'cumulative';
|
|
72
|
+
export interface LearningCurveInput {
|
|
73
|
+
firstUnitTime: number;
|
|
74
|
+
learningRate: number;
|
|
75
|
+
unitNumber: number;
|
|
76
|
+
model?: LearningCurveModel;
|
|
77
|
+
}
|
|
78
|
+
export interface LearningCurveResult {
|
|
79
|
+
unitTime: number;
|
|
80
|
+
cumulativeAverageTime: number;
|
|
81
|
+
cumulativeTotalTime: number;
|
|
82
|
+
learningExponent: number;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ie/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,oBAAoB,EAAE,MAAM,CAAC;IAC7B,YAAY,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,KAAK,GAAG,MAAM,CAAC;AAErD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,gBAAgB,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,QAAQ,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,EAAE,EAAE,eAAe,CAAC;IACpB,GAAG,EAAE,eAAe,CAAC;IACrB,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,YAAY,CAAC;AAEvD,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,kBAAkB,CAAC;CAC5B;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;CAC1B"}
|
package/dist/ie/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/ie/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { VaAnalysisInput, VaAnalysisResult } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Value-Added / Non-Value-Added Analysis
|
|
4
|
+
*
|
|
5
|
+
* Categorizes process activities as VA (Value Added), NVA (Non-Value Added),
|
|
6
|
+
* or NNVA (Necessary Non-Value Added) and computes time ratios.
|
|
7
|
+
*
|
|
8
|
+
* @reference Womack, J.P. & Jones, D.T. (1996). "Lean Thinking".
|
|
9
|
+
* @reference Ohno, T. (1988). "Toyota Production System".
|
|
10
|
+
*
|
|
11
|
+
* @throws {RangeError} Activities array must have at least 1 element
|
|
12
|
+
* @throws {RangeError} All activity durations must be non-negative
|
|
13
|
+
*/
|
|
14
|
+
export declare function vaAnalysis(input: VaAnalysisInput): VaAnalysisResult;
|
|
15
|
+
//# sourceMappingURL=vaAnalysis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vaAnalysis.d.ts","sourceRoot":"","sources":["../../src/ie/vaAnalysis.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAmB,MAAM,YAAY,CAAC;AAErF;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,gBAAgB,CAoCnE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { roundTo } from '../utils.js';
|
|
2
|
+
/**
|
|
3
|
+
* Value-Added / Non-Value-Added Analysis
|
|
4
|
+
*
|
|
5
|
+
* Categorizes process activities as VA (Value Added), NVA (Non-Value Added),
|
|
6
|
+
* or NNVA (Necessary Non-Value Added) and computes time ratios.
|
|
7
|
+
*
|
|
8
|
+
* @reference Womack, J.P. & Jones, D.T. (1996). "Lean Thinking".
|
|
9
|
+
* @reference Ohno, T. (1988). "Toyota Production System".
|
|
10
|
+
*
|
|
11
|
+
* @throws {RangeError} Activities array must have at least 1 element
|
|
12
|
+
* @throws {RangeError} All activity durations must be non-negative
|
|
13
|
+
*/
|
|
14
|
+
export function vaAnalysis(input) {
|
|
15
|
+
const { activities } = input;
|
|
16
|
+
if (!Array.isArray(activities) || activities.length < 1) {
|
|
17
|
+
throw new RangeError('Activities array must have at least 1 element');
|
|
18
|
+
}
|
|
19
|
+
for (let i = 0; i < activities.length; i++) {
|
|
20
|
+
if (!Number.isFinite(activities[i].duration) || activities[i].duration < 0) {
|
|
21
|
+
throw new RangeError('All activity durations must be non-negative');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const totalDuration = activities.reduce((s, a) => s + a.duration, 0);
|
|
25
|
+
const buildSummary = (category) => {
|
|
26
|
+
const filtered = activities.filter(a => a.category === category);
|
|
27
|
+
const catTotal = filtered.reduce((s, a) => s + a.duration, 0);
|
|
28
|
+
return {
|
|
29
|
+
count: filtered.length,
|
|
30
|
+
totalDuration: roundTo(catTotal, 4),
|
|
31
|
+
ratio: totalDuration > 0 ? roundTo(catTotal / totalDuration, 4) : 0,
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
const va = buildSummary('VA');
|
|
35
|
+
const nva = buildSummary('NVA');
|
|
36
|
+
const nnva = buildSummary('NNVA');
|
|
37
|
+
return {
|
|
38
|
+
totalDuration: roundTo(totalDuration, 4),
|
|
39
|
+
va,
|
|
40
|
+
nva,
|
|
41
|
+
nnva,
|
|
42
|
+
vaRatio: va.ratio,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=vaAnalysis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vaAnalysis.js","sourceRoot":"","sources":["../../src/ie/vaAnalysis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,UAAU,CAAC,KAAsB;IAC/C,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAE7B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,UAAU,CAAC,+CAA+C,CAAC,CAAC;IACxE,CAAC;IAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3C,IAAI,CA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AK;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { WorkSamplingInput, WorkSamplingResult } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Work Sampling Analysis
|
|
4
|
+
*
|
|
5
|
+
* @formula
|
|
6
|
+
* proportion = activityObservations / totalObservations
|
|
7
|
+
* requiredObservations = z² × p × (1 - p) / e²
|
|
8
|
+
* marginOfError = z × √(p × (1 - p) / totalObservations)
|
|
9
|
+
*
|
|
10
|
+
* @reference Barnes, R.M. (1980). "Motion and Time Study".
|
|
11
|
+
* @reference ILO. "Introduction to Work Study".
|
|
12
|
+
*
|
|
13
|
+
* @throws {RangeError} Total observations must be a positive integer
|
|
14
|
+
* @throws {RangeError} Activity observations must be between 0 and total observations
|
|
15
|
+
* @throws {RangeError} Confidence must be between 0 and 1 (exclusive)
|
|
16
|
+
* @throws {RangeError} Accuracy must be a positive number
|
|
17
|
+
*/
|
|
18
|
+
export declare function workSampling(input: WorkSamplingInput): WorkSamplingResult;
|
|
19
|
+
//# sourceMappingURL=workSampling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workSampling.d.ts","sourceRoot":"","sources":["../../src/ie/workSampling.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAExE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,kBAAkB,CA6BzE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { roundTo } from '../utils.js';
|
|
2
|
+
import { normalInvCDF } from '../math.js';
|
|
3
|
+
/**
|
|
4
|
+
* Work Sampling Analysis
|
|
5
|
+
*
|
|
6
|
+
* @formula
|
|
7
|
+
* proportion = activityObservations / totalObservations
|
|
8
|
+
* requiredObservations = z² × p × (1 - p) / e²
|
|
9
|
+
* marginOfError = z × √(p × (1 - p) / totalObservations)
|
|
10
|
+
*
|
|
11
|
+
* @reference Barnes, R.M. (1980). "Motion and Time Study".
|
|
12
|
+
* @reference ILO. "Introduction to Work Study".
|
|
13
|
+
*
|
|
14
|
+
* @throws {RangeError} Total observations must be a positive integer
|
|
15
|
+
* @throws {RangeError} Activity observations must be between 0 and total observations
|
|
16
|
+
* @throws {RangeError} Confidence must be between 0 and 1 (exclusive)
|
|
17
|
+
* @throws {RangeError} Accuracy must be a positive number
|
|
18
|
+
*/
|
|
19
|
+
export function workSampling(input) {
|
|
20
|
+
const { totalObservations, activityObservations, confidence, accuracy } = input;
|
|
21
|
+
if (!Number.isFinite(totalObservations) || totalObservations <= 0) {
|
|
22
|
+
throw new RangeError('Total observations must be a positive integer');
|
|
23
|
+
}
|
|
24
|
+
if (!Number.isFinite(activityObservations) || activityObservations < 0 || activityObservations > totalObservations) {
|
|
25
|
+
throw new RangeError('Activity observations must be between 0 and total observations');
|
|
26
|
+
}
|
|
27
|
+
if (!Number.isFinite(confidence) || confidence <= 0 || confidence >= 1) {
|
|
28
|
+
throw new RangeError('Confidence must be between 0 and 1 (exclusive)');
|
|
29
|
+
}
|
|
30
|
+
if (!Number.isFinite(accuracy) || accuracy <= 0) {
|
|
31
|
+
throw new RangeError('Accuracy must be a positive number');
|
|
32
|
+
}
|
|
33
|
+
const p = activityObservations / totalObservations;
|
|
34
|
+
const z = normalInvCDF(1 - (1 - confidence) / 2);
|
|
35
|
+
const e = accuracy / 100;
|
|
36
|
+
const required = Math.ceil((z * z * p * (1 - p)) / (e * e));
|
|
37
|
+
const marginOfError = z * Math.sqrt((p * (1 - p)) / totalObservations);
|
|
38
|
+
return {
|
|
39
|
+
proportion: roundTo(p, 4),
|
|
40
|
+
requiredObservations: required,
|
|
41
|
+
isSufficient: totalObservations >= required,
|
|
42
|
+
marginOfError: roundTo(marginOfError, 4),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=workSampling.js.map
|
|
@@ -0,0 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,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC5D,MAAM,aAAa,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC;IAEvE,OAAO;QACL,UAAU,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;QACzB,oBAAoB,EAAE,QAAQ;QAC9B,YAAY,EAAE,iBAAiB,IAAI,QAAQ;QAC3C,aAAa,EAAE,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;KACzC,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,+BAA+B;AAE/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,+BAA+B;AAE/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ActionPriorityInput, ActionPriorityResult } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* AIAG-VDA 2019 Action Priority (AP) Matrix
|
|
4
|
+
*
|
|
5
|
+
* Replaces the traditional RPN-based prioritization with a structured
|
|
6
|
+
* S × O × D matrix lookup that better reflects risk relationships.
|
|
7
|
+
*
|
|
8
|
+
* @formula AP = lookup(severityGroup, occurrenceGroup, detectionGroup)
|
|
9
|
+
* - RPN = S × O × D (still computed for reference)
|
|
10
|
+
*
|
|
11
|
+
* @reference AIAG & VDA (2019). "FMEA Handbook", 1st Edition.
|
|
12
|
+
*
|
|
13
|
+
* @throws {RangeError} Severity must be between 1 and 10
|
|
14
|
+
* @throws {RangeError} Occurrence must be between 1 and 10
|
|
15
|
+
* @throws {RangeError} Detection must be between 1 and 10
|
|
16
|
+
*/
|
|
17
|
+
export declare function actionPriority(input: ActionPriorityInput): ActionPriorityResult;
|
|
18
|
+
//# sourceMappingURL=actionPriority.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actionPriority.d.ts","sourceRoot":"","sources":["../../src/quality/actionPriority.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAuB,MAAM,YAAY,CAAC;AAEjG;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,oBAAoB,CA+B/E"}
|