onroute-policy-engine 2.11.1 → 2.12.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.
@@ -6,6 +6,7 @@ export declare enum PolicyCheckId {
6
6
  BoosterAxleLimit = "booster-axle-limit",
7
7
  BridgeFormula = "bridge-formula",
8
8
  CheckPermittableWeight = "check-permittable-weight",
9
+ DriveJeepLoadEqualization = "drive-jeep-load-equalization",
9
10
  MaxTireLoad = "max-tire-load",
10
11
  MinDriveAxleWeight = "minimum-drive-axle-weight",
11
12
  MinSteerAxleWeight = "minimum-steer-axle-weight",
@@ -11,6 +11,7 @@ var PolicyCheckId;
11
11
  PolicyCheckId["BoosterAxleLimit"] = "booster-axle-limit";
12
12
  PolicyCheckId["BridgeFormula"] = "bridge-formula";
13
13
  PolicyCheckId["CheckPermittableWeight"] = "check-permittable-weight";
14
+ PolicyCheckId["DriveJeepLoadEqualization"] = "drive-jeep-load-equalization";
14
15
  PolicyCheckId["MaxTireLoad"] = "max-tire-load";
15
16
  PolicyCheckId["MinDriveAxleWeight"] = "minimum-drive-axle-weight";
16
17
  PolicyCheckId["MinSteerAxleWeight"] = "minimum-steer-axle-weight";
@@ -256,6 +256,20 @@ export declare function CheckBoosterAxleLimit(_policy: Policy, vehicleConfigurat
256
256
  * of axle unit 2 spread. Axle dimensions are stored in centimetres.
257
257
  */
258
258
  export declare function CheckTruckTractorWheelbase(policy: Policy, vehicleConfiguration: Array<string>, axleConfiguration: Array<AxleConfiguration>): Array<PolicyCheckResult>;
259
+ /**
260
+ * Validates that the drive axle unit and first jeep axle unit are load equalized
261
+ * within 1000 kg when they have the same number of axles.
262
+ *
263
+ * Vehicle configuration has one power unit entry, while axle configuration has
264
+ * separate steer and drive entries for the power unit. For vehicle entries after
265
+ * the power unit, the matching axle unit index is therefore vehicle index + 1.
266
+ *
267
+ * @param _policy - The policy instance (unused in this check, but required by PolicyCheck type)
268
+ * @param vehicleConfiguration - Array of vehicle type identifiers representing the vehicle configuration
269
+ * @param axleConfiguration - Array of axle configurations containing axle count and weight information
270
+ * @returns Array of AxleGroupPolicyCheckResult objects for the applicable drive/jeep pair
271
+ */
272
+ export declare function CheckDriveJeepLoadEqualization(_policy: Policy, vehicleConfiguration: Array<string>, axleConfiguration: Array<AxleConfiguration>): Array<PolicyCheckResult>;
259
273
  /**
260
274
  * Map of policy check functions keyed by their corresponding PolicyCheckId.
261
275
  *
@@ -274,6 +288,7 @@ export declare function CheckTruckTractorWheelbase(policy: Policy, vehicleConfig
274
288
  * - NumberOfWheelsPerAxle: Validates tire count per axle unit
275
289
  * - BoosterAxleLimit: Validates booster axle count against the preceding trailer
276
290
  * - TruckTractorWheelbase: Validates derived wheelbase for single steer, tandem drive truck tractors
291
+ * - DriveJeepLoadEqualization: Validates drive and jeep axle unit load equalization
277
292
  *
278
293
  * @see PolicyCheck
279
294
  * @see PolicyCheckId
@@ -10,6 +10,7 @@ exports.CheckMinDriveAxleWeight = CheckMinDriveAxleWeight;
10
10
  exports.CheckMaxTireLoad = CheckMaxTireLoad;
11
11
  exports.CheckBoosterAxleLimit = CheckBoosterAxleLimit;
12
12
  exports.CheckTruckTractorWheelbase = CheckTruckTractorWheelbase;
13
+ exports.CheckDriveJeepLoadEqualization = CheckDriveJeepLoadEqualization;
13
14
  const dimensions_helper_1 = require("./dimensions.helper");
14
15
  const enum_1 = require("../enum");
15
16
  /**
@@ -646,6 +647,53 @@ function CheckTruckTractorWheelbase(policy, vehicleConfiguration, axleConfigurat
646
647
  Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Pass, message: '' }),
647
648
  ];
648
649
  }
650
+ /**
651
+ * Validates that the drive axle unit and first jeep axle unit are load equalized
652
+ * within 1000 kg when they have the same number of axles.
653
+ *
654
+ * Vehicle configuration has one power unit entry, while axle configuration has
655
+ * separate steer and drive entries for the power unit. For vehicle entries after
656
+ * the power unit, the matching axle unit index is therefore vehicle index + 1.
657
+ *
658
+ * @param _policy - The policy instance (unused in this check, but required by PolicyCheck type)
659
+ * @param vehicleConfiguration - Array of vehicle type identifiers representing the vehicle configuration
660
+ * @param axleConfiguration - Array of axle configurations containing axle count and weight information
661
+ * @returns Array of AxleGroupPolicyCheckResult objects for the applicable drive/jeep pair
662
+ */
663
+ function CheckDriveJeepLoadEqualization(_policy, vehicleConfiguration, axleConfiguration) {
664
+ const policyCheckResults = new Array();
665
+ const policyId = enum_1.PolicyCheckId.DriveJeepLoadEqualization;
666
+ const maxWeightDifferenceKg = 1000;
667
+ const driveAxleConfigIndex = 1;
668
+ const jeepVehicleIndex = vehicleConfiguration.findIndex((vehicleSubType) => vehicleSubType === enum_1.AccessoryVehicleType.Jeep);
669
+ if (jeepVehicleIndex < 1) {
670
+ return policyCheckResults;
671
+ }
672
+ const jeepAxleConfigIndex = jeepVehicleIndex + 1;
673
+ const driveAxle = axleConfiguration[driveAxleConfigIndex];
674
+ const jeepAxle = axleConfiguration[jeepAxleConfigIndex];
675
+ if (!driveAxle ||
676
+ !jeepAxle ||
677
+ driveAxle.numberOfAxles !== jeepAxle.numberOfAxles ||
678
+ !Number.isFinite(driveAxle.axleUnitWeight) ||
679
+ !Number.isFinite(jeepAxle.axleUnitWeight)) {
680
+ return policyCheckResults;
681
+ }
682
+ const driveAxleUnit = driveAxleConfigIndex + 1;
683
+ const jeepAxleUnit = jeepAxleConfigIndex + 1;
684
+ const result = Math.abs(driveAxle.axleUnitWeight - jeepAxle.axleUnitWeight) <=
685
+ maxWeightDifferenceKg;
686
+ policyCheckResults.push({
687
+ id: policyId,
688
+ result: result ? enum_1.PolicyCheckResultType.Pass : enum_1.PolicyCheckResultType.Fail,
689
+ message: result
690
+ ? ''
691
+ : `Axle Unit ${driveAxleUnit} and Axle Unit ${jeepAxleUnit} must be load equalized within ${maxWeightDifferenceKg} kg.`,
692
+ startAxleUnit: driveAxleUnit,
693
+ endAxleUnit: jeepAxleUnit,
694
+ });
695
+ return policyCheckResults;
696
+ }
649
697
  /**
650
698
  * Map of policy check functions keyed by their corresponding PolicyCheckId.
651
699
  *
@@ -664,6 +712,7 @@ function CheckTruckTractorWheelbase(policy, vehicleConfiguration, axleConfigurat
664
712
  * - NumberOfWheelsPerAxle: Validates tire count per axle unit
665
713
  * - BoosterAxleLimit: Validates booster axle count against the preceding trailer
666
714
  * - TruckTractorWheelbase: Validates derived wheelbase for single steer, tandem drive truck tractors
715
+ * - DriveJeepLoadEqualization: Validates drive and jeep axle unit load equalization
667
716
  *
668
717
  * @see PolicyCheck
669
718
  * @see PolicyCheckId
@@ -679,4 +728,5 @@ exports.policyCheckMap = new Map([
679
728
  [enum_1.PolicyCheckId.NumberOfWheelsPerAxle, CheckNumTiresPerAxle],
680
729
  [enum_1.PolicyCheckId.BoosterAxleLimit, CheckBoosterAxleLimit],
681
730
  [enum_1.PolicyCheckId.TruckTractorWheelbase, CheckTruckTractorWheelbase],
731
+ [enum_1.PolicyCheckId.DriveJeepLoadEqualization, CheckDriveJeepLoadEqualization],
682
732
  ]);
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "v2.11.1";
1
+ export declare const version = "v2.12.0";
package/dist/version.js CHANGED
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
4
  // Generated by genversion.
5
- exports.version = 'v2.11.1';
5
+ exports.version = 'v2.12.0';
package/package.json CHANGED
@@ -91,5 +91,5 @@
91
91
  ],
92
92
  "testEnvironment": "node"
93
93
  },
94
- "version": "v2.11.1"
94
+ "version": "v2.12.0"
95
95
  }