@jetta/cargo-stabilizer 0.1.0-15 → 0.1.0-5

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.
Files changed (172) hide show
  1. package/CHANGELOG.md +2 -16
  2. package/README.md +12 -18
  3. package/build/core/adapters/axle_adapter.d.ts +0 -1
  4. package/build/core/adapters/axle_adapter.d.ts.map +1 -1
  5. package/build/core/adapters/axle_adapter.js +22 -3
  6. package/build/core/adapters/coordinate_mapper.d.ts +1 -1
  7. package/build/core/adapters/coordinate_mapper.js +3 -3
  8. package/build/core/candidates/candidate_generator.d.ts +1 -1
  9. package/build/core/candidates/candidate_generator.js +7 -21
  10. package/build/core/candidates/candidate_validation.d.ts.map +1 -1
  11. package/build/core/candidates/candidate_validation.js +0 -8
  12. package/build/core/evaluation/state_evaluator.d.ts +10 -2
  13. package/build/core/evaluation/state_evaluator.d.ts.map +1 -1
  14. package/build/core/evaluation/state_evaluator.js +26 -7
  15. package/build/core/factory/read_stabilizer_config.d.ts +2 -3
  16. package/build/core/factory/read_stabilizer_config.d.ts.map +1 -1
  17. package/build/core/factory/read_stabilizer_config_helpers.d.ts +5 -9
  18. package/build/core/factory/read_stabilizer_config_helpers.d.ts.map +1 -1
  19. package/build/core/factory/read_stabilizer_config_helpers.js +1 -12
  20. package/build/core/move/apply_move.d.ts +0 -2
  21. package/build/core/move/apply_move.d.ts.map +1 -1
  22. package/build/core/orchestration/StabilizerFlow.d.ts.map +1 -1
  23. package/build/core/orchestration/StabilizerFlow.js +1 -1
  24. package/build/core/orchestration/build_reorder_context.d.ts.map +1 -1
  25. package/build/core/orchestration/build_reorder_context.js +5 -3
  26. package/build/core/strategies/reorder/BeamSearchReorder.d.ts.map +1 -1
  27. package/build/core/strategies/reorder/BeamSearchReorder.js +13 -12
  28. package/build/core/strategies/reorder/GeneticReorder.d.ts.map +1 -1
  29. package/build/core/strategies/reorder/GeneticReorder.js +1 -2
  30. package/build/core/strategies/reorder/SimulatedAnnealingReorder.d.ts.map +1 -1
  31. package/build/core/strategies/reorder/SimulatedAnnealingReorder.js +5 -14
  32. package/build/core/strategies/reorder/beam_context.d.ts +0 -1
  33. package/build/core/strategies/reorder/beam_context.d.ts.map +1 -1
  34. package/build/core/strategies/reorder/greedy_improvement.d.ts.map +1 -1
  35. package/build/core/strategies/reorder/greedy_improvement.js +2 -3
  36. package/build/core/validation/contract/cargo_movement_wire_field_map.d.ts +1 -51
  37. package/build/core/validation/contract/cargo_movement_wire_field_map.d.ts.map +1 -1
  38. package/build/core/validation/contract/cargo_movement_wire_field_map.js +3 -53
  39. package/build/core/validation/contract/cargo_movement_wire_mapper.d.ts.map +1 -1
  40. package/build/core/validation/contract/cargo_movement_wire_mapper.js +1 -10
  41. package/build/core/validation/contract/map_contract_to_wire_shape.d.ts.map +1 -1
  42. package/build/core/validation/contract/map_contract_to_wire_shape.js +13 -18
  43. package/build/core/validation/contract/map_wire_input_to_contract_shape.d.ts.map +1 -1
  44. package/build/core/validation/contract/map_wire_input_to_contract_shape.js +22 -26
  45. package/build/core/validation/contract/parse_stabilizer_input.d.ts +4 -49
  46. package/build/core/validation/contract/parse_stabilizer_input.d.ts.map +1 -1
  47. package/build/core/validation/contract/parse_stabilizer_input.js +0 -2
  48. package/build/core/validation/contract/parse_stabilizer_output.d.ts +2 -34
  49. package/build/core/validation/contract/parse_stabilizer_output.d.ts.map +1 -1
  50. package/build/core/validation/contract/stabilizer_domain_schema.d.ts +56 -36
  51. package/build/core/validation/contract/stabilizer_domain_schema.d.ts.map +1 -1
  52. package/build/core/validation/contract/stabilizer_domain_schema.js +35 -16
  53. package/build/core/validation/contract/stabilizer_input_schema.d.ts +4 -51
  54. package/build/core/validation/contract/stabilizer_input_schema.d.ts.map +1 -1
  55. package/build/core/validation/contract/stabilizer_input_schema.js +2 -2
  56. package/build/core/validation/contract/stabilizer_output_schema.d.ts +4 -68
  57. package/build/core/validation/contract/stabilizer_output_schema.d.ts.map +1 -1
  58. package/build/core/validation/contract/wire_mapper_record_utils.d.ts +0 -14
  59. package/build/core/validation/contract/wire_mapper_record_utils.d.ts.map +1 -1
  60. package/build/core/validation/contract/wire_mapper_record_utils.js +0 -30
  61. package/build/core/validation/schemas/stabilizer_config_schema.d.ts +1 -2
  62. package/build/core/validation/schemas/stabilizer_config_schema.d.ts.map +1 -1
  63. package/build/core/validation/schemas/stabilizer_config_schema.js +1 -2
  64. package/build/index.d.ts +12 -11
  65. package/build/index.d.ts.map +1 -1
  66. package/build/index.js +21 -29
  67. package/package.json +10 -12
  68. package/build/core/adapters/axle_load_evaluation.d.ts +0 -8
  69. package/build/core/adapters/axle_load_evaluation.d.ts.map +0 -1
  70. package/build/core/adapters/axle_load_evaluation.js +0 -1
  71. package/build/core/adapters/build_axle_request.d.ts +0 -8
  72. package/build/core/adapters/build_axle_request.d.ts.map +0 -1
  73. package/build/core/adapters/build_axle_request.js +0 -67
  74. package/build/core/adapters/compute_axle_excess_kg.d.ts +0 -8
  75. package/build/core/adapters/compute_axle_excess_kg.d.ts.map +0 -1
  76. package/build/core/adapters/compute_axle_excess_kg.js +0 -19
  77. package/build/core/adapters/evaluate_axle_load.d.ts +0 -10
  78. package/build/core/adapters/evaluate_axle_load.d.ts.map +0 -1
  79. package/build/core/adapters/evaluate_axle_load.js +0 -32
  80. package/build/core/adapters/map_item_to_stacking_item.d.ts +0 -14
  81. package/build/core/adapters/map_item_to_stacking_item.d.ts.map +0 -1
  82. package/build/core/adapters/map_item_to_stacking_item.js +0 -40
  83. package/build/core/adapters/run_axle_calculator.d.ts +0 -16
  84. package/build/core/adapters/run_axle_calculator.d.ts.map +0 -1
  85. package/build/core/adapters/run_axle_calculator.js +0 -37
  86. package/build/core/candidates/collect_container_slots.d.ts +0 -16
  87. package/build/core/candidates/collect_container_slots.d.ts.map +0 -1
  88. package/build/core/candidates/collect_container_slots.js +0 -20
  89. package/build/core/candidates/enumerate_supporter_top_slots.d.ts +0 -11
  90. package/build/core/candidates/enumerate_supporter_top_slots.d.ts.map +0 -1
  91. package/build/core/candidates/enumerate_supporter_top_slots.js +0 -36
  92. package/build/core/candidates/is_candidate_stacking_valid.d.ts +0 -14
  93. package/build/core/candidates/is_candidate_stacking_valid.d.ts.map +0 -1
  94. package/build/core/candidates/is_candidate_stacking_valid.js +0 -43
  95. package/build/core/candidates/is_elevated_on_supporter_origin.d.ts +0 -14
  96. package/build/core/candidates/is_elevated_on_supporter_origin.d.ts.map +0 -1
  97. package/build/core/candidates/is_elevated_on_supporter_origin.js +0 -28
  98. package/build/core/constants/TieRatioOrientation.d.ts +0 -6
  99. package/build/core/constants/TieRatioOrientation.d.ts.map +0 -1
  100. package/build/core/constants/TieRatioOrientation.js +0 -5
  101. package/build/core/evaluation/compare_search_states.d.ts +0 -12
  102. package/build/core/evaluation/compare_search_states.d.ts.map +0 -1
  103. package/build/core/evaluation/compare_search_states.js +0 -12
  104. package/build/core/evaluation/compute_reorder_objective.d.ts +0 -13
  105. package/build/core/evaluation/compute_reorder_objective.d.ts.map +0 -1
  106. package/build/core/evaluation/compute_reorder_objective.js +0 -13
  107. package/build/core/evaluation/evaluate_search_gates.d.ts +0 -18
  108. package/build/core/evaluation/evaluate_search_gates.d.ts.map +0 -1
  109. package/build/core/evaluation/evaluate_search_gates.js +0 -30
  110. package/build/core/evaluation/evaluation_result.d.ts +0 -15
  111. package/build/core/evaluation/evaluation_result.d.ts.map +0 -1
  112. package/build/core/evaluation/evaluation_result.js +0 -1
  113. package/build/core/evaluation/genetic_fitness.d.ts +0 -9
  114. package/build/core/evaluation/genetic_fitness.d.ts.map +0 -1
  115. package/build/core/evaluation/genetic_fitness.js +0 -16
  116. package/build/core/evaluation/is_non_axle_gates_pass.d.ts +0 -8
  117. package/build/core/evaluation/is_non_axle_gates_pass.d.ts.map +0 -1
  118. package/build/core/evaluation/is_non_axle_gates_pass.js +0 -8
  119. package/build/core/evaluation/is_search_trial_admissible.d.ts +0 -10
  120. package/build/core/evaluation/is_search_trial_admissible.d.ts.map +0 -1
  121. package/build/core/evaluation/is_search_trial_admissible.js +0 -17
  122. package/build/core/evaluation/is_waypoint_order_valid.d.ts +0 -10
  123. package/build/core/evaluation/is_waypoint_order_valid.d.ts.map +0 -1
  124. package/build/core/evaluation/is_waypoint_order_valid.js +0 -14
  125. package/build/core/exceptions/AxleCalculationError.d.ts +0 -4
  126. package/build/core/exceptions/AxleCalculationError.d.ts.map +0 -1
  127. package/build/core/exceptions/AxleCalculationError.js +0 -6
  128. package/build/core/filters/collect_movable_items.d.ts +0 -18
  129. package/build/core/filters/collect_movable_items.d.ts.map +0 -1
  130. package/build/core/filters/collect_movable_items.js +0 -53
  131. package/build/core/filters/collect_pinned_floor_tie_ratio_group_ids.d.ts +0 -8
  132. package/build/core/filters/collect_pinned_floor_tie_ratio_group_ids.d.ts.map +0 -1
  133. package/build/core/filters/collect_pinned_floor_tie_ratio_group_ids.js +0 -41
  134. package/build/core/filters/is_item_on_cm_floor.d.ts +0 -8
  135. package/build/core/filters/is_item_on_cm_floor.d.ts.map +0 -1
  136. package/build/core/filters/is_item_on_cm_floor.js +0 -9
  137. package/build/core/geometry/has_penetrating_overlap.d.ts +0 -9
  138. package/build/core/geometry/has_penetrating_overlap.d.ts.map +0 -1
  139. package/build/core/geometry/has_penetrating_overlap.js +0 -27
  140. package/build/core/strategies/reorder/append_admitted_trial.d.ts +0 -11
  141. package/build/core/strategies/reorder/append_admitted_trial.d.ts.map +0 -1
  142. package/build/core/strategies/reorder/append_admitted_trial.js +0 -22
  143. package/build/core/strategies/reorder/is_improving_greedy_trial.d.ts +0 -10
  144. package/build/core/strategies/reorder/is_improving_greedy_trial.d.ts.map +0 -1
  145. package/build/core/strategies/reorder/is_improving_greedy_trial.js +0 -17
  146. package/build/core/strategies/reorder/select_beam_expansion_candidates.d.ts +0 -9
  147. package/build/core/strategies/reorder/select_beam_expansion_candidates.d.ts.map +0 -1
  148. package/build/core/strategies/reorder/select_beam_expansion_candidates.js +0 -28
  149. package/build/core/strategies/reorder/select_surviving_beam.d.ts +0 -11
  150. package/build/core/strategies/reorder/select_surviving_beam.d.ts.map +0 -1
  151. package/build/core/strategies/reorder/select_surviving_beam.js +0 -13
  152. package/build/core/validation/contract/map_input_config.d.ts +0 -9
  153. package/build/core/validation/contract/map_input_config.d.ts.map +0 -1
  154. package/build/core/validation/contract/map_input_config.js +0 -40
  155. package/build/core/validation/contract/map_wire_item_stacking.d.ts +0 -7
  156. package/build/core/validation/contract/map_wire_item_stacking.d.ts.map +0 -1
  157. package/build/core/validation/contract/map_wire_item_stacking.js +0 -40
  158. package/build/core/validation/contract/map_wire_item_to_contract.d.ts +0 -8
  159. package/build/core/validation/contract/map_wire_item_to_contract.d.ts.map +0 -1
  160. package/build/core/validation/contract/map_wire_item_to_contract.js +0 -51
  161. package/build/core/validation/contract/reject_forbidden_input_fields.d.ts +0 -6
  162. package/build/core/validation/contract/reject_forbidden_input_fields.d.ts.map +0 -1
  163. package/build/core/validation/contract/reject_forbidden_input_fields.js +0 -53
  164. package/build/core/validation/contract/stabilizer_env_schema.d.ts +0 -112
  165. package/build/core/validation/contract/stabilizer_env_schema.d.ts.map +0 -1
  166. package/build/core/validation/contract/stabilizer_env_schema.js +0 -38
  167. package/build/core/validation/contract/stabilizer_item_schema.d.ts +0 -25
  168. package/build/core/validation/contract/stabilizer_item_schema.d.ts.map +0 -1
  169. package/build/core/validation/contract/stabilizer_item_schema.js +0 -23
  170. package/build/core/validation/contract/uniquify_contract_item_ids.d.ts +0 -14
  171. package/build/core/validation/contract/uniquify_contract_item_ids.d.ts.map +0 -1
  172. package/build/core/validation/contract/uniquify_contract_item_ids.js +0 -54
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- import type { StabilizerEnv } from '../validation/contract/stabilizer_domain_schema.js';
2
- /**
3
- * Builds the axle-load-calculator request from typed stabilizer env fields.
4
- * @param env - Stabilizer env with containers, vehicle, and axles.
5
- * @returns Calculator request payload.
6
- */
7
- export declare function build_axle_request(env: StabilizerEnv): Record<string, unknown>;
8
- //# sourceMappingURL=build_axle_request.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build_axle_request.d.ts","sourceRoot":"","sources":["../../../src/core/adapters/build_axle_request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAER,aAAa,EAGhB,MAAM,oDAAoD,CAAA;AAE3D;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAkB9E"}
@@ -1,67 +0,0 @@
1
- /**
2
- * Builds the axle-load-calculator request from typed stabilizer env fields.
3
- * @param env - Stabilizer env with containers, vehicle, and axles.
4
- * @returns Calculator request payload.
5
- */
6
- export function build_axle_request(env) {
7
- const wire_env = {
8
- ...map_vehicle_to_wire(env.vehicle),
9
- containers: env.containers.map(map_container_to_axle_wire)
10
- };
11
- if (env.axles !== undefined) {
12
- wire_env.eixos = env.axles.map(axle => ({
13
- distanciaOrigem: axle.distance_from_origin,
14
- pesoMaxSuportado: axle.max_supported_weight,
15
- pesoDnit: axle.dnit_weight,
16
- tara: axle.tare,
17
- sequenciaContainer: axle.container_sequence,
18
- sequence: axle.sequence
19
- }));
20
- }
21
- return { envs: [wire_env] };
22
- }
23
- function map_vehicle_to_wire(vehicle) {
24
- if (vehicle === undefined) {
25
- return {};
26
- }
27
- return {
28
- _id: vehicle.vehicle_id,
29
- tipoVeiculo: vehicle.vehicle_type,
30
- tipoVersao: vehicle.version_type,
31
- tipoSuspensao: vehicle.suspension_type,
32
- primeiroEixo: vehicle.first_axle,
33
- tara: vehicle.tare,
34
- pesoMaxSuportado: vehicle.max_supported_weight,
35
- qtd: vehicle.quantity
36
- };
37
- }
38
- function map_container_to_axle_wire(container) {
39
- return {
40
- sequencia: container.sequence,
41
- largura: container.width,
42
- altura: container.height,
43
- comprimento: container.length,
44
- distPinoRei: container.kingpin_distance,
45
- containerDistanceAhead: container.container_distance_ahead,
46
- pesoMaxSuportado: container.max_supported_weight,
47
- tara: container.tare,
48
- pesoDeCarga: container.cargo_weight,
49
- grouper: container.grouper,
50
- items: container.items.map(map_item_to_axle_wire)
51
- };
52
- }
53
- function map_item_to_axle_wire(item) {
54
- return {
55
- _id: item.item_id,
56
- x: item.x,
57
- y: item.z,
58
- z: item.y,
59
- w: item.width,
60
- h: item.height,
61
- d: item.depth,
62
- peso: item.weight ?? 0,
63
- largura: item.width,
64
- altura: item.height,
65
- comprimento: item.depth
66
- };
67
- }
@@ -1,8 +0,0 @@
1
- /**
2
- * Sums kilograms over the folga limit across container axle rows.
3
- * @param axles - Calculator pesoEixos rows.
4
- * @param folga_pct - Axle load margin percent.
5
- * @returns Total excess kilograms; zero when all axles are within limits.
6
- */
7
- export declare function compute_axle_excess_kg(axles: Record<string, unknown>[], folga_pct: number): number;
8
- //# sourceMappingURL=compute_axle_excess_kg.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compute_axle_excess_kg.d.ts","sourceRoot":"","sources":["../../../src/core/adapters/compute_axle_excess_kg.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAClC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAChC,SAAS,EAAE,MAAM,GAClB,MAAM,CAQR"}
@@ -1,19 +0,0 @@
1
- /**
2
- * Sums kilograms over the folga limit across container axle rows.
3
- * @param axles - Calculator pesoEixos rows.
4
- * @param folga_pct - Axle load margin percent.
5
- * @returns Total excess kilograms; zero when all axles are within limits.
6
- */
7
- export function compute_axle_excess_kg(axles, folga_pct) {
8
- let excess_kg = 0;
9
- for (const axle of axles) {
10
- excess_kg += axle_row_excess_kg(axle, folga_pct);
11
- }
12
- return excess_kg;
13
- }
14
- function axle_row_excess_kg(axle, folga_pct) {
15
- const final_kg = Number(axle.pesoCarregadoFinal ?? 0);
16
- const max_kg = Number(axle.pesoMaxFinal ?? 0);
17
- const limit_kg = max_kg * (1 + folga_pct / 100);
18
- return Math.max(0, final_kg - limit_kg);
19
- }
@@ -1,10 +0,0 @@
1
- import type { StabilizerEnv } from '../validation/contract/stabilizer_domain_schema.js';
2
- import type { AxleLoadEvaluation } from './axle_load_evaluation.js';
3
- /**
4
- * Evaluates axle legality and excess kilograms in one calculator pass.
5
- * @param env - Stabilizer env with containers and axles.
6
- * @param folga_pct - Axle load margin percent.
7
- * @returns Validity and excess over the folga-adjusted max.
8
- */
9
- export declare function evaluate_axle_load(env: StabilizerEnv, folga_pct: number): AxleLoadEvaluation;
10
- //# sourceMappingURL=evaluate_axle_load.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"evaluate_axle_load.d.ts","sourceRoot":"","sources":["../../../src/core/adapters/evaluate_axle_load.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oDAAoD,CAAA;AACvF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAEnE;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,GAAG,kBAAkB,CAc5F"}
@@ -1,32 +0,0 @@
1
- import { run_axle_calculator } from './run_axle_calculator.js';
2
- import { compute_axle_excess_kg } from './compute_axle_excess_kg.js';
3
- /**
4
- * Evaluates axle legality and excess kilograms in one calculator pass.
5
- * @param env - Stabilizer env with containers and axles.
6
- * @param folga_pct - Axle load margin percent.
7
- * @returns Validity and excess over the folga-adjusted max.
8
- */
9
- export function evaluate_axle_load(env, folga_pct) {
10
- if (!env.axles || env.axles.length === 0) {
11
- return { valid: true, excess_kg: 0 };
12
- }
13
- const result = run_axle_calculator(env);
14
- if (!result.calculated) {
15
- return { valid: false, excess_kg: Number.POSITIVE_INFINITY };
16
- }
17
- return evaluation_from_calculated_env(result.env, folga_pct);
18
- }
19
- function evaluation_from_calculated_env(calculated_env, folga_pct) {
20
- const containers = (calculated_env.containers ?? []);
21
- const axles = collect_container_axle_rows(containers);
22
- const excess_kg = compute_axle_excess_kg(axles, folga_pct);
23
- return { valid: excess_kg === 0, excess_kg };
24
- }
25
- function collect_container_axle_rows(containers) {
26
- const rows = [];
27
- for (const container of containers) {
28
- const axles = (container.pesoEixos ?? []);
29
- rows.push(...axles);
30
- }
31
- return rows;
32
- }
@@ -1,14 +0,0 @@
1
- import { type Item } from '@jetta/stacking-constraints';
2
- import type { StabilizerItem } from '../validation/contract/stabilizer_domain_schema.js';
3
- /**
4
- * Maps a stabilizer item onto a stacking-constraints Item.
5
- * @param item - Stabilizer item.
6
- * @param position - Optional pose override for a candidate slot.
7
- * @returns Stacking-constraints item.
8
- */
9
- export declare function map_item_to_stacking_item(item: StabilizerItem, position?: {
10
- x: number;
11
- y: number;
12
- z: number;
13
- }): Item;
14
- //# sourceMappingURL=map_item_to_stacking_item.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"map_item_to_stacking_item.d.ts","sourceRoot":"","sources":["../../../src/core/adapters/map_item_to_stacking_item.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,IAAI,EAAsB,MAAM,6BAA6B,CAAA;AACnG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oDAAoD,CAAA;AAKxF;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACrC,IAAI,EAAE,cAAc,EACpB,QAAQ,CAAC,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/C,IAAI,CAYN"}
@@ -1,40 +0,0 @@
1
- import { default_stacking_rules } from '@jetta/stacking-constraints';
2
- const ALLOWED_FAMILIES_CONSTRAINT = 'ALLOWED_FAMILIES';
3
- const SUPPORTED_WEIGHT_UNIT = 'supportedWeight';
4
- /**
5
- * Maps a stabilizer item onto a stacking-constraints Item.
6
- * @param item - Stabilizer item.
7
- * @param position - Optional pose override for a candidate slot.
8
- * @returns Stacking-constraints item.
9
- */
10
- export function map_item_to_stacking_item(item, position) {
11
- return {
12
- itemId: item.item_id,
13
- x: position?.x ?? item.x,
14
- y: position?.y ?? item.y,
15
- z: position?.z ?? item.z,
16
- width: item.width,
17
- height: item.height,
18
- length: item.depth,
19
- stackingRules: build_stacking_rules(item)
20
- };
21
- }
22
- function build_stacking_rules(item) {
23
- const rules = default_stacking_rules();
24
- return {
25
- ...rules,
26
- family: item.family ?? rules.family,
27
- allowedFamilies: item.supported_families ?? [...rules.allowedFamilies],
28
- enableOnlyAllowedFamilies: is_family_constraint_enabled(item),
29
- weight: item.weight !== undefined && item.weight > 0 ? item.weight : rules.weight,
30
- enableMaximumStackingWeight: item.stacking_unit === SUPPORTED_WEIGHT_UNIT,
31
- maximumStackingWeight: item.supported_weight ?? rules.maximumStackingWeight,
32
- enableStackSameItemOnly: item.stack_same_item === true,
33
- enableStackSameAreaOnly: item.stack_same_area === true,
34
- priority: item.priority ?? rules.priority,
35
- ...(item.waypoint_id !== undefined ? { waypoint_id: item.waypoint_id } : {})
36
- };
37
- }
38
- function is_family_constraint_enabled(item) {
39
- return item.constraint === ALLOWED_FAMILIES_CONSTRAINT || item.stack_families === true;
40
- }
@@ -1,16 +0,0 @@
1
- import type { StabilizerEnv } from '../validation/contract/stabilizer_domain_schema.js';
2
- export type AxleCalculatorResult = {
3
- calculated: true;
4
- env: Record<string, unknown>;
5
- } | {
6
- calculated: false;
7
- reason: string;
8
- };
9
- /**
10
- * Runs the axle-load calculator for a candidate env layout.
11
- * @param env - Stabilizer env with containers and axles.
12
- * @returns Calculated env, or the reason the layout was rejected.
13
- * @throws {AxleCalculationError} When the vehicle or item configuration cannot be calculated.
14
- */
15
- export declare function run_axle_calculator(env: StabilizerEnv): AxleCalculatorResult;
16
- //# sourceMappingURL=run_axle_calculator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run_axle_calculator.d.ts","sourceRoot":"","sources":["../../../src/core/adapters/run_axle_calculator.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oDAAoD,CAAA;AAEvF,MAAM,MAAM,oBAAoB,GAC1B;IAAE,UAAU,EAAE,IAAI,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAClD;IAAE,UAAU,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAE3C;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,oBAAoB,CAW5E"}
@@ -1,37 +0,0 @@
1
- import { calculate_weight_on_axles_physics, ItemOverlapError } from '@jetta/axle-load-calculator';
2
- import { build_axle_request } from './build_axle_request.js';
3
- import { AxleCalculationError } from '../exceptions/AxleCalculationError.js';
4
- import { stabilizer_logger } from '../logging/stabilizer_logger.js';
5
- /**
6
- * Runs the axle-load calculator for a candidate env layout.
7
- * @param env - Stabilizer env with containers and axles.
8
- * @returns Calculated env, or the reason the layout was rejected.
9
- * @throws {AxleCalculationError} When the vehicle or item configuration cannot be calculated.
10
- */
11
- export function run_axle_calculator(env) {
12
- const request = build_axle_request(env);
13
- try {
14
- return calculated_env_from_physics(request);
15
- }
16
- catch (error) {
17
- return handle_calculator_failure(error);
18
- }
19
- }
20
- function calculated_env_from_physics(request) {
21
- const output = calculate_weight_on_axles_physics(request);
22
- if (Array.isArray(output.envs) && output.envs.length > 0) {
23
- return { calculated: true, env: output.envs[0] };
24
- }
25
- throw new AxleCalculationError('calculator returned no envs');
26
- }
27
- function handle_calculator_failure(error) {
28
- if (error instanceof ItemOverlapError) {
29
- stabilizer_logger.debug('axle gate rejected candidate layout: ' + error.message);
30
- return { calculated: false, reason: error.message };
31
- }
32
- if (error instanceof AxleCalculationError) {
33
- throw error;
34
- }
35
- const message = error instanceof Error ? error.message : String(error);
36
- throw new AxleCalculationError(message);
37
- }
@@ -1,16 +0,0 @@
1
- import type { StabilizerContainer } from '../validation/contract/stabilizer_domain_schema.js';
2
- import type { CandidateSlotKind } from '../move/apply_move.js';
3
- import type { EmptySpaceSlot } from './enumerate_empty_space_slots.js';
4
- export interface TaggedSlot {
5
- position: EmptySpaceSlot;
6
- slot_kind: CandidateSlotKind;
7
- }
8
- /**
9
- * Collects empty-space origins and per-supporter top origins, supporter first.
10
- * @param container - Target container layout.
11
- * @param item - Loose item to place.
12
- * @param exclude_item_id - Loose item id omitted from obstacles and supporters.
13
- * @returns Tagged slots with supporter-top entries before empty-space entries.
14
- */
15
- export declare function collect_container_slots(container: StabilizerContainer, item: StabilizerContainer['items'][number], exclude_item_id: string): TaggedSlot[];
16
- //# sourceMappingURL=collect_container_slots.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collect_container_slots.d.ts","sourceRoot":"","sources":["../../../src/core/candidates/collect_container_slots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAA;AAC7F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AAItE,MAAM,WAAW,UAAU;IAEvB,QAAQ,EAAE,cAAc,CAAA;IACxB,SAAS,EAAE,iBAAiB,CAAA;CAC/B;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACnC,SAAS,EAAE,mBAAmB,EAC9B,IAAI,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,EAC1C,eAAe,EAAE,MAAM,GACxB,UAAU,EAAE,CAQd"}
@@ -1,20 +0,0 @@
1
- import { enumerate_empty_space_slots } from './enumerate_empty_space_slots.js';
2
- import { enumerate_supporter_top_slots } from './enumerate_supporter_top_slots.js';
3
- /**
4
- * Collects empty-space origins and per-supporter top origins, supporter first.
5
- * @param container - Target container layout.
6
- * @param item - Loose item to place.
7
- * @param exclude_item_id - Loose item id omitted from obstacles and supporters.
8
- * @returns Tagged slots with supporter-top entries before empty-space entries.
9
- */
10
- export function collect_container_slots(container, item, exclude_item_id) {
11
- const supporter = enumerate_supporter_top_slots(container, item, exclude_item_id);
12
- const empty = enumerate_empty_space_slots(container, item, exclude_item_id);
13
- return [
14
- ...tag_slots(supporter, 'supporter_top'),
15
- ...tag_slots(empty, 'empty_space')
16
- ];
17
- }
18
- function tag_slots(slots, slot_kind) {
19
- return slots.map(position => ({ position, slot_kind }));
20
- }
@@ -1,11 +0,0 @@
1
- import type { StabilizerContainer, StabilizerItem } from '../validation/contract/stabilizer_domain_schema.js';
2
- import type { EmptySpaceSlot } from './enumerate_empty_space_slots.js';
3
- /**
4
- * Emits one candidate origin per supporter footprint (x, supporter top y, z).
5
- * @param container - Target container layout.
6
- * @param item - Loose item dimensions.
7
- * @param exclude_item_id - Loose item id omitted as a supporter.
8
- * @returns Slot positions aligned to each supporter origin.
9
- */
10
- export declare function enumerate_supporter_top_slots(container: StabilizerContainer, item: StabilizerItem, exclude_item_id: string): EmptySpaceSlot[];
11
- //# sourceMappingURL=enumerate_supporter_top_slots.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"enumerate_supporter_top_slots.d.ts","sourceRoot":"","sources":["../../../src/core/candidates/enumerate_supporter_top_slots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,oDAAoD,CAAA;AAC7G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AAItE;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CACzC,SAAS,EAAE,mBAAmB,EAC9B,IAAI,EAAE,cAAc,EACpB,eAAe,EAAE,MAAM,GACxB,cAAc,EAAE,CAgBlB"}
@@ -1,36 +0,0 @@
1
- const CONTAINER_EPSILON = 1e-6;
2
- /**
3
- * Emits one candidate origin per supporter footprint (x, supporter top y, z).
4
- * @param container - Target container layout.
5
- * @param item - Loose item dimensions.
6
- * @param exclude_item_id - Loose item id omitted as a supporter.
7
- * @returns Slot positions aligned to each supporter origin.
8
- */
9
- export function enumerate_supporter_top_slots(container, item, exclude_item_id) {
10
- const slots = [];
11
- for (const supporter of container.items) {
12
- if (supporter.item_id === exclude_item_id) {
13
- continue;
14
- }
15
- const slot = supporter_top_slot(supporter);
16
- if (slot_fits_in_container(container, item, slot)) {
17
- slots.push(slot);
18
- }
19
- }
20
- return slots;
21
- }
22
- function supporter_top_slot(supporter) {
23
- return {
24
- x: supporter.x,
25
- y: supporter.y + supporter.height,
26
- z: supporter.z
27
- };
28
- }
29
- function slot_fits_in_container(container, item, slot) {
30
- return slot.x >= -CONTAINER_EPSILON &&
31
- slot.y >= -CONTAINER_EPSILON &&
32
- slot.z >= -CONTAINER_EPSILON &&
33
- slot.x + item.width <= container.width + CONTAINER_EPSILON &&
34
- slot.y + item.height <= container.height + CONTAINER_EPSILON &&
35
- slot.z + item.depth <= container.length + CONTAINER_EPSILON;
36
- }
@@ -1,14 +0,0 @@
1
- import type { CandidateGenerationContext } from './candidate_context.js';
2
- /**
3
- * Returns true when placing the loose item at position keeps stacking legal.
4
- * @param context - Candidate generation context.
5
- * @param target_index - Target container index.
6
- * @param position - Candidate pose.
7
- * @returns True when stacking-constraints accepts the pose.
8
- */
9
- export declare function is_candidate_stacking_valid(context: CandidateGenerationContext, target_index: number, position: {
10
- x: number;
11
- y: number;
12
- z: number;
13
- }): boolean;
14
- //# sourceMappingURL=is_candidate_stacking_valid.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is_candidate_stacking_valid.d.ts","sourceRoot":"","sources":["../../../src/core/candidates/is_candidate_stacking_valid.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAA;AAIxE;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACvC,OAAO,EAAE,0BAA0B,EACnC,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9C,OAAO,CAcT"}
@@ -1,43 +0,0 @@
1
- import { StackingFeasibilityChecker } from '@jetta/stacking-constraints';
2
- import { map_item_to_stacking_item } from '../adapters/map_item_to_stacking_item.js';
3
- const Y_SUPPORT_EPSILON = 1e-6;
4
- /**
5
- * Returns true when placing the loose item at position keeps stacking legal.
6
- * @param context - Candidate generation context.
7
- * @param target_index - Target container index.
8
- * @param position - Candidate pose.
9
- * @returns True when stacking-constraints accepts the pose.
10
- */
11
- export function is_candidate_stacking_valid(context, target_index, position) {
12
- const remaining = context.containers[target_index].items
13
- .filter(item => item.item_id !== context.loose.item_id)
14
- .map(item => map_item_to_stacking_item(item));
15
- const mover = map_item_to_stacking_item(context.loose.item, position);
16
- try {
17
- return build_checker(remaining).clone().validate_stackings(mover);
18
- }
19
- catch {
20
- return false;
21
- }
22
- }
23
- function build_checker(remaining) {
24
- if (remaining.length === 0) {
25
- return new StackingFeasibilityChecker(1, { y_support_epsilon: Y_SUPPORT_EPSILON });
26
- }
27
- try {
28
- return StackingFeasibilityChecker.from_allocated(remaining, {
29
- y_support_epsilon: Y_SUPPORT_EPSILON
30
- });
31
- }
32
- catch {
33
- return hydrate_bottom_up(remaining);
34
- }
35
- }
36
- function hydrate_bottom_up(remaining) {
37
- const checker = new StackingFeasibilityChecker(1, { y_support_epsilon: Y_SUPPORT_EPSILON });
38
- const ordered = [...remaining].sort((left, right) => left.y - right.y);
39
- for (const item of ordered) {
40
- checker.validate_stackings(item);
41
- }
42
- return checker;
43
- }
@@ -1,14 +0,0 @@
1
- import type { CandidateGenerationContext } from './candidate_context.js';
2
- /**
3
- * Floor candidates stay free; elevated ones must copy a supporter (x, z) origin.
4
- * @param context - Candidate generation context.
5
- * @param target_index - Target container index.
6
- * @param position - Candidate position.
7
- * @returns True when the candidate is on the floor or on a supporter origin.
8
- */
9
- export declare function is_elevated_on_supporter_origin(context: CandidateGenerationContext, target_index: number, position: {
10
- x: number;
11
- y: number;
12
- z: number;
13
- }): boolean;
14
- //# sourceMappingURL=is_elevated_on_supporter_origin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is_elevated_on_supporter_origin.d.ts","sourceRoot":"","sources":["../../../src/core/candidates/is_elevated_on_supporter_origin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAA;AAIxE;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC3C,OAAO,EAAE,0BAA0B,EACnC,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9C,OAAO,CAQT"}
@@ -1,28 +0,0 @@
1
- const ORIGIN_EPSILON = 1e-6;
2
- /**
3
- * Floor candidates stay free; elevated ones must copy a supporter (x, z) origin.
4
- * @param context - Candidate generation context.
5
- * @param target_index - Target container index.
6
- * @param position - Candidate position.
7
- * @returns True when the candidate is on the floor or on a supporter origin.
8
- */
9
- export function is_elevated_on_supporter_origin(context, target_index, position) {
10
- if (position.y <= ORIGIN_EPSILON) {
11
- return true;
12
- }
13
- const items = context.containers[target_index].items;
14
- return items.some(item => matches_supporter_origin(item, context.loose.item_id, position));
15
- }
16
- function matches_supporter_origin(item, exclude_item_id, position) {
17
- if (item.item_id === exclude_item_id) {
18
- return false;
19
- }
20
- return is_same_origin(item, position) && is_supporter_top(item, position.y);
21
- }
22
- function is_same_origin(item, position) {
23
- return Math.abs(item.x - position.x) <= ORIGIN_EPSILON
24
- && Math.abs(item.z - position.z) <= ORIGIN_EPSILON;
25
- }
26
- function is_supporter_top(item, candidate_y) {
27
- return Math.abs(item.y + item.height - candidate_y) <= ORIGIN_EPSILON;
28
- }
@@ -1,6 +0,0 @@
1
- export declare const TIE_RATIO_ORIENTATION: Readonly<{
2
- THREE_TWO: "3_2";
3
- TWO_THREE: "2_3";
4
- }>;
5
- export declare const TIE_RATIO_ORIENTATION_VALUES: readonly ("3_2" | "2_3")[];
6
- //# sourceMappingURL=TieRatioOrientation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TieRatioOrientation.d.ts","sourceRoot":"","sources":["../../../src/core/constants/TieRatioOrientation.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB;;;EAGhC,CAAA;AAEF,eAAO,MAAM,4BAA4B,4BAExC,CAAA"}
@@ -1,5 +0,0 @@
1
- export const TIE_RATIO_ORIENTATION = Object.freeze({
2
- THREE_TWO: '3_2',
3
- TWO_THREE: '2_3'
4
- });
5
- export const TIE_RATIO_ORIENTATION_VALUES = Object.freeze(Object.values(TIE_RATIO_ORIENTATION));
@@ -1,12 +0,0 @@
1
- export interface SearchRankFields {
2
- axle_excess_kg: number;
3
- objective: number;
4
- }
5
- /**
6
- * Ranks search states: lower axle excess first, then higher stability objective.
7
- * @param left - Left state.
8
- * @param right - Right state.
9
- * @returns Negative when left ranks ahead of right.
10
- */
11
- export declare function compare_search_states(left: SearchRankFields, right: SearchRankFields): number;
12
- //# sourceMappingURL=compare_search_states.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compare_search_states.d.ts","sourceRoot":"","sources":["../../../src/core/evaluation/compare_search_states.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAE7B,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAO7F"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Ranks search states: lower axle excess first, then higher stability objective.
3
- * @param left - Left state.
4
- * @param right - Right state.
5
- * @returns Negative when left ranks ahead of right.
6
- */
7
- export function compare_search_states(left, right) {
8
- if (left.axle_excess_kg !== right.axle_excess_kg) {
9
- return left.axle_excess_kg - right.axle_excess_kg;
10
- }
11
- return right.objective - left.objective;
12
- }
@@ -1,13 +0,0 @@
1
- import { type StabilityEvaluation } from '../adapters/stability_adapter.js';
2
- import type { StabilizerContainer } from '../validation/contract/stabilizer_domain_schema.js';
3
- import type { LooseItemRef } from '../filters/loose_item_filter.js';
4
- export declare const LOOSE_SUM_TIE_BREAK_SCALE = 0.000001;
5
- /**
6
- * Computes the reorder objective: maximize transport stability, then loose-item sum.
7
- * @param stability - Transport stability evaluation.
8
- * @param containers - Container layout used for loose-item index lookup.
9
- * @param loose_items - Loose items included in the tie-break term.
10
- * @returns Scalar objective; higher is better.
11
- */
12
- export declare function compute_reorder_objective(stability: StabilityEvaluation, containers: StabilizerContainer[], loose_items: LooseItemRef[]): number;
13
- //# sourceMappingURL=compute_reorder_objective.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compute_reorder_objective.d.ts","sourceRoot":"","sources":["../../../src/core/evaluation/compute_reorder_objective.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,mBAAmB,EAC3B,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAA;AAC7F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAEnE,eAAO,MAAM,yBAAyB,WAAO,CAAA;AAE7C;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACrC,SAAS,EAAE,mBAAmB,EAC9B,UAAU,EAAE,mBAAmB,EAAE,EACjC,WAAW,EAAE,YAAY,EAAE,GAC5B,MAAM,CAIR"}
@@ -1,13 +0,0 @@
1
- import { sum_loose_item_scores } from '../adapters/stability_adapter.js';
2
- export const LOOSE_SUM_TIE_BREAK_SCALE = 1e-6;
3
- /**
4
- * Computes the reorder objective: maximize transport stability, then loose-item sum.
5
- * @param stability - Transport stability evaluation.
6
- * @param containers - Container layout used for loose-item index lookup.
7
- * @param loose_items - Loose items included in the tie-break term.
8
- * @returns Scalar objective; higher is better.
9
- */
10
- export function compute_reorder_objective(stability, containers, loose_items) {
11
- const loose_sum = sum_loose_item_scores(stability, containers, loose_items);
12
- return stability.transport_score + loose_sum * LOOSE_SUM_TIE_BREAK_SCALE;
13
- }
@@ -1,18 +0,0 @@
1
- import type { StabilizerContainer } from '../validation/contract/stabilizer_domain_schema.js';
2
- import type { StabilityEvaluation } from '../adapters/stability_adapter.js';
3
- import type { StateEvaluationContext } from './evaluation_context.js';
4
- import type { EvaluationResult } from './evaluation_result.js';
5
- export interface SearchGateOutcome {
6
- objective: number;
7
- pass: boolean;
8
- flags: Omit<EvaluationResult, 'stability' | 'objective' | 'all_gates_pass'>;
9
- }
10
- /**
11
- * Computes reorder objective and legality flags for a layout.
12
- * @param containers - Container layout.
13
- * @param context - Evaluation context.
14
- * @param stability - Transport stability evaluation.
15
- * @returns Objective, pass flag, and gate fields.
16
- */
17
- export declare function evaluate_search_gates(containers: StabilizerContainer[], context: StateEvaluationContext, stability: StabilityEvaluation): SearchGateOutcome;
18
- //# sourceMappingURL=evaluate_search_gates.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"evaluate_search_gates.d.ts","sourceRoot":"","sources":["../../../src/core/evaluation/evaluate_search_gates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAA;AAC7F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AAC3E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAM9D,MAAM,WAAW,iBAAiB;IAE9B,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAE,WAAW,GAAG,WAAW,GAAG,gBAAgB,CAAC,CAAA;CAC9E;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACjC,UAAU,EAAE,mBAAmB,EAAE,EACjC,OAAO,EAAE,sBAAsB,EAC/B,SAAS,EAAE,mBAAmB,GAC/B,iBAAiB,CAanB"}
@@ -1,30 +0,0 @@
1
- import { compute_reorder_objective } from './compute_reorder_objective.js';
2
- import { evaluate_axle_load } from '../adapters/evaluate_axle_load.js';
3
- import { is_layout_milkrun_valid } from '../waypoint/milkrun_wall_reservation.js';
4
- import { is_waypoint_order_valid } from './is_waypoint_order_valid.js';
5
- /**
6
- * Computes reorder objective and legality flags for a layout.
7
- * @param containers - Container layout.
8
- * @param context - Evaluation context.
9
- * @param stability - Transport stability evaluation.
10
- * @returns Objective, pass flag, and gate fields.
11
- */
12
- export function evaluate_search_gates(containers, context, stability) {
13
- const objective = compute_reorder_objective(stability, containers, context.loose_items);
14
- const axle_load = evaluate_axle_load({ ...context.env, containers }, context.config.axle_load_margin_percent);
15
- const flags = build_gate_flags({ containers, context, stability, axle_load });
16
- return {
17
- objective,
18
- pass: flags.transport_floor_valid && flags.axle_valid && flags.waypoint_valid && flags.milkrun_valid,
19
- flags
20
- };
21
- }
22
- function build_gate_flags(input) {
23
- return {
24
- transport_floor_valid: input.stability.transport_score >= input.context.config.transport_stability_floor,
25
- axle_valid: input.axle_load.valid,
26
- waypoint_valid: is_waypoint_order_valid(input.containers, input.context),
27
- milkrun_valid: is_layout_milkrun_valid(input.containers, input.context.milkrun_reserved_z_bands),
28
- axle_excess_kg: input.axle_load.excess_kg
29
- };
30
- }