@jetta/cargo-stabilizer 0.1.0-15 → 0.1.0-3
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/CHANGELOG.md +1 -35
- package/README.md +16 -62
- package/build/core/adapters/axle_adapter.d.ts +4 -5
- package/build/core/adapters/axle_adapter.d.ts.map +1 -1
- package/build/core/adapters/axle_adapter.js +23 -6
- package/build/core/adapters/coordinate_mapper.d.ts +5 -5
- package/build/core/adapters/coordinate_mapper.d.ts.map +1 -1
- package/build/core/adapters/coordinate_mapper.js +13 -13
- package/build/core/adapters/stability_adapter.d.ts +1 -1
- package/build/core/adapters/stability_adapter.d.ts.map +1 -1
- package/build/core/adapters/stability_adapter.js +1 -1
- package/build/core/candidates/build_candidate_context.d.ts +1 -1
- package/build/core/candidates/build_candidate_context.d.ts.map +1 -1
- package/build/core/candidates/build_candidate_context.js +1 -3
- package/build/core/candidates/candidate_context.d.ts +1 -4
- package/build/core/candidates/candidate_context.d.ts.map +1 -1
- package/build/core/candidates/candidate_generator.d.ts +1 -1
- package/build/core/candidates/candidate_generator.d.ts.map +1 -1
- package/build/core/candidates/candidate_generator.js +16 -33
- package/build/core/candidates/candidate_validation.d.ts +12 -0
- package/build/core/candidates/candidate_validation.d.ts.map +1 -1
- package/build/core/candidates/candidate_validation.js +26 -40
- package/build/core/candidates/rank_candidates.d.ts.map +1 -1
- package/build/core/candidates/rank_candidates.js +0 -3
- package/build/core/evaluation/evaluation_context.d.ts +1 -3
- package/build/core/evaluation/evaluation_context.d.ts.map +1 -1
- package/build/core/evaluation/state_evaluator.d.ts +10 -13
- package/build/core/evaluation/state_evaluator.d.ts.map +1 -1
- package/build/core/evaluation/state_evaluator.js +15 -19
- package/build/core/factory/read_stabilizer_config.d.ts +2 -5
- package/build/core/factory/read_stabilizer_config.d.ts.map +1 -1
- package/build/core/factory/read_stabilizer_config.js +25 -6
- package/build/core/filters/loose_item_filter.d.ts +2 -2
- package/build/core/filters/loose_item_filter.d.ts.map +1 -1
- package/build/core/filters/loose_item_filter.js +3 -3
- package/build/core/geometry/box_geometry.d.ts +1 -17
- package/build/core/geometry/box_geometry.d.ts.map +1 -1
- package/build/core/geometry/box_geometry.js +2 -67
- package/build/core/move/apply_move.d.ts +1 -3
- package/build/core/move/apply_move.d.ts.map +1 -1
- package/build/core/move/apply_move.js +1 -1
- package/build/core/orchestration/StabilizerFlow.d.ts +1 -2
- package/build/core/orchestration/StabilizerFlow.d.ts.map +1 -1
- package/build/core/orchestration/StabilizerFlow.js +1 -1
- package/build/core/orchestration/build_reorder_context.d.ts +1 -1
- package/build/core/orchestration/build_reorder_context.d.ts.map +1 -1
- package/build/core/orchestration/build_reorder_context.js +12 -10
- package/build/core/strategies/reorder/BeamSearchReorder.d.ts +1 -1
- package/build/core/strategies/reorder/BeamSearchReorder.d.ts.map +1 -1
- package/build/core/strategies/reorder/BeamSearchReorder.js +16 -15
- package/build/core/strategies/reorder/GeneticReorder.d.ts +1 -1
- package/build/core/strategies/reorder/GeneticReorder.d.ts.map +1 -1
- package/build/core/strategies/reorder/GeneticReorder.js +1 -2
- package/build/core/strategies/reorder/GravityCompaction.d.ts +1 -1
- package/build/core/strategies/reorder/GravityCompaction.d.ts.map +1 -1
- package/build/core/strategies/reorder/GravityCompaction.js +2 -2
- package/build/core/strategies/reorder/GreedyReorder.d.ts +1 -1
- package/build/core/strategies/reorder/GreedyReorder.d.ts.map +1 -1
- package/build/core/strategies/reorder/ReorderStrategy.d.ts +1 -3
- package/build/core/strategies/reorder/ReorderStrategy.d.ts.map +1 -1
- package/build/core/strategies/reorder/SimulatedAnnealingReorder.d.ts +1 -1
- package/build/core/strategies/reorder/SimulatedAnnealingReorder.d.ts.map +1 -1
- package/build/core/strategies/reorder/SimulatedAnnealingReorder.js +5 -14
- package/build/core/strategies/reorder/anneal_helpers.d.ts +1 -1
- package/build/core/strategies/reorder/anneal_helpers.d.ts.map +1 -1
- package/build/core/strategies/reorder/anneal_helpers.js +1 -1
- package/build/core/strategies/reorder/apply_if_gates_pass.d.ts +1 -1
- package/build/core/strategies/reorder/apply_if_gates_pass.d.ts.map +1 -1
- package/build/core/strategies/reorder/beam_context.d.ts +1 -2
- package/build/core/strategies/reorder/beam_context.d.ts.map +1 -1
- package/build/core/strategies/reorder/genetic/Chromosome.d.ts +1 -1
- package/build/core/strategies/reorder/genetic/Chromosome.d.ts.map +1 -1
- package/build/core/strategies/reorder/genetic/Chromosome.js +2 -2
- package/build/core/strategies/reorder/greedy_improvement.d.ts +1 -1
- package/build/core/strategies/reorder/greedy_improvement.d.ts.map +1 -1
- package/build/core/strategies/reorder/greedy_improvement.js +4 -5
- package/build/core/validation/parse_stabilizer_input.d.ts +8 -0
- package/build/core/validation/parse_stabilizer_input.d.ts.map +1 -0
- package/build/core/validation/parse_stabilizer_input.js +20 -0
- package/build/core/validation/schemas/stabilizer_config_schema.d.ts +2 -6
- package/build/core/validation/schemas/stabilizer_config_schema.d.ts.map +1 -1
- package/build/core/validation/schemas/stabilizer_config_schema.js +2 -6
- package/build/core/validation/schemas/stabilizer_input_schema.d.ts +110 -0
- package/build/core/validation/schemas/stabilizer_input_schema.d.ts.map +1 -0
- package/build/core/validation/schemas/stabilizer_input_schema.js +34 -0
- package/build/core/validation/schemas/stabilizer_output_schema.d.ts +13 -0
- package/build/core/validation/schemas/stabilizer_output_schema.d.ts.map +1 -0
- package/build/core/validation/schemas/stabilizer_output_schema.js +6 -0
- package/build/core/waypoint/build_waypoint_zones.d.ts +1 -1
- package/build/core/waypoint/build_waypoint_zones.d.ts.map +1 -1
- package/build/core/waypoint/build_waypoint_zones.js +2 -2
- package/build/core/waypoint/preserves_waypoint_order.d.ts +1 -1
- package/build/core/waypoint/preserves_waypoint_order.d.ts.map +1 -1
- package/build/core/waypoint/validate_waypoint_ids.d.ts +1 -1
- package/build/core/waypoint/validate_waypoint_ids.d.ts.map +1 -1
- package/build/index.d.ts +7 -15
- package/build/index.d.ts.map +1 -1
- package/build/index.js +11 -42
- package/package.json +10 -12
- package/build/core/adapters/axle_load_evaluation.d.ts +0 -8
- package/build/core/adapters/axle_load_evaluation.d.ts.map +0 -1
- package/build/core/adapters/axle_load_evaluation.js +0 -1
- package/build/core/adapters/build_axle_request.d.ts +0 -8
- package/build/core/adapters/build_axle_request.d.ts.map +0 -1
- package/build/core/adapters/build_axle_request.js +0 -67
- package/build/core/adapters/compute_axle_excess_kg.d.ts +0 -8
- package/build/core/adapters/compute_axle_excess_kg.d.ts.map +0 -1
- package/build/core/adapters/compute_axle_excess_kg.js +0 -19
- package/build/core/adapters/empty_space_adapter.d.ts +0 -10
- package/build/core/adapters/empty_space_adapter.d.ts.map +0 -1
- package/build/core/adapters/empty_space_adapter.js +0 -24
- package/build/core/adapters/evaluate_axle_load.d.ts +0 -10
- package/build/core/adapters/evaluate_axle_load.d.ts.map +0 -1
- package/build/core/adapters/evaluate_axle_load.js +0 -32
- package/build/core/adapters/map_item_to_positioned_cube.d.ts +0 -9
- package/build/core/adapters/map_item_to_positioned_cube.d.ts.map +0 -1
- package/build/core/adapters/map_item_to_positioned_cube.js +0 -16
- package/build/core/adapters/map_item_to_stacking_item.d.ts +0 -14
- package/build/core/adapters/map_item_to_stacking_item.d.ts.map +0 -1
- package/build/core/adapters/map_item_to_stacking_item.js +0 -40
- package/build/core/adapters/run_axle_calculator.d.ts +0 -16
- package/build/core/adapters/run_axle_calculator.d.ts.map +0 -1
- package/build/core/adapters/run_axle_calculator.js +0 -37
- package/build/core/candidates/collect_container_slots.d.ts +0 -16
- package/build/core/candidates/collect_container_slots.d.ts.map +0 -1
- package/build/core/candidates/collect_container_slots.js +0 -20
- package/build/core/candidates/enumerate_empty_space_slots.d.ts +0 -15
- package/build/core/candidates/enumerate_empty_space_slots.d.ts.map +0 -1
- package/build/core/candidates/enumerate_empty_space_slots.js +0 -44
- package/build/core/candidates/enumerate_supporter_top_slots.d.ts +0 -11
- package/build/core/candidates/enumerate_supporter_top_slots.d.ts.map +0 -1
- package/build/core/candidates/enumerate_supporter_top_slots.js +0 -36
- package/build/core/candidates/is_candidate_stacking_valid.d.ts +0 -14
- package/build/core/candidates/is_candidate_stacking_valid.d.ts.map +0 -1
- package/build/core/candidates/is_candidate_stacking_valid.js +0 -43
- package/build/core/candidates/is_elevated_on_supporter_origin.d.ts +0 -14
- package/build/core/candidates/is_elevated_on_supporter_origin.d.ts.map +0 -1
- package/build/core/candidates/is_elevated_on_supporter_origin.js +0 -28
- package/build/core/constants/TieRatioOrientation.d.ts +0 -6
- package/build/core/constants/TieRatioOrientation.d.ts.map +0 -1
- package/build/core/constants/TieRatioOrientation.js +0 -5
- package/build/core/evaluation/compare_search_states.d.ts +0 -12
- package/build/core/evaluation/compare_search_states.d.ts.map +0 -1
- package/build/core/evaluation/compare_search_states.js +0 -12
- package/build/core/evaluation/compute_reorder_objective.d.ts +0 -13
- package/build/core/evaluation/compute_reorder_objective.d.ts.map +0 -1
- package/build/core/evaluation/compute_reorder_objective.js +0 -13
- package/build/core/evaluation/evaluate_search_gates.d.ts +0 -18
- package/build/core/evaluation/evaluate_search_gates.d.ts.map +0 -1
- package/build/core/evaluation/evaluate_search_gates.js +0 -30
- package/build/core/evaluation/evaluation_result.d.ts +0 -15
- package/build/core/evaluation/evaluation_result.d.ts.map +0 -1
- package/build/core/evaluation/evaluation_result.js +0 -1
- package/build/core/evaluation/genetic_fitness.d.ts +0 -9
- package/build/core/evaluation/genetic_fitness.d.ts.map +0 -1
- package/build/core/evaluation/genetic_fitness.js +0 -16
- package/build/core/evaluation/is_non_axle_gates_pass.d.ts +0 -8
- package/build/core/evaluation/is_non_axle_gates_pass.d.ts.map +0 -1
- package/build/core/evaluation/is_non_axle_gates_pass.js +0 -8
- package/build/core/evaluation/is_search_trial_admissible.d.ts +0 -10
- package/build/core/evaluation/is_search_trial_admissible.d.ts.map +0 -1
- package/build/core/evaluation/is_search_trial_admissible.js +0 -17
- package/build/core/evaluation/is_waypoint_order_valid.d.ts +0 -10
- package/build/core/evaluation/is_waypoint_order_valid.d.ts.map +0 -1
- package/build/core/evaluation/is_waypoint_order_valid.js +0 -14
- package/build/core/exceptions/AxleCalculationError.d.ts +0 -4
- package/build/core/exceptions/AxleCalculationError.d.ts.map +0 -1
- package/build/core/exceptions/AxleCalculationError.js +0 -6
- package/build/core/exceptions/InvalidStabilizerOutputError.d.ts +0 -4
- package/build/core/exceptions/InvalidStabilizerOutputError.d.ts.map +0 -1
- package/build/core/exceptions/InvalidStabilizerOutputError.js +0 -6
- package/build/core/factory/read_stabilizer_config_helpers.d.ts +0 -32
- package/build/core/factory/read_stabilizer_config_helpers.d.ts.map +0 -1
- package/build/core/factory/read_stabilizer_config_helpers.js +0 -73
- package/build/core/filters/collect_movable_items.d.ts +0 -18
- package/build/core/filters/collect_movable_items.d.ts.map +0 -1
- package/build/core/filters/collect_movable_items.js +0 -53
- package/build/core/filters/collect_pinned_floor_tie_ratio_group_ids.d.ts +0 -8
- package/build/core/filters/collect_pinned_floor_tie_ratio_group_ids.d.ts.map +0 -1
- package/build/core/filters/collect_pinned_floor_tie_ratio_group_ids.js +0 -41
- package/build/core/filters/is_item_on_cm_floor.d.ts +0 -8
- package/build/core/filters/is_item_on_cm_floor.d.ts.map +0 -1
- package/build/core/filters/is_item_on_cm_floor.js +0 -9
- package/build/core/geometry/has_penetrating_overlap.d.ts +0 -9
- package/build/core/geometry/has_penetrating_overlap.d.ts.map +0 -1
- package/build/core/geometry/has_penetrating_overlap.js +0 -27
- package/build/core/orchestration/build_milkrun_bands_from_config.d.ts +0 -13
- package/build/core/orchestration/build_milkrun_bands_from_config.d.ts.map +0 -1
- package/build/core/orchestration/build_milkrun_bands_from_config.js +0 -14
- package/build/core/orchestration/read_primary_env.d.ts +0 -9
- package/build/core/orchestration/read_primary_env.d.ts.map +0 -1
- package/build/core/orchestration/read_primary_env.js +0 -13
- package/build/core/strategies/reorder/append_admitted_trial.d.ts +0 -11
- package/build/core/strategies/reorder/append_admitted_trial.d.ts.map +0 -1
- package/build/core/strategies/reorder/append_admitted_trial.js +0 -22
- package/build/core/strategies/reorder/is_improving_greedy_trial.d.ts +0 -10
- package/build/core/strategies/reorder/is_improving_greedy_trial.d.ts.map +0 -1
- package/build/core/strategies/reorder/is_improving_greedy_trial.js +0 -17
- package/build/core/strategies/reorder/select_beam_expansion_candidates.d.ts +0 -9
- package/build/core/strategies/reorder/select_beam_expansion_candidates.d.ts.map +0 -1
- package/build/core/strategies/reorder/select_beam_expansion_candidates.js +0 -28
- package/build/core/strategies/reorder/select_surviving_beam.d.ts +0 -11
- package/build/core/strategies/reorder/select_surviving_beam.d.ts.map +0 -1
- package/build/core/strategies/reorder/select_surviving_beam.js +0 -13
- package/build/core/validation/contract/cargo_movement_wire_field_map.d.ts +0 -71
- package/build/core/validation/contract/cargo_movement_wire_field_map.d.ts.map +0 -1
- package/build/core/validation/contract/cargo_movement_wire_field_map.js +0 -77
- package/build/core/validation/contract/cargo_movement_wire_mapper.d.ts +0 -14
- package/build/core/validation/contract/cargo_movement_wire_mapper.d.ts.map +0 -1
- package/build/core/validation/contract/cargo_movement_wire_mapper.js +0 -43
- package/build/core/validation/contract/format_zod_error.d.ts +0 -8
- package/build/core/validation/contract/format_zod_error.d.ts.map +0 -1
- package/build/core/validation/contract/format_zod_error.js +0 -11
- package/build/core/validation/contract/index.d.ts +0 -9
- package/build/core/validation/contract/index.d.ts.map +0 -1
- package/build/core/validation/contract/index.js +0 -8
- package/build/core/validation/contract/map_contract_to_wire_shape.d.ts +0 -3
- package/build/core/validation/contract/map_contract_to_wire_shape.d.ts.map +0 -1
- package/build/core/validation/contract/map_contract_to_wire_shape.js +0 -33
- package/build/core/validation/contract/map_input_config.d.ts +0 -9
- package/build/core/validation/contract/map_input_config.d.ts.map +0 -1
- package/build/core/validation/contract/map_input_config.js +0 -40
- package/build/core/validation/contract/map_wire_input_to_contract_shape.d.ts +0 -2
- package/build/core/validation/contract/map_wire_input_to_contract_shape.d.ts.map +0 -1
- package/build/core/validation/contract/map_wire_input_to_contract_shape.js +0 -66
- package/build/core/validation/contract/map_wire_item_stacking.d.ts +0 -7
- package/build/core/validation/contract/map_wire_item_stacking.d.ts.map +0 -1
- package/build/core/validation/contract/map_wire_item_stacking.js +0 -40
- package/build/core/validation/contract/map_wire_item_to_contract.d.ts +0 -8
- package/build/core/validation/contract/map_wire_item_to_contract.d.ts.map +0 -1
- package/build/core/validation/contract/map_wire_item_to_contract.js +0 -51
- package/build/core/validation/contract/parse_stabilizer_input.d.ts +0 -90
- package/build/core/validation/contract/parse_stabilizer_input.d.ts.map +0 -1
- package/build/core/validation/contract/parse_stabilizer_input.js +0 -28
- package/build/core/validation/contract/parse_stabilizer_output.d.ts +0 -79
- package/build/core/validation/contract/parse_stabilizer_output.d.ts.map +0 -1
- package/build/core/validation/contract/parse_stabilizer_output.js +0 -24
- package/build/core/validation/contract/reject_forbidden_input_fields.d.ts +0 -6
- package/build/core/validation/contract/reject_forbidden_input_fields.d.ts.map +0 -1
- package/build/core/validation/contract/reject_forbidden_input_fields.js +0 -53
- package/build/core/validation/contract/stabilizer_domain_schema.d.ts +0 -72
- package/build/core/validation/contract/stabilizer_domain_schema.d.ts.map +0 -1
- package/build/core/validation/contract/stabilizer_domain_schema.js +0 -42
- package/build/core/validation/contract/stabilizer_env_schema.d.ts +0 -112
- package/build/core/validation/contract/stabilizer_env_schema.d.ts.map +0 -1
- package/build/core/validation/contract/stabilizer_env_schema.js +0 -38
- package/build/core/validation/contract/stabilizer_input_schema.d.ts +0 -80
- package/build/core/validation/contract/stabilizer_input_schema.d.ts.map +0 -1
- package/build/core/validation/contract/stabilizer_input_schema.js +0 -11
- package/build/core/validation/contract/stabilizer_item_schema.d.ts +0 -25
- package/build/core/validation/contract/stabilizer_item_schema.d.ts.map +0 -1
- package/build/core/validation/contract/stabilizer_item_schema.js +0 -23
- package/build/core/validation/contract/stabilizer_output_schema.d.ts +0 -134
- package/build/core/validation/contract/stabilizer_output_schema.d.ts.map +0 -1
- package/build/core/validation/contract/stabilizer_output_schema.js +0 -16
- package/build/core/validation/contract/uniquify_contract_item_ids.d.ts +0 -14
- package/build/core/validation/contract/uniquify_contract_item_ids.d.ts.map +0 -1
- package/build/core/validation/contract/uniquify_contract_item_ids.js +0 -54
- package/build/core/validation/contract/wire_mapper_record_utils.d.ts +0 -34
- package/build/core/validation/contract/wire_mapper_record_utils.d.ts.map +0 -1
- package/build/core/validation/contract/wire_mapper_record_utils.js +0 -66
- package/build/core/waypoint/milkrun_wall_reservation.d.ts +0 -24
- package/build/core/waypoint/milkrun_wall_reservation.d.ts.map +0 -1
- package/build/core/waypoint/milkrun_wall_reservation.js +0 -57
- package/build/core/waypoint/milkrun_wall_reservation_helpers.d.ts +0 -15
- package/build/core/waypoint/milkrun_wall_reservation_helpers.d.ts.map +0 -1
- package/build/core/waypoint/milkrun_wall_reservation_helpers.js +0 -48
- package/build/core/waypoint/milkrun_wall_reservation_types.d.ts +0 -16
- package/build/core/waypoint/milkrun_wall_reservation_types.d.ts.map +0 -1
- package/build/core/waypoint/milkrun_wall_reservation_types.js +0 -1
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { collect_pinned_floor_tie_ratio_group_ids } from './collect_pinned_floor_tie_ratio_group_ids.js';
|
|
2
|
-
import { is_item_on_cm_floor } from './is_item_on_cm_floor.js';
|
|
3
|
-
/**
|
|
4
|
-
* Collects items the stabilizer may move.
|
|
5
|
-
* @param containers - Container list from env.
|
|
6
|
-
* @param pin_tie_ratio_blocks - When true, skip floor five-slot 3_2/2_3 walls.
|
|
7
|
-
* @returns Movable item references with container index.
|
|
8
|
-
*/
|
|
9
|
-
export function collect_movable_items(containers, pin_tie_ratio_blocks) {
|
|
10
|
-
const pinned_groups = pin_tie_ratio_blocks
|
|
11
|
-
? collect_pinned_floor_tie_ratio_group_ids(flatten_container_items(containers))
|
|
12
|
-
: new Set();
|
|
13
|
-
return collect_items_except_pinned(containers, pinned_groups);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* @param item - Item record.
|
|
17
|
-
* @param pinned_group_ids - Floor five-slot 3_2/2_3 group ids.
|
|
18
|
-
* @returns True when the item is a floor member of a pinned wall.
|
|
19
|
-
*/
|
|
20
|
-
export function is_tie_ratio_block_item(item, pinned_group_ids) {
|
|
21
|
-
if (item.group_id == null || !is_item_on_cm_floor(item)) {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
return pinned_group_ids.has(item.group_id);
|
|
25
|
-
}
|
|
26
|
-
function collect_items_except_pinned(containers, pinned_groups) {
|
|
27
|
-
const movable = [];
|
|
28
|
-
for (let container_index = 0; container_index < containers.length; container_index++) {
|
|
29
|
-
movable.push(...collect_container_movable_items(containers[container_index].items, container_index, pinned_groups));
|
|
30
|
-
}
|
|
31
|
-
return movable;
|
|
32
|
-
}
|
|
33
|
-
function collect_container_movable_items(items, container_index, pinned_groups) {
|
|
34
|
-
const movable = [];
|
|
35
|
-
for (const item of items) {
|
|
36
|
-
if (is_tie_ratio_block_item(item, pinned_groups)) {
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
39
|
-
movable.push({
|
|
40
|
-
item_id: item.item_id,
|
|
41
|
-
container_index,
|
|
42
|
-
item
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
return movable;
|
|
46
|
-
}
|
|
47
|
-
function flatten_container_items(containers) {
|
|
48
|
-
const items = [];
|
|
49
|
-
for (const container of containers) {
|
|
50
|
-
items.push(...container.items);
|
|
51
|
-
}
|
|
52
|
-
return items;
|
|
53
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { StabilizerItem } from '../validation/contract/stabilizer_domain_schema.js';
|
|
2
|
-
/**
|
|
3
|
-
* Group ids of floor five-slot 3_2/2_3 walls that the stabilizer must pin.
|
|
4
|
-
* @param items - All items in the cargo.
|
|
5
|
-
* @returns Group ids with exactly five floor tie-ratio members.
|
|
6
|
-
*/
|
|
7
|
-
export declare function collect_pinned_floor_tie_ratio_group_ids(items: StabilizerItem[]): Set<string>;
|
|
8
|
-
//# sourceMappingURL=collect_pinned_floor_tie_ratio_group_ids.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"collect_pinned_floor_tie_ratio_group_ids.d.ts","sourceRoot":"","sources":["../../../src/core/filters/collect_pinned_floor_tie_ratio_group_ids.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oDAAoD,CAAA;AAMxF;;;;GAIG;AACH,wBAAgB,wCAAwC,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAQ7F"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { TIE_RATIO_ORIENTATION } from '../constants/TieRatioOrientation.js';
|
|
2
|
-
import { is_item_on_cm_floor } from './is_item_on_cm_floor.js';
|
|
3
|
-
const FULL_TIE_RATIO_FLOOR_COUNT = 5;
|
|
4
|
-
/**
|
|
5
|
-
* Group ids of floor five-slot 3_2/2_3 walls that the stabilizer must pin.
|
|
6
|
-
* @param items - All items in the cargo.
|
|
7
|
-
* @returns Group ids with exactly five floor tie-ratio members.
|
|
8
|
-
*/
|
|
9
|
-
export function collect_pinned_floor_tie_ratio_group_ids(items) {
|
|
10
|
-
const floor_tie_count_by_group = new Map();
|
|
11
|
-
for (const item of items) {
|
|
12
|
-
add_floor_tie_member(floor_tie_count_by_group, item);
|
|
13
|
-
}
|
|
14
|
-
return groups_with_full_floor_wall(floor_tie_count_by_group);
|
|
15
|
-
}
|
|
16
|
-
function add_floor_tie_member(counts, item) {
|
|
17
|
-
if (item.group_id == null || !is_item_on_cm_floor(item)) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
if (!is_tie_ratio_orientation(read_tie_ratio_orientation(item))) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
counts.set(item.group_id, (counts.get(item.group_id) ?? 0) + 1);
|
|
24
|
-
}
|
|
25
|
-
function groups_with_full_floor_wall(counts) {
|
|
26
|
-
const pinned = new Set();
|
|
27
|
-
for (const [group_id, count] of counts) {
|
|
28
|
-
if (count === FULL_TIE_RATIO_FLOOR_COUNT) {
|
|
29
|
-
pinned.add(group_id);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return pinned;
|
|
33
|
-
}
|
|
34
|
-
function read_tie_ratio_orientation(item) {
|
|
35
|
-
const orientation = item.tie_ratio_orientation;
|
|
36
|
-
return typeof orientation === 'string' ? orientation : undefined;
|
|
37
|
-
}
|
|
38
|
-
function is_tie_ratio_orientation(orientation) {
|
|
39
|
-
return orientation === TIE_RATIO_ORIENTATION.THREE_TWO
|
|
40
|
-
|| orientation === TIE_RATIO_ORIENTATION.TWO_THREE;
|
|
41
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { StabilizerItem } from '../validation/contract/stabilizer_domain_schema.js';
|
|
2
|
-
/**
|
|
3
|
-
* True when the item rests on the floor (contract y is height after wire map).
|
|
4
|
-
* @param item - Stabilizer item in contract coordinates.
|
|
5
|
-
* @returns True when height origin is on the floor.
|
|
6
|
-
*/
|
|
7
|
-
export declare function is_item_on_cm_floor(item: StabilizerItem): boolean;
|
|
8
|
-
//# sourceMappingURL=is_item_on_cm_floor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is_item_on_cm_floor.d.ts","sourceRoot":"","sources":["../../../src/core/filters/is_item_on_cm_floor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oDAAoD,CAAA;AAIxF;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAGjE"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const CM_FLOOR_HEIGHT_EPSILON = 1e-6;
|
|
2
|
-
/**
|
|
3
|
-
* True when the item rests on the floor (contract y is height after wire map).
|
|
4
|
-
* @param item - Stabilizer item in contract coordinates.
|
|
5
|
-
* @returns True when height origin is on the floor.
|
|
6
|
-
*/
|
|
7
|
-
export function is_item_on_cm_floor(item) {
|
|
8
|
-
return item.y <= CM_FLOOR_HEIGHT_EPSILON;
|
|
9
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { StabilizerContainer } from '../validation/contract/stabilizer_domain_schema.js';
|
|
2
|
-
/**
|
|
3
|
-
* True when any two items penetrate in the contract frame
|
|
4
|
-
* (x + width, y + height, z + depth). Face-touch uses `@jetta/number-compare`.
|
|
5
|
-
* @param containers - Layout to inspect.
|
|
6
|
-
* @returns True when a pair occupies the same volume beyond float error.
|
|
7
|
-
*/
|
|
8
|
-
export declare function has_penetrating_overlap(containers: StabilizerContainer[]): boolean;
|
|
9
|
-
//# sourceMappingURL=has_penetrating_overlap.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"has_penetrating_overlap.d.ts","sourceRoot":"","sources":["../../../src/core/geometry/has_penetrating_overlap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAkB,MAAM,oDAAoD,CAAA;AAE7G;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAGlF"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { lt } from '@jetta/number-compare';
|
|
2
|
-
/**
|
|
3
|
-
* True when any two items penetrate in the contract frame
|
|
4
|
-
* (x + width, y + height, z + depth). Face-touch uses `@jetta/number-compare`.
|
|
5
|
-
* @param containers - Layout to inspect.
|
|
6
|
-
* @returns True when a pair occupies the same volume beyond float error.
|
|
7
|
-
*/
|
|
8
|
-
export function has_penetrating_overlap(containers) {
|
|
9
|
-
return containers.some(container => container_has_penetrating_overlap(container));
|
|
10
|
-
}
|
|
11
|
-
function container_has_penetrating_overlap(container) {
|
|
12
|
-
const items = container.items;
|
|
13
|
-
for (let i = 0; i < items.length; i++) {
|
|
14
|
-
for (let j = i + 1; j < items.length; j++) {
|
|
15
|
-
if (items_penetrate(items[i], items[j])) {
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
function items_penetrate(left, right) {
|
|
23
|
-
return intervals_overlap({ min: left.x, max: left.x + left.width }, { min: right.x, max: right.x + right.width }) && intervals_overlap({ min: left.y, max: left.y + left.height }, { min: right.y, max: right.y + right.height }) && intervals_overlap({ min: left.z, max: left.z + left.depth }, { min: right.z, max: right.z + right.depth });
|
|
24
|
-
}
|
|
25
|
-
function intervals_overlap(left, right) {
|
|
26
|
-
return lt(left.min, right.max) && lt(right.min, left.max);
|
|
27
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { StabilizerContainer } from '../validation/contract/stabilizer_domain_schema.js';
|
|
2
|
-
import type { StabilizerConfig } from '../validation/schemas/stabilizer_config_schema.js';
|
|
3
|
-
import type { WaypointMode } from '../waypoint/WaypointMode.js';
|
|
4
|
-
import type { MilkrunReservedBand } from '../waypoint/milkrun_wall_reservation_types.js';
|
|
5
|
-
/**
|
|
6
|
-
* Builds milkrun reserved bands when enforcement is enabled in config.
|
|
7
|
-
* @param baseline_containers - Baseline container layout.
|
|
8
|
-
* @param waypoint_mode - Resolved waypoint mode.
|
|
9
|
-
* @param config - Parsed stabilizer config.
|
|
10
|
-
* @returns Reserved Z bands (empty when milkrun enforcement is disabled).
|
|
11
|
-
*/
|
|
12
|
-
export declare function build_milkrun_bands_from_config(baseline_containers: StabilizerContainer[], waypoint_mode: WaypointMode, config: StabilizerConfig): MilkrunReservedBand[];
|
|
13
|
-
//# sourceMappingURL=build_milkrun_bands_from_config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build_milkrun_bands_from_config.d.ts","sourceRoot":"","sources":["../../../src/core/orchestration/build_milkrun_bands_from_config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAA;AAC7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAA;AACzF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAE/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAA;AAExF;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC3C,mBAAmB,EAAE,mBAAmB,EAAE,EAC1C,aAAa,EAAE,YAAY,EAC3B,MAAM,EAAE,gBAAgB,GACzB,mBAAmB,EAAE,CAMvB"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { build_milkrun_reserved_z_bands } from '../waypoint/milkrun_wall_reservation.js';
|
|
2
|
-
/**
|
|
3
|
-
* Builds milkrun reserved bands when enforcement is enabled in config.
|
|
4
|
-
* @param baseline_containers - Baseline container layout.
|
|
5
|
-
* @param waypoint_mode - Resolved waypoint mode.
|
|
6
|
-
* @param config - Parsed stabilizer config.
|
|
7
|
-
* @returns Reserved Z bands (empty when milkrun enforcement is disabled).
|
|
8
|
-
*/
|
|
9
|
-
export function build_milkrun_bands_from_config(baseline_containers, waypoint_mode, config) {
|
|
10
|
-
const wall_count = config.enforce_milkrun_wall_reservation
|
|
11
|
-
? config.number_of_wall_to_allocate_from_last_waypoints
|
|
12
|
-
: 0;
|
|
13
|
-
return build_milkrun_reserved_z_bands(baseline_containers, waypoint_mode, wall_count);
|
|
14
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { StabilizerInput } from '../validation/contract/stabilizer_input_schema.js';
|
|
2
|
-
import type { StabilizerEnv } from '../validation/contract/stabilizer_domain_schema.js';
|
|
3
|
-
/**
|
|
4
|
-
* Reads the primary env from stabilizer input.
|
|
5
|
-
* @param input - Validated stabilizer input.
|
|
6
|
-
* @returns First cargo env.
|
|
7
|
-
*/
|
|
8
|
-
export declare function read_primary_env(input: StabilizerInput): StabilizerEnv;
|
|
9
|
-
//# sourceMappingURL=read_primary_env.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"read_primary_env.d.ts","sourceRoot":"","sources":["../../../src/core/orchestration/read_primary_env.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAA;AACxF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oDAAoD,CAAA;AAGvF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,eAAe,GAAG,aAAa,CAQtE"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { InvalidStabilizerInputError } from '../exceptions/InvalidStabilizerInputError.js';
|
|
2
|
-
/**
|
|
3
|
-
* Reads the primary env from stabilizer input.
|
|
4
|
-
* @param input - Validated stabilizer input.
|
|
5
|
-
* @returns First cargo env.
|
|
6
|
-
*/
|
|
7
|
-
export function read_primary_env(input) {
|
|
8
|
-
const env = input.cargo_state.envs[0];
|
|
9
|
-
if (!env) {
|
|
10
|
-
throw new InvalidStabilizerInputError('cargo_state.envs must contain at least one env');
|
|
11
|
-
}
|
|
12
|
-
return env;
|
|
13
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { EvaluationResult } from '../../evaluation/evaluation_result.js';
|
|
2
|
-
import type { MoveCandidate } from '../../move/apply_move.js';
|
|
3
|
-
import type { BeamExpansionContext } from './beam_context.js';
|
|
4
|
-
/**
|
|
5
|
-
* Evaluates one candidate and keeps it when search admission allows.
|
|
6
|
-
* @param beam_context - Beam expansion context.
|
|
7
|
-
* @param parent_eval - Parent layout evaluation.
|
|
8
|
-
* @param candidate - Move candidate.
|
|
9
|
-
*/
|
|
10
|
-
export declare function append_admitted_trial(beam_context: BeamExpansionContext, parent_eval: EvaluationResult, candidate: MoveCandidate): void;
|
|
11
|
-
//# sourceMappingURL=append_admitted_trial.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"append_admitted_trial.d.ts","sourceRoot":"","sources":["../../../../src/core/strategies/reorder/append_admitted_trial.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AAC7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAE7D;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACjC,YAAY,EAAE,oBAAoB,EAClC,WAAW,EAAE,gBAAgB,EAC7B,SAAS,EAAE,aAAa,GACzB,IAAI,CAcN"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { apply_move, clone_containers } from '../../move/apply_move.js';
|
|
2
|
-
import { evaluate_trial_layout } from '../../evaluation/state_evaluator.js';
|
|
3
|
-
import { is_search_trial_admissible } from '../../evaluation/is_search_trial_admissible.js';
|
|
4
|
-
/**
|
|
5
|
-
* Evaluates one candidate and keeps it when search admission allows.
|
|
6
|
-
* @param beam_context - Beam expansion context.
|
|
7
|
-
* @param parent_eval - Parent layout evaluation.
|
|
8
|
-
* @param candidate - Move candidate.
|
|
9
|
-
*/
|
|
10
|
-
export function append_admitted_trial(beam_context, parent_eval, candidate) {
|
|
11
|
-
const trial = clone_containers(beam_context.state.containers);
|
|
12
|
-
apply_move(trial, candidate);
|
|
13
|
-
const result = evaluate_trial_layout(trial, beam_context.evaluation);
|
|
14
|
-
if (!is_search_trial_admissible(parent_eval, result)) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
beam_context.expanded.push({
|
|
18
|
-
containers: trial,
|
|
19
|
-
objective: result.objective,
|
|
20
|
-
axle_excess_kg: result.axle_excess_kg
|
|
21
|
-
});
|
|
22
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { EvaluationResult } from '../../evaluation/evaluation_result.js';
|
|
2
|
-
/**
|
|
3
|
-
* Returns true when a greedy trial improves the parent layout.
|
|
4
|
-
* Over parents climb on axle excess; legal parents require a better objective.
|
|
5
|
-
* @param parent_eval - Parent evaluation.
|
|
6
|
-
* @param trial_eval - Trial evaluation.
|
|
7
|
-
* @returns True when the trial should be applied.
|
|
8
|
-
*/
|
|
9
|
-
export declare function is_improving_greedy_trial(parent_eval: EvaluationResult, trial_eval: EvaluationResult): boolean;
|
|
10
|
-
//# sourceMappingURL=is_improving_greedy_trial.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is_improving_greedy_trial.d.ts","sourceRoot":"","sources":["../../../../src/core/strategies/reorder/is_improving_greedy_trial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AAG7E;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACrC,WAAW,EAAE,gBAAgB,EAC7B,UAAU,EAAE,gBAAgB,GAC7B,OAAO,CAWT"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { is_search_trial_admissible } from '../../evaluation/is_search_trial_admissible.js';
|
|
2
|
-
/**
|
|
3
|
-
* Returns true when a greedy trial improves the parent layout.
|
|
4
|
-
* Over parents climb on axle excess; legal parents require a better objective.
|
|
5
|
-
* @param parent_eval - Parent evaluation.
|
|
6
|
-
* @param trial_eval - Trial evaluation.
|
|
7
|
-
* @returns True when the trial should be applied.
|
|
8
|
-
*/
|
|
9
|
-
export function is_improving_greedy_trial(parent_eval, trial_eval) {
|
|
10
|
-
if (!is_search_trial_admissible(parent_eval, trial_eval)) {
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
if (!parent_eval.axle_valid) {
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
return trial_eval.objective > parent_eval.objective;
|
|
17
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { MoveCandidate } from '../../move/apply_move.js';
|
|
2
|
-
/**
|
|
3
|
-
* Selects beam expansions: ranked top_k plus every supporter-top slot.
|
|
4
|
-
* @param ranked - Candidates already ranked floor-first.
|
|
5
|
-
* @param top_k - Beam top-k from config.
|
|
6
|
-
* @returns Candidates for trial evaluation.
|
|
7
|
-
*/
|
|
8
|
-
export declare function select_beam_expansion_candidates(ranked: MoveCandidate[], top_k: number): MoveCandidate[];
|
|
9
|
-
//# sourceMappingURL=select_beam_expansion_candidates.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"select_beam_expansion_candidates.d.ts","sourceRoot":"","sources":["../../../../src/core/strategies/reorder/select_beam_expansion_candidates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE7D;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAC5C,MAAM,EAAE,aAAa,EAAE,EACvB,KAAK,EAAE,MAAM,GACd,aAAa,EAAE,CAKjB"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Selects beam expansions: ranked top_k plus every supporter-top slot.
|
|
3
|
-
* @param ranked - Candidates already ranked floor-first.
|
|
4
|
-
* @param top_k - Beam top-k from config.
|
|
5
|
-
* @returns Candidates for trial evaluation.
|
|
6
|
-
*/
|
|
7
|
-
export function select_beam_expansion_candidates(ranked, top_k) {
|
|
8
|
-
const leading = ranked.slice(0, top_k);
|
|
9
|
-
const supporter_top = ranked.filter(candidate => candidate.slot_kind === 'supporter_top');
|
|
10
|
-
return unique_move_positions([...leading, ...supporter_top]);
|
|
11
|
-
}
|
|
12
|
-
function unique_move_positions(candidates) {
|
|
13
|
-
const seen = new Set();
|
|
14
|
-
const unique = [];
|
|
15
|
-
for (const candidate of candidates) {
|
|
16
|
-
const key = position_key(candidate);
|
|
17
|
-
if (seen.has(key)) {
|
|
18
|
-
continue;
|
|
19
|
-
}
|
|
20
|
-
seen.add(key);
|
|
21
|
-
unique.push(candidate);
|
|
22
|
-
}
|
|
23
|
-
return unique;
|
|
24
|
-
}
|
|
25
|
-
function position_key(candidate) {
|
|
26
|
-
const position = candidate.new_position;
|
|
27
|
-
return `${position.x}:${position.y}:${position.z}:${candidate.target_container_index}`;
|
|
28
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { BeamState } from './beam_context.js';
|
|
2
|
-
/**
|
|
3
|
-
* Keeps ranked expansions, or the parent beam when every trial failed admission.
|
|
4
|
-
* Ranks by axle excess then stability objective.
|
|
5
|
-
* @param expanded - Trial states that passed search admission.
|
|
6
|
-
* @param parent_beam - Beam states before this item's expansion.
|
|
7
|
-
* @param beam_width - Maximum states to keep.
|
|
8
|
-
* @returns Next beam, never empty when the parent beam had states.
|
|
9
|
-
*/
|
|
10
|
-
export declare function select_surviving_beam(expanded: BeamState[], parent_beam: BeamState[], beam_width: number): BeamState[];
|
|
11
|
-
//# sourceMappingURL=select_surviving_beam.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"select_surviving_beam.d.ts","sourceRoot":"","sources":["../../../../src/core/strategies/reorder/select_surviving_beam.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAGlD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACjC,QAAQ,EAAE,SAAS,EAAE,EACrB,WAAW,EAAE,SAAS,EAAE,EACxB,UAAU,EAAE,MAAM,GACnB,SAAS,EAAE,CAIb"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { compare_search_states } from '../../evaluation/compare_search_states.js';
|
|
2
|
-
/**
|
|
3
|
-
* Keeps ranked expansions, or the parent beam when every trial failed admission.
|
|
4
|
-
* Ranks by axle excess then stability objective.
|
|
5
|
-
* @param expanded - Trial states that passed search admission.
|
|
6
|
-
* @param parent_beam - Beam states before this item's expansion.
|
|
7
|
-
* @param beam_width - Maximum states to keep.
|
|
8
|
-
* @returns Next beam, never empty when the parent beam had states.
|
|
9
|
-
*/
|
|
10
|
-
export function select_surviving_beam(expanded, parent_beam, beam_width) {
|
|
11
|
-
const ranked = [...parent_beam, ...expanded].sort(compare_search_states);
|
|
12
|
-
return ranked.slice(0, beam_width);
|
|
13
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
export declare const ITEM_WIRE_TO_CONTRACT: {
|
|
2
|
-
readonly _id: "item_id";
|
|
3
|
-
readonly groupId: "group_id";
|
|
4
|
-
readonly w: "width";
|
|
5
|
-
readonly h: "height";
|
|
6
|
-
readonly d: "depth";
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Cargo-movement wire keys feeding each contract item field, in precedence
|
|
10
|
-
* order. Only modelled stabilizer and dependency fields are read.
|
|
11
|
-
*/
|
|
12
|
-
export declare const ITEM_CONTRACT_WIRE_KEYS: Readonly<{
|
|
13
|
-
item_id: string[];
|
|
14
|
-
group_id: string[];
|
|
15
|
-
waypoint_id: string[];
|
|
16
|
-
width: string[];
|
|
17
|
-
height: string[];
|
|
18
|
-
depth: string[];
|
|
19
|
-
weight: string[];
|
|
20
|
-
tie_ratio_orientation: string[];
|
|
21
|
-
family: string[];
|
|
22
|
-
supported_families: string[];
|
|
23
|
-
constraint: string[];
|
|
24
|
-
stack_families: string[];
|
|
25
|
-
stack_same_item: string[];
|
|
26
|
-
stack_same_area: string[];
|
|
27
|
-
stacking_unit: string[];
|
|
28
|
-
supported_weight: string[];
|
|
29
|
-
priority: string[];
|
|
30
|
-
}>;
|
|
31
|
-
/** Item fields the stabilizer mutates, and therefore must emit itself. */
|
|
32
|
-
export declare const ITEM_POSITION_KEYS: string[];
|
|
33
|
-
export declare const CONTAINER_WIRE_TO_CONTRACT: {
|
|
34
|
-
readonly sequencia: "sequence";
|
|
35
|
-
readonly largura: "width";
|
|
36
|
-
readonly altura: "height";
|
|
37
|
-
readonly comprimento: "length";
|
|
38
|
-
readonly distPinoRei: "kingpin_distance";
|
|
39
|
-
readonly containerDistanceAhead: "container_distance_ahead";
|
|
40
|
-
readonly pesoMaxSuportado: "max_supported_weight";
|
|
41
|
-
readonly tara: "tare";
|
|
42
|
-
readonly pesoDeCarga: "cargo_weight";
|
|
43
|
-
readonly grouper: "grouper";
|
|
44
|
-
};
|
|
45
|
-
export declare const VEHICLE_WIRE_TO_CONTRACT: {
|
|
46
|
-
readonly _id: "vehicle_id";
|
|
47
|
-
readonly tipoVeiculo: "vehicle_type";
|
|
48
|
-
readonly tipoVersao: "version_type";
|
|
49
|
-
readonly tipoSuspensao: "suspension_type";
|
|
50
|
-
readonly primeiroEixo: "first_axle";
|
|
51
|
-
readonly tara: "tare";
|
|
52
|
-
readonly pesoMaxSuportado: "max_supported_weight";
|
|
53
|
-
readonly qtd: "quantity";
|
|
54
|
-
};
|
|
55
|
-
export declare const AXLE_WIRE_TO_CONTRACT: {
|
|
56
|
-
readonly distanciaOrigem: "distance_from_origin";
|
|
57
|
-
readonly pesoMaxSuportado: "max_supported_weight";
|
|
58
|
-
readonly pesoDnit: "dnit_weight";
|
|
59
|
-
readonly tara: "tare";
|
|
60
|
-
readonly sequenciaContainer: "container_sequence";
|
|
61
|
-
readonly sequence: "sequence";
|
|
62
|
-
};
|
|
63
|
-
export declare const ENV_WIRE_TO_CONTRACT: {
|
|
64
|
-
readonly eixos: "axles";
|
|
65
|
-
};
|
|
66
|
-
export declare const CONTRACT_TO_ITEM_WIRE: Record<string, string>;
|
|
67
|
-
export declare const CONTRACT_TO_CONTAINER_WIRE: Record<string, string>;
|
|
68
|
-
export declare const CONTRACT_TO_ENV_WIRE: Record<string, string>;
|
|
69
|
-
export declare const CONTRACT_TO_VEHICLE_WIRE: Record<string, string>;
|
|
70
|
-
export declare const CONTRACT_TO_AXLE_WIRE: Record<string, string>;
|
|
71
|
-
//# sourceMappingURL=cargo_movement_wire_field_map.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cargo_movement_wire_field_map.d.ts","sourceRoot":"","sources":["../../../../src/core/validation/contract/cargo_movement_wire_field_map.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB;;;;;;CAMxB,CAAA;AAEV;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;EAkBlC,CAAA;AAEF,0EAA0E;AAC1E,eAAO,MAAM,kBAAkB,UAAkB,CAAA;AAEjD,eAAO,MAAM,0BAA0B;;;;;;;;;;;CAW7B,CAAA;AAEV,eAAO,MAAM,wBAAwB;;;;;;;;;CAS3B,CAAA;AAEV,eAAO,MAAM,qBAAqB;;;;;;;CAOxB,CAAA;AAEV,eAAO,MAAM,oBAAoB;;CAEvB,CAAA;AAEV,eAAO,MAAM,qBAAqB,wBAAoC,CAAA;AACtE,eAAO,MAAM,0BAA0B,wBAAyC,CAAA;AAChF,eAAO,MAAM,oBAAoB,wBAAmC,CAAA;AACpE,eAAO,MAAM,wBAAwB,wBAAuC,CAAA;AAC5E,eAAO,MAAM,qBAAqB,wBAAoC,CAAA"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
export const ITEM_WIRE_TO_CONTRACT = {
|
|
2
|
-
_id: 'item_id',
|
|
3
|
-
groupId: 'group_id',
|
|
4
|
-
w: 'width',
|
|
5
|
-
h: 'height',
|
|
6
|
-
d: 'depth'
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Cargo-movement wire keys feeding each contract item field, in precedence
|
|
10
|
-
* order. Only modelled stabilizer and dependency fields are read.
|
|
11
|
-
*/
|
|
12
|
-
export const ITEM_CONTRACT_WIRE_KEYS = Object.freeze({
|
|
13
|
-
item_id: ['_id', 'item_id'],
|
|
14
|
-
group_id: ['groupId', 'group_id'],
|
|
15
|
-
waypoint_id: ['waypoint_id'],
|
|
16
|
-
width: ['w', 'width'],
|
|
17
|
-
height: ['h', 'height'],
|
|
18
|
-
depth: ['d', 'depth'],
|
|
19
|
-
weight: ['wg', 'peso', 'weight'],
|
|
20
|
-
tie_ratio_orientation: ['tie_ratio_orientation'],
|
|
21
|
-
family: ['family'],
|
|
22
|
-
supported_families: ['supported_families'],
|
|
23
|
-
constraint: ['constraint'],
|
|
24
|
-
stack_families: ['stack_families'],
|
|
25
|
-
stack_same_item: ['stack_same_item'],
|
|
26
|
-
stack_same_area: ['stack_same_area'],
|
|
27
|
-
stacking_unit: ['stacking_unit', 'stackingUnit'],
|
|
28
|
-
supported_weight: ['supported_weight', 'pesoMaxSuportado'],
|
|
29
|
-
priority: ['priority']
|
|
30
|
-
});
|
|
31
|
-
/** Item fields the stabilizer mutates, and therefore must emit itself. */
|
|
32
|
-
export const ITEM_POSITION_KEYS = ['x', 'y', 'z'];
|
|
33
|
-
export const CONTAINER_WIRE_TO_CONTRACT = {
|
|
34
|
-
sequencia: 'sequence',
|
|
35
|
-
largura: 'width',
|
|
36
|
-
altura: 'height',
|
|
37
|
-
comprimento: 'length',
|
|
38
|
-
distPinoRei: 'kingpin_distance',
|
|
39
|
-
containerDistanceAhead: 'container_distance_ahead',
|
|
40
|
-
pesoMaxSuportado: 'max_supported_weight',
|
|
41
|
-
tara: 'tare',
|
|
42
|
-
pesoDeCarga: 'cargo_weight',
|
|
43
|
-
grouper: 'grouper'
|
|
44
|
-
};
|
|
45
|
-
export const VEHICLE_WIRE_TO_CONTRACT = {
|
|
46
|
-
_id: 'vehicle_id',
|
|
47
|
-
tipoVeiculo: 'vehicle_type',
|
|
48
|
-
tipoVersao: 'version_type',
|
|
49
|
-
tipoSuspensao: 'suspension_type',
|
|
50
|
-
primeiroEixo: 'first_axle',
|
|
51
|
-
tara: 'tare',
|
|
52
|
-
pesoMaxSuportado: 'max_supported_weight',
|
|
53
|
-
qtd: 'quantity'
|
|
54
|
-
};
|
|
55
|
-
export const AXLE_WIRE_TO_CONTRACT = {
|
|
56
|
-
distanciaOrigem: 'distance_from_origin',
|
|
57
|
-
pesoMaxSuportado: 'max_supported_weight',
|
|
58
|
-
pesoDnit: 'dnit_weight',
|
|
59
|
-
tara: 'tare',
|
|
60
|
-
sequenciaContainer: 'container_sequence',
|
|
61
|
-
sequence: 'sequence'
|
|
62
|
-
};
|
|
63
|
-
export const ENV_WIRE_TO_CONTRACT = {
|
|
64
|
-
eixos: 'axles'
|
|
65
|
-
};
|
|
66
|
-
export const CONTRACT_TO_ITEM_WIRE = invert_map(ITEM_WIRE_TO_CONTRACT);
|
|
67
|
-
export const CONTRACT_TO_CONTAINER_WIRE = invert_map(CONTAINER_WIRE_TO_CONTRACT);
|
|
68
|
-
export const CONTRACT_TO_ENV_WIRE = invert_map(ENV_WIRE_TO_CONTRACT);
|
|
69
|
-
export const CONTRACT_TO_VEHICLE_WIRE = invert_map(VEHICLE_WIRE_TO_CONTRACT);
|
|
70
|
-
export const CONTRACT_TO_AXLE_WIRE = invert_map(AXLE_WIRE_TO_CONTRACT);
|
|
71
|
-
function invert_map(source) {
|
|
72
|
-
const inverted = {};
|
|
73
|
-
for (const [wire_key, contract_key] of Object.entries(source)) {
|
|
74
|
-
inverted[contract_key] = wire_key;
|
|
75
|
-
}
|
|
76
|
-
return inverted;
|
|
77
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { StabilizerCargoState } from './stabilizer_domain_schema.js';
|
|
2
|
-
/**
|
|
3
|
-
* Maps a cargo-movement wire payload to the English contract shape.
|
|
4
|
-
* @param input_data - Unknown CM wire payload.
|
|
5
|
-
* @returns Object ready for strict contract parsing.
|
|
6
|
-
*/
|
|
7
|
-
export declare function map_wire_input_to_contract(input_data: unknown): unknown;
|
|
8
|
-
/**
|
|
9
|
-
* Maps an English contract cargo state back to cargo-movement wire shape.
|
|
10
|
-
* @param cargo_state - English contract cargo state.
|
|
11
|
-
* @returns CM wire cargo state.
|
|
12
|
-
*/
|
|
13
|
-
export declare function map_contract_to_wire_output(cargo_state: StabilizerCargoState): unknown;
|
|
14
|
-
//# sourceMappingURL=cargo_movement_wire_mapper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cargo_movement_wire_mapper.d.ts","sourceRoot":"","sources":["../../../../src/core/validation/contract/cargo_movement_wire_mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAA;AAQzE;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,OAAO,GAAG,OAAO,CAcvE;AAqBD;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,oBAAoB,GAAG,OAAO,CAGtF"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { map_cargo_state_to_wire } from './map_contract_to_wire_shape.js';
|
|
2
|
-
import { map_cargo_state_to_contract } from './map_wire_input_to_contract_shape.js';
|
|
3
|
-
import { map_envelope_config } from './map_input_config.js';
|
|
4
|
-
import { is_record } from './wire_mapper_record_utils.js';
|
|
5
|
-
const INPUT_ENVELOPE_KEYS = new Set(['id', 'company', 'cargo_state', 'config']);
|
|
6
|
-
/**
|
|
7
|
-
* Maps a cargo-movement wire payload to the English contract shape.
|
|
8
|
-
* @param input_data - Unknown CM wire payload.
|
|
9
|
-
* @returns Object ready for strict contract parsing.
|
|
10
|
-
*/
|
|
11
|
-
export function map_wire_input_to_contract(input_data) {
|
|
12
|
-
if (!is_record(input_data)) {
|
|
13
|
-
return input_data;
|
|
14
|
-
}
|
|
15
|
-
const mapped = map_envelope_fields(input_data);
|
|
16
|
-
const mapped_config = map_envelope_config(input_data.config, input_data.cargo_state);
|
|
17
|
-
if (mapped_config !== undefined) {
|
|
18
|
-
mapped.config = mapped_config;
|
|
19
|
-
}
|
|
20
|
-
return mapped;
|
|
21
|
-
}
|
|
22
|
-
function map_envelope_fields(input_data) {
|
|
23
|
-
const mapped = {};
|
|
24
|
-
for (const [key, value] of Object.entries(input_data)) {
|
|
25
|
-
if (!INPUT_ENVELOPE_KEYS.has(key)) {
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
if (key === 'cargo_state') {
|
|
29
|
-
mapped.cargo_state = map_cargo_state_to_contract(value);
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
mapped[key] = value;
|
|
33
|
-
}
|
|
34
|
-
return mapped;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Maps an English contract cargo state back to cargo-movement wire shape.
|
|
38
|
-
* @param cargo_state - English contract cargo state.
|
|
39
|
-
* @returns CM wire cargo state.
|
|
40
|
-
*/
|
|
41
|
-
export function map_contract_to_wire_output(cargo_state) {
|
|
42
|
-
return map_cargo_state_to_wire(cargo_state);
|
|
43
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ZodError } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Formats Zod validation issues into a single human-readable string.
|
|
4
|
-
* @param error - Zod validation error.
|
|
5
|
-
* @returns Semicolon-separated path messages.
|
|
6
|
-
*/
|
|
7
|
-
export declare function format_zod_error(error: ZodError): string;
|
|
8
|
-
//# sourceMappingURL=format_zod_error.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format_zod_error.d.ts","sourceRoot":"","sources":["../../../../src/core/validation/contract/format_zod_error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAEnC;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAOxD"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Formats Zod validation issues into a single human-readable string.
|
|
3
|
-
* @param error - Zod validation error.
|
|
4
|
-
* @returns Semicolon-separated path messages.
|
|
5
|
-
*/
|
|
6
|
-
export function format_zod_error(error) {
|
|
7
|
-
return error.issues.map(issue => {
|
|
8
|
-
const path = issue.path.length > 0 ? issue.path.join('.') : '(root)';
|
|
9
|
-
return `${path}: ${issue.message}`;
|
|
10
|
-
}).join('; ');
|
|
11
|
-
}
|