onroute-policy-engine 2.12.1 → 2.14.0
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.
|
@@ -58,9 +58,9 @@ export declare function CheckBridgeFormula(policy: Policy, _vehicleConfiguration
|
|
|
58
58
|
* Validates the number of tires per axle unit against regulatory requirements.
|
|
59
59
|
*
|
|
60
60
|
* This function checks that each axle unit has a valid number of tires based on
|
|
61
|
-
* the number of axles in that unit
|
|
62
|
-
*
|
|
63
|
-
*
|
|
61
|
+
* the number of axles in that unit and the axle unit position. Axle unit 1 is
|
|
62
|
+
* the steer axle unit, axle unit 2 is the drive axle unit, and axle units 3+
|
|
63
|
+
* use the generic axle unit allowance.
|
|
64
64
|
*
|
|
65
65
|
* @param _policy - The policy instance (unused in this check, but required by PolicyCheck type)
|
|
66
66
|
* @param _vehicleConfiguration - Vehicle configuration (unused in this check, but required by PolicyCheck type)
|
|
@@ -70,15 +70,15 @@ export declare function CheckBridgeFormula(policy: Policy, _vehicleConfiguration
|
|
|
70
70
|
* @example
|
|
71
71
|
* // For a vehicle with 2 axle units
|
|
72
72
|
* const results = CheckNumTiresPerAxle(policy, ['TRKTRAC'], [
|
|
73
|
-
* { numberOfAxles: 2, numberOfTires: 4 }, //
|
|
74
|
-
* { numberOfAxles: 3, numberOfTires: 12 } //
|
|
73
|
+
* { numberOfAxles: 2, numberOfTires: 4 }, // tandem steer: 4 (valid)
|
|
74
|
+
* { numberOfAxles: 3, numberOfTires: 12 } // tridem drive: 12 (valid)
|
|
75
75
|
* ]);
|
|
76
76
|
* // Returns pass results for both axle units
|
|
77
77
|
*
|
|
78
78
|
* @example
|
|
79
79
|
* // Invalid tire count example
|
|
80
80
|
* const results = CheckNumTiresPerAxle(policy, ['TRKTRAC'], [
|
|
81
|
-
* { numberOfAxles:
|
|
81
|
+
* { numberOfAxles: 1, numberOfTires: 8 } // single drive: 8 (invalid)
|
|
82
82
|
* ]);
|
|
83
83
|
* // Returns fail result for the axle unit
|
|
84
84
|
*
|
|
@@ -235,7 +235,7 @@ export declare function CheckMinDriveAxleWeight(_policy: Policy, _vehicleConfigu
|
|
|
235
235
|
* @see AxleGroupPolicyCheckResult
|
|
236
236
|
* @see AxleConfiguration
|
|
237
237
|
*/
|
|
238
|
-
export declare function CheckMaxTireLoad(_policy: Policy, _vehicleConfiguration:
|
|
238
|
+
export declare function CheckMaxTireLoad(_policy: Policy, _vehicleConfiguration: string[], axleConfiguration: AxleConfiguration[]): PolicyCheckResult[];
|
|
239
239
|
/**
|
|
240
240
|
* Validates that each booster has no more axles than the trailer it follows.
|
|
241
241
|
*
|
|
@@ -100,9 +100,9 @@ function CheckBridgeFormula(policy, _vehicleConfiguration, axleConfiguration) {
|
|
|
100
100
|
* Validates the number of tires per axle unit against regulatory requirements.
|
|
101
101
|
*
|
|
102
102
|
* This function checks that each axle unit has a valid number of tires based on
|
|
103
|
-
* the number of axles in that unit
|
|
104
|
-
*
|
|
105
|
-
*
|
|
103
|
+
* the number of axles in that unit and the axle unit position. Axle unit 1 is
|
|
104
|
+
* the steer axle unit, axle unit 2 is the drive axle unit, and axle units 3+
|
|
105
|
+
* use the generic axle unit allowance.
|
|
106
106
|
*
|
|
107
107
|
* @param _policy - The policy instance (unused in this check, but required by PolicyCheck type)
|
|
108
108
|
* @param _vehicleConfiguration - Vehicle configuration (unused in this check, but required by PolicyCheck type)
|
|
@@ -112,15 +112,15 @@ function CheckBridgeFormula(policy, _vehicleConfiguration, axleConfiguration) {
|
|
|
112
112
|
* @example
|
|
113
113
|
* // For a vehicle with 2 axle units
|
|
114
114
|
* const results = CheckNumTiresPerAxle(policy, ['TRKTRAC'], [
|
|
115
|
-
* { numberOfAxles: 2, numberOfTires: 4 }, //
|
|
116
|
-
* { numberOfAxles: 3, numberOfTires: 12 } //
|
|
115
|
+
* { numberOfAxles: 2, numberOfTires: 4 }, // tandem steer: 4 (valid)
|
|
116
|
+
* { numberOfAxles: 3, numberOfTires: 12 } // tridem drive: 12 (valid)
|
|
117
117
|
* ]);
|
|
118
118
|
* // Returns pass results for both axle units
|
|
119
119
|
*
|
|
120
120
|
* @example
|
|
121
121
|
* // Invalid tire count example
|
|
122
122
|
* const results = CheckNumTiresPerAxle(policy, ['TRKTRAC'], [
|
|
123
|
-
* { numberOfAxles:
|
|
123
|
+
* { numberOfAxles: 1, numberOfTires: 8 } // single drive: 8 (invalid)
|
|
124
124
|
* ]);
|
|
125
125
|
* // Returns fail result for the axle unit
|
|
126
126
|
*
|
|
@@ -143,7 +143,10 @@ function CheckNumTiresPerAxle(_policy, _vehicleConfiguration, axleConfiguration)
|
|
|
143
143
|
message = `Number of axles for axle unit ${axleNum} is not permittable.`;
|
|
144
144
|
}
|
|
145
145
|
else {
|
|
146
|
-
const
|
|
146
|
+
const multipliers = axleNum === 1 ? [2] : axleNum === 2 ? [2, 4] : [2, 4, 8];
|
|
147
|
+
const checkResult = multipliers
|
|
148
|
+
.map((multiplier) => numAxles * multiplier)
|
|
149
|
+
.includes(numTires);
|
|
147
150
|
message = checkResult
|
|
148
151
|
? `No. of Wheels for Axle Unit ${axleNum} is permittable.`
|
|
149
152
|
: `No. of Wheels for Axle Unit ${axleNum} is not permittable.`;
|
|
@@ -449,85 +452,137 @@ function CheckMinDriveAxleWeight(_policy, _vehicleConfiguration, axleConfigurati
|
|
|
449
452
|
function CheckMaxTireLoad(_policy, _vehicleConfiguration, axleConfiguration) {
|
|
450
453
|
const policyCheckResults = new Array();
|
|
451
454
|
const policyId = enum_1.PolicyCheckId.MaxTireLoad;
|
|
452
|
-
|
|
453
|
-
const
|
|
454
|
-
|
|
455
|
+
const powerUnitType = _vehicleConfiguration[0];
|
|
456
|
+
const isRubberTiredLoader = powerUnitType === 'RBTRLDR';
|
|
457
|
+
const isAllTerrainCrane = powerUnitType === 'CRANEAT';
|
|
458
|
+
const isMobileCrane = powerUnitType === 'CRANEMB';
|
|
459
|
+
const addFailResult = (axleUnit) => {
|
|
455
460
|
policyCheckResults.push({
|
|
456
461
|
id: policyId,
|
|
457
462
|
result: enum_1.PolicyCheckResultType.Fail,
|
|
458
|
-
message: `
|
|
459
|
-
axleUnit
|
|
463
|
+
message: `Tire Size for Axle Unit ${axleUnit} exceeds its load capacity.`,
|
|
464
|
+
axleUnit,
|
|
460
465
|
});
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
const
|
|
482
|
-
if (axleConfiguration[0].axleUnitWeight > maxWeightOnSteerAxle) {
|
|
483
|
-
policyCheckResults.push({
|
|
484
|
-
id: policyId,
|
|
485
|
-
result: enum_1.PolicyCheckResultType.Fail,
|
|
486
|
-
message: `Steer axle weight exceeds maximum of ${maxWeightOnSteerAxle}kg for ${steerTireSize}mm tire size`,
|
|
487
|
-
axleUnit: 1,
|
|
488
|
-
});
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
// Non-steer axle tire load checks
|
|
492
|
-
axleConfiguration.slice(1).forEach((a, i) => {
|
|
493
|
-
const tireSize = a.tireSize;
|
|
494
|
-
const numberOfTires = a.numberOfTires;
|
|
495
|
-
const axleUnitNum = i + 2;
|
|
496
|
-
let maxWeight = 0;
|
|
466
|
+
};
|
|
467
|
+
/**
|
|
468
|
+
* Both the kg/cm rate and the explicit axle cap apply for all axle types.
|
|
469
|
+
* The lower of the two is the binding limit:
|
|
470
|
+
* maxAllowedWeight = min((tireSize / 10) * rateKgPerCm * numberOfTires, capWeight)
|
|
471
|
+
*
|
|
472
|
+
* When capWeight is omitted, only the rate applies.
|
|
473
|
+
*/
|
|
474
|
+
const exceedsRateOrCapLimit = (axleWeight, tireSize, numberOfTires, rateKgPerCm, capWeight) => {
|
|
475
|
+
const rateLimitWeight = (tireSize / 10) * rateKgPerCm * numberOfTires;
|
|
476
|
+
const maxAllowedWeight = capWeight !== undefined
|
|
477
|
+
? Math.min(rateLimitWeight, capWeight)
|
|
478
|
+
: rateLimitWeight;
|
|
479
|
+
return axleWeight > maxAllowedWeight;
|
|
480
|
+
};
|
|
481
|
+
axleConfiguration.forEach((ac, index) => {
|
|
482
|
+
var _a, _b;
|
|
483
|
+
const axleUnit = index + 1;
|
|
484
|
+
const tireSize = ac.tireSize;
|
|
485
|
+
const numberOfTires = (_a = ac.numberOfTires) !== null && _a !== void 0 ? _a : 0;
|
|
486
|
+
const axleWeight = (_b = ac.axleUnitWeight) !== null && _b !== void 0 ? _b : 0;
|
|
497
487
|
if (!tireSize) {
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
result: enum_1.PolicyCheckResultType.Fail,
|
|
501
|
-
message: `Axle unit ${axleUnitNum} tire size is invalid`,
|
|
502
|
-
axleUnit: axleUnitNum,
|
|
503
|
-
});
|
|
488
|
+
addFailResult(axleUnit);
|
|
489
|
+
return;
|
|
504
490
|
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
result: enum_1.PolicyCheckResultType.Fail,
|
|
509
|
-
message: `Axle unit ${axleUnitNum} number of wheels is invalid`,
|
|
510
|
-
axleUnit: axleUnitNum,
|
|
511
|
-
});
|
|
491
|
+
if (!numberOfTires) {
|
|
492
|
+
addFailResult(axleUnit);
|
|
493
|
+
return;
|
|
512
494
|
}
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
495
|
+
const isSteeringAxle = index === 0;
|
|
496
|
+
/**
|
|
497
|
+
* Rubber Tired Loader
|
|
498
|
+
*
|
|
499
|
+
* All axle units — rate 110 kg/cm; lower of rate or cap is binding:
|
|
500
|
+
* >=600 mm => min(110 kg/cm rate, 12,000 kg/axle)
|
|
501
|
+
* >=520 mm => min(110 kg/cm rate, 11,000 kg/axle)
|
|
502
|
+
*
|
|
503
|
+
* For RTL the 110 kg/cm rate always yields more than the cap at these
|
|
504
|
+
* tire sizes (e.g. 520mm * 110 * 2 = 11,440 > 11,000), so the cap
|
|
505
|
+
* will always be the binding constraint in practice.
|
|
506
|
+
*/
|
|
507
|
+
if (isRubberTiredLoader) {
|
|
508
|
+
if (tireSize >= 600) {
|
|
509
|
+
if (exceedsRateOrCapLimit(axleWeight, tireSize, numberOfTires, 110, 12000)) {
|
|
510
|
+
addFailResult(axleUnit);
|
|
511
|
+
}
|
|
516
512
|
}
|
|
517
|
-
else if (tireSize
|
|
518
|
-
|
|
513
|
+
else if (tireSize >= 520) {
|
|
514
|
+
if (exceedsRateOrCapLimit(axleWeight, tireSize, numberOfTires, 110, 11000)) {
|
|
515
|
+
addFailResult(axleUnit);
|
|
516
|
+
}
|
|
519
517
|
}
|
|
520
|
-
|
|
521
|
-
|
|
518
|
+
return;
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* Crane - All Terrain
|
|
522
|
+
*
|
|
523
|
+
* All axle units — rate 100 kg/cm; lower of rate or cap is binding:
|
|
524
|
+
* >=520 mm => min(100 kg/cm rate, 11,000 kg/axle)
|
|
525
|
+
*
|
|
526
|
+
* For tires where the rate yields less than the cap
|
|
527
|
+
* (e.g. 520mm * 100 * 2 = 10,400 < 11,000), the rate is binding.
|
|
528
|
+
* For tires where the rate yields more than the cap
|
|
529
|
+
* (e.g. 609mm * 100 * 2 = 12,180 > 11,000), the cap is binding.
|
|
530
|
+
*/
|
|
531
|
+
if (isAllTerrainCrane) {
|
|
532
|
+
if (tireSize >= 520) {
|
|
533
|
+
if (exceedsRateOrCapLimit(axleWeight, tireSize, numberOfTires, 100, 11000)) {
|
|
534
|
+
addFailResult(axleUnit);
|
|
535
|
+
}
|
|
522
536
|
}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* Mobile Crane
|
|
541
|
+
*
|
|
542
|
+
* Non-steering axle units only — rate 100 kg/cm; lower of rate or cap is binding:
|
|
543
|
+
* >=520 mm => min(100 kg/cm rate, 11,000 kg/axle)
|
|
544
|
+
*
|
|
545
|
+
* Same rate/cap interaction as Crane - All Terrain above.
|
|
546
|
+
* Steering axle falls through to the standard steer axle rules below.
|
|
547
|
+
*/
|
|
548
|
+
if (isMobileCrane && !isSteeringAxle) {
|
|
549
|
+
if (tireSize >= 520) {
|
|
550
|
+
if (exceedsRateOrCapLimit(axleWeight, tireSize, numberOfTires, 100, 11000)) {
|
|
551
|
+
addFailResult(axleUnit);
|
|
552
|
+
}
|
|
530
553
|
}
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Steer axle — all vehicles except Crane - All Terrain, Mobile Crane
|
|
558
|
+
* (steering), Rubber Tired Loader
|
|
559
|
+
*
|
|
560
|
+
* Rate 100 kg/cm; lower of rate or cap is binding:
|
|
561
|
+
* <445 mm => rate only (no cap)
|
|
562
|
+
* >=445 mm => min(100 kg/cm rate, 9,100 kg/axle)
|
|
563
|
+
*
|
|
564
|
+
* e.g. 445mm * 2 tires => min(8,900, 9,100) = 8,900 kg <- rate binding
|
|
565
|
+
* e.g. 457mm * 2 tires => min(9,140, 9,100) = 9,100 kg <- cap binding
|
|
566
|
+
*/
|
|
567
|
+
if (isSteeringAxle) {
|
|
568
|
+
const capWeight = tireSize >= 445 ? 9100 : undefined;
|
|
569
|
+
if (exceedsRateOrCapLimit(axleWeight, tireSize, numberOfTires, 100, capWeight)) {
|
|
570
|
+
addFailResult(axleUnit);
|
|
571
|
+
}
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Standard non-steering axle — all vehicles except Crane - All Terrain,
|
|
576
|
+
* Mobile Crane (non-steering), Rubber Tired Loader
|
|
577
|
+
*
|
|
578
|
+
* Rate 100 kg/cm; lower of rate or per-tire cap is binding:
|
|
579
|
+
* >=445 mm => min(100 kg/cm rate, 4,550 kg/tire * numberOfTires)
|
|
580
|
+
* <=444 mm => min(100 kg/cm rate, 3,000 kg/tire * numberOfTires)
|
|
581
|
+
*/
|
|
582
|
+
const perTireCap = tireSize >= 445 ? 4550 : 3000;
|
|
583
|
+
const axleCap = perTireCap * numberOfTires;
|
|
584
|
+
if (exceedsRateOrCapLimit(axleWeight, tireSize, numberOfTires, 100, axleCap)) {
|
|
585
|
+
addFailResult(axleUnit);
|
|
531
586
|
}
|
|
532
587
|
});
|
|
533
588
|
if (policyCheckResults.length === 0) {
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "v2.
|
|
1
|
+
export declare const version = "v2.14.0";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED