@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.
- package/CHANGELOG.md +2 -16
- package/README.md +12 -18
- package/build/core/adapters/axle_adapter.d.ts +0 -1
- package/build/core/adapters/axle_adapter.d.ts.map +1 -1
- package/build/core/adapters/axle_adapter.js +22 -3
- package/build/core/adapters/coordinate_mapper.d.ts +1 -1
- package/build/core/adapters/coordinate_mapper.js +3 -3
- package/build/core/candidates/candidate_generator.d.ts +1 -1
- package/build/core/candidates/candidate_generator.js +7 -21
- package/build/core/candidates/candidate_validation.d.ts.map +1 -1
- package/build/core/candidates/candidate_validation.js +0 -8
- package/build/core/evaluation/state_evaluator.d.ts +10 -2
- package/build/core/evaluation/state_evaluator.d.ts.map +1 -1
- package/build/core/evaluation/state_evaluator.js +26 -7
- package/build/core/factory/read_stabilizer_config.d.ts +2 -3
- package/build/core/factory/read_stabilizer_config.d.ts.map +1 -1
- package/build/core/factory/read_stabilizer_config_helpers.d.ts +5 -9
- package/build/core/factory/read_stabilizer_config_helpers.d.ts.map +1 -1
- package/build/core/factory/read_stabilizer_config_helpers.js +1 -12
- package/build/core/move/apply_move.d.ts +0 -2
- package/build/core/move/apply_move.d.ts.map +1 -1
- 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.map +1 -1
- package/build/core/orchestration/build_reorder_context.js +5 -3
- package/build/core/strategies/reorder/BeamSearchReorder.d.ts.map +1 -1
- package/build/core/strategies/reorder/BeamSearchReorder.js +13 -12
- 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/SimulatedAnnealingReorder.d.ts.map +1 -1
- package/build/core/strategies/reorder/SimulatedAnnealingReorder.js +5 -14
- package/build/core/strategies/reorder/beam_context.d.ts +0 -1
- package/build/core/strategies/reorder/beam_context.d.ts.map +1 -1
- package/build/core/strategies/reorder/greedy_improvement.d.ts.map +1 -1
- package/build/core/strategies/reorder/greedy_improvement.js +2 -3
- package/build/core/validation/contract/cargo_movement_wire_field_map.d.ts +1 -51
- package/build/core/validation/contract/cargo_movement_wire_field_map.d.ts.map +1 -1
- package/build/core/validation/contract/cargo_movement_wire_field_map.js +3 -53
- package/build/core/validation/contract/cargo_movement_wire_mapper.d.ts.map +1 -1
- package/build/core/validation/contract/cargo_movement_wire_mapper.js +1 -10
- package/build/core/validation/contract/map_contract_to_wire_shape.d.ts.map +1 -1
- package/build/core/validation/contract/map_contract_to_wire_shape.js +13 -18
- package/build/core/validation/contract/map_wire_input_to_contract_shape.d.ts.map +1 -1
- package/build/core/validation/contract/map_wire_input_to_contract_shape.js +22 -26
- package/build/core/validation/contract/parse_stabilizer_input.d.ts +4 -49
- package/build/core/validation/contract/parse_stabilizer_input.d.ts.map +1 -1
- package/build/core/validation/contract/parse_stabilizer_input.js +0 -2
- package/build/core/validation/contract/parse_stabilizer_output.d.ts +2 -34
- package/build/core/validation/contract/parse_stabilizer_output.d.ts.map +1 -1
- package/build/core/validation/contract/stabilizer_domain_schema.d.ts +56 -36
- package/build/core/validation/contract/stabilizer_domain_schema.d.ts.map +1 -1
- package/build/core/validation/contract/stabilizer_domain_schema.js +35 -16
- package/build/core/validation/contract/stabilizer_input_schema.d.ts +4 -51
- package/build/core/validation/contract/stabilizer_input_schema.d.ts.map +1 -1
- package/build/core/validation/contract/stabilizer_input_schema.js +2 -2
- package/build/core/validation/contract/stabilizer_output_schema.d.ts +4 -68
- package/build/core/validation/contract/stabilizer_output_schema.d.ts.map +1 -1
- package/build/core/validation/contract/wire_mapper_record_utils.d.ts +0 -14
- package/build/core/validation/contract/wire_mapper_record_utils.d.ts.map +1 -1
- package/build/core/validation/contract/wire_mapper_record_utils.js +0 -30
- package/build/core/validation/schemas/stabilizer_config_schema.d.ts +1 -2
- package/build/core/validation/schemas/stabilizer_config_schema.d.ts.map +1 -1
- package/build/core/validation/schemas/stabilizer_config_schema.js +1 -2
- package/build/index.d.ts +12 -11
- package/build/index.d.ts.map +1 -1
- package/build/index.js +21 -29
- 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/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_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_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/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/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/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_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/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_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_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/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
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { StabilityEvaluation } from '../adapters/stability_adapter.js';
|
|
2
|
-
/**
|
|
3
|
-
* Outcome of evaluating a layout against stabilizer gates.
|
|
4
|
-
*/
|
|
5
|
-
export interface EvaluationResult {
|
|
6
|
-
stability: StabilityEvaluation;
|
|
7
|
-
objective: number;
|
|
8
|
-
transport_floor_valid: boolean;
|
|
9
|
-
axle_valid: boolean;
|
|
10
|
-
waypoint_valid: boolean;
|
|
11
|
-
milkrun_valid: boolean;
|
|
12
|
-
all_gates_pass: boolean;
|
|
13
|
-
axle_excess_kg: number;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=evaluation_result.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"evaluation_result.d.ts","sourceRoot":"","sources":["../../../src/core/evaluation/evaluation_result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AAE3E;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAE7B,SAAS,EAAE,mBAAmB,CAAA;IAC9B,SAAS,EAAE,MAAM,CAAA;IACjB,qBAAqB,EAAE,OAAO,CAAA;IAC9B,UAAU,EAAE,OAAO,CAAA;IACnB,cAAc,EAAE,OAAO,CAAA;IACvB,aAAa,EAAE,OAAO,CAAA;IACtB,cAAc,EAAE,OAAO,CAAA;IACvB,cAAc,EAAE,MAAM,CAAA;CACzB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { EvaluationResult } from './evaluation_result.js';
|
|
2
|
-
export declare const LEGAL_FITNESS_OFFSET = 1000000;
|
|
3
|
-
/**
|
|
4
|
-
* Scores a genetic organism: legal layouts outrank every illegal one.
|
|
5
|
-
* @param evaluation - Layout evaluation.
|
|
6
|
-
* @returns Fitness; higher is better.
|
|
7
|
-
*/
|
|
8
|
-
export declare function genetic_fitness(evaluation: EvaluationResult): number;
|
|
9
|
-
//# sourceMappingURL=genetic_fitness.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"genetic_fitness.d.ts","sourceRoot":"","sources":["../../../src/core/evaluation/genetic_fitness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAG9D,eAAO,MAAM,oBAAoB,UAAY,CAAA;AAE7C;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,gBAAgB,GAAG,MAAM,CAWpE"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { is_non_axle_gates_pass } from './is_non_axle_gates_pass.js';
|
|
2
|
-
export const LEGAL_FITNESS_OFFSET = 1_000_000;
|
|
3
|
-
/**
|
|
4
|
-
* Scores a genetic organism: legal layouts outrank every illegal one.
|
|
5
|
-
* @param evaluation - Layout evaluation.
|
|
6
|
-
* @returns Fitness; higher is better.
|
|
7
|
-
*/
|
|
8
|
-
export function genetic_fitness(evaluation) {
|
|
9
|
-
if (!is_non_axle_gates_pass(evaluation)) {
|
|
10
|
-
return Number.NEGATIVE_INFINITY;
|
|
11
|
-
}
|
|
12
|
-
if (evaluation.axle_valid) {
|
|
13
|
-
return LEGAL_FITNESS_OFFSET + evaluation.objective;
|
|
14
|
-
}
|
|
15
|
-
return -evaluation.axle_excess_kg;
|
|
16
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { EvaluationResult } from './evaluation_result.js';
|
|
2
|
-
/**
|
|
3
|
-
* Returns true when waypoint, milkrun, and transport-floor gates pass.
|
|
4
|
-
* @param result - Evaluation result.
|
|
5
|
-
* @returns True when non-axle gates all pass.
|
|
6
|
-
*/
|
|
7
|
-
export declare function is_non_axle_gates_pass(result: EvaluationResult): boolean;
|
|
8
|
-
//# sourceMappingURL=is_non_axle_gates_pass.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is_non_axle_gates_pass.d.ts","sourceRoot":"","sources":["../../../src/core/evaluation/is_non_axle_gates_pass.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE9D;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAGxE"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns true when waypoint, milkrun, and transport-floor gates pass.
|
|
3
|
-
* @param result - Evaluation result.
|
|
4
|
-
* @returns True when non-axle gates all pass.
|
|
5
|
-
*/
|
|
6
|
-
export function is_non_axle_gates_pass(result) {
|
|
7
|
-
return result.transport_floor_valid && result.waypoint_valid && result.milkrun_valid;
|
|
8
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { EvaluationResult } from './evaluation_result.js';
|
|
2
|
-
/**
|
|
3
|
-
* Decides whether a one-item trial may enter the search.
|
|
4
|
-
* Over parents may climb with strictly less axle excess; legal parents keep a hard axle gate.
|
|
5
|
-
* @param parent - Parent layout evaluation.
|
|
6
|
-
* @param child - Trial layout evaluation.
|
|
7
|
-
* @returns True when the trial is admissible.
|
|
8
|
-
*/
|
|
9
|
-
export declare function is_search_trial_admissible(parent: EvaluationResult, child: EvaluationResult): boolean;
|
|
10
|
-
//# sourceMappingURL=is_search_trial_admissible.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is_search_trial_admissible.d.ts","sourceRoot":"","sources":["../../../src/core/evaluation/is_search_trial_admissible.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAG9D;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACtC,MAAM,EAAE,gBAAgB,EACxB,KAAK,EAAE,gBAAgB,GACxB,OAAO,CAWT"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { is_non_axle_gates_pass } from './is_non_axle_gates_pass.js';
|
|
2
|
-
/**
|
|
3
|
-
* Decides whether a one-item trial may enter the search.
|
|
4
|
-
* Over parents may climb with strictly less axle excess; legal parents keep a hard axle gate.
|
|
5
|
-
* @param parent - Parent layout evaluation.
|
|
6
|
-
* @param child - Trial layout evaluation.
|
|
7
|
-
* @returns True when the trial is admissible.
|
|
8
|
-
*/
|
|
9
|
-
export function is_search_trial_admissible(parent, child) {
|
|
10
|
-
if (!is_non_axle_gates_pass(child)) {
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
if (parent.axle_valid) {
|
|
14
|
-
return child.axle_valid;
|
|
15
|
-
}
|
|
16
|
-
return child.axle_excess_kg < parent.axle_excess_kg;
|
|
17
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { StabilizerContainer } from '../validation/contract/stabilizer_domain_schema.js';
|
|
2
|
-
import type { StateEvaluationContext } from './evaluation_context.js';
|
|
3
|
-
/**
|
|
4
|
-
* Returns true when waypoint order is satisfied for the layout.
|
|
5
|
-
* @param containers - Container layout.
|
|
6
|
-
* @param context - Evaluation context.
|
|
7
|
-
* @returns True when waypoint mode is single or order is preserved.
|
|
8
|
-
*/
|
|
9
|
-
export declare function is_waypoint_order_valid(containers: StabilizerContainer[], context: StateEvaluationContext): boolean;
|
|
10
|
-
//# sourceMappingURL=is_waypoint_order_valid.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is_waypoint_order_valid.d.ts","sourceRoot":"","sources":["../../../src/core/evaluation/is_waypoint_order_valid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAA;AAC7F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAGrE;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACnC,UAAU,EAAE,mBAAmB,EAAE,EACjC,OAAO,EAAE,sBAAsB,GAChC,OAAO,CAeT"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { preserves_waypoint_order } from '../waypoint/preserves_waypoint_order.js';
|
|
2
|
-
/**
|
|
3
|
-
* Returns true when waypoint order is satisfied for the layout.
|
|
4
|
-
* @param containers - Container layout.
|
|
5
|
-
* @param context - Evaluation context.
|
|
6
|
-
* @returns True when waypoint mode is single or order is preserved.
|
|
7
|
-
*/
|
|
8
|
-
export function is_waypoint_order_valid(containers, context) {
|
|
9
|
-
if (context.waypoint_mode.kind === 'SINGLE_WAYPOINT' ||
|
|
10
|
-
!context.config.preserve_tie_block_organization) {
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
return preserves_waypoint_order(context.baseline_containers, containers, context.waypoint_mode);
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AxleCalculationError.d.ts","sourceRoot":"","sources":["../../../src/core/exceptions/AxleCalculationError.ts"],"names":[],"mappings":"AAAA,qBAAa,oBAAqB,SAAQ,KAAK;gBAE/B,MAAM,EAAE,MAAM;CAK7B"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { StabilizerItem } from '../validation/contract/stabilizer_domain_schema.js';
|
|
2
|
-
import type { LooseItemRef } from './loose_item_filter.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 declare function collect_movable_items(containers: {
|
|
10
|
-
items: StabilizerItem[];
|
|
11
|
-
}[], pin_tie_ratio_blocks: boolean): LooseItemRef[];
|
|
12
|
-
/**
|
|
13
|
-
* @param item - Item record.
|
|
14
|
-
* @param pinned_group_ids - Floor five-slot 3_2/2_3 group ids.
|
|
15
|
-
* @returns True when the item is a floor member of a pinned wall.
|
|
16
|
-
*/
|
|
17
|
-
export declare function is_tie_ratio_block_item(item: StabilizerItem, pinned_group_ids: Set<string>): boolean;
|
|
18
|
-
//# sourceMappingURL=collect_movable_items.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"collect_movable_items.d.ts","sourceRoot":"","sources":["../../../src/core/filters/collect_movable_items.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oDAAoD,CAAA;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAI1D;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACjC,UAAU,EAAE;IAAE,KAAK,EAAE,cAAc,EAAE,CAAA;CAAE,EAAE,EACzC,oBAAoB,EAAE,OAAO,GAC9B,YAAY,EAAE,CAMhB;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACnC,IAAI,EAAE,cAAc,EACpB,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,GAC9B,OAAO,CAOT"}
|
|
@@ -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,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,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Maps envelope plus cargo-profile algoritmo maps onto English stabilizer config.
|
|
3
|
-
* English config objects are returned unchanged for strict Zod checking.
|
|
4
|
-
* @param envelope_config - Envelope config from wire or English input.
|
|
5
|
-
* @param wire_cargo_state - Wire cargo state that may hold profile algoritmo.
|
|
6
|
-
* @returns Raw English config, or the original English object.
|
|
7
|
-
*/
|
|
8
|
-
export declare function map_envelope_config(envelope_config: unknown, wire_cargo_state: unknown): unknown;
|
|
9
|
-
//# sourceMappingURL=map_input_config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"map_input_config.d.ts","sourceRoot":"","sources":["../../../../src/core/validation/contract/map_input_config.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,OAAO,EAAE,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAgBhG"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { is_record } from './wire_mapper_record_utils.js';
|
|
2
|
-
import { merge_algoritmo_maps, read_raw_stabilizer_config } from '../../factory/read_stabilizer_config_helpers.js';
|
|
3
|
-
const ALGORITMO_PREFIX = 'cargo_stabilizer.';
|
|
4
|
-
/**
|
|
5
|
-
* Maps envelope plus cargo-profile algoritmo maps onto English stabilizer config.
|
|
6
|
-
* English config objects are returned unchanged for strict Zod checking.
|
|
7
|
-
* @param envelope_config - Envelope config from wire or English input.
|
|
8
|
-
* @param wire_cargo_state - Wire cargo state that may hold profile algoritmo.
|
|
9
|
-
* @returns Raw English config, or the original English object.
|
|
10
|
-
*/
|
|
11
|
-
export function map_envelope_config(envelope_config, wire_cargo_state) {
|
|
12
|
-
if (envelope_config === undefined && !has_profile_algoritmo(wire_cargo_state)) {
|
|
13
|
-
return undefined;
|
|
14
|
-
}
|
|
15
|
-
if (is_algoritmo_shaped(envelope_config) || has_profile_algoritmo(wire_cargo_state)) {
|
|
16
|
-
return read_raw_stabilizer_config(merge_algoritmo_maps(as_record(envelope_config), { config: read_wire_profile_config(wire_cargo_state) }));
|
|
17
|
-
}
|
|
18
|
-
return envelope_config;
|
|
19
|
-
}
|
|
20
|
-
function is_algoritmo_shaped(config) {
|
|
21
|
-
if (!is_record(config)) {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
if (is_record(config.algoritmo)) {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
return Object.keys(config).some(key => key.startsWith(ALGORITMO_PREFIX));
|
|
28
|
-
}
|
|
29
|
-
function has_profile_algoritmo(wire_cargo_state) {
|
|
30
|
-
return is_record(read_wire_profile_config(wire_cargo_state)?.algoritmo);
|
|
31
|
-
}
|
|
32
|
-
function read_wire_profile_config(wire_cargo_state) {
|
|
33
|
-
if (!is_record(wire_cargo_state) || !is_record(wire_cargo_state.config)) {
|
|
34
|
-
return undefined;
|
|
35
|
-
}
|
|
36
|
-
return wire_cargo_state.config;
|
|
37
|
-
}
|
|
38
|
-
function as_record(value) {
|
|
39
|
-
return is_record(value) ? value : undefined;
|
|
40
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Lifts nested CM stacking and restriction fields onto the contract item.
|
|
3
|
-
* @param contract - Contract item being filled.
|
|
4
|
-
* @param source - Wire or English item record.
|
|
5
|
-
*/
|
|
6
|
-
export declare function assign_stacking_fields(contract: Record<string, unknown>, source: Record<string, unknown>): void;
|
|
7
|
-
//# sourceMappingURL=map_wire_item_stacking.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"map_wire_item_stacking.d.ts","sourceRoot":"","sources":["../../../../src/core/validation/contract/map_wire_item_stacking.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,sBAAsB,CAClC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,IAAI,CAYN"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { is_record } from './wire_mapper_record_utils.js';
|
|
2
|
-
/**
|
|
3
|
-
* Lifts nested CM stacking and restriction fields onto the contract item.
|
|
4
|
-
* @param contract - Contract item being filled.
|
|
5
|
-
* @param source - Wire or English item record.
|
|
6
|
-
*/
|
|
7
|
-
export function assign_stacking_fields(contract, source) {
|
|
8
|
-
assign_nested_stacking(contract, source.stacking);
|
|
9
|
-
assign_restriction_flags(contract, source.restrictions ?? source.restricoes);
|
|
10
|
-
if (typeof source.pesoMaxSuportado === 'number' && contract.supported_weight === undefined) {
|
|
11
|
-
contract.supported_weight = source.pesoMaxSuportado;
|
|
12
|
-
}
|
|
13
|
-
if (typeof source.stackingUnit === 'string' && contract.stacking_unit === undefined) {
|
|
14
|
-
contract.stacking_unit = source.stackingUnit;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
function assign_nested_stacking(contract, stacking) {
|
|
18
|
-
if (!is_record(stacking)) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
if (typeof stacking.family === 'string' && contract.family === undefined) {
|
|
22
|
-
contract.family = stacking.family;
|
|
23
|
-
}
|
|
24
|
-
if (Array.isArray(stacking.supported_families) && contract.supported_families === undefined) {
|
|
25
|
-
contract.supported_families = stacking.supported_families;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function assign_restriction_flags(contract, restrictions) {
|
|
29
|
-
if (!is_record(restrictions)) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
assign_boolean_if_absent(contract, 'stack_families', restrictions.empilharFamilias);
|
|
33
|
-
assign_boolean_if_absent(contract, 'stack_same_item', restrictions.empilharItemIgual);
|
|
34
|
-
assign_boolean_if_absent(contract, 'stack_same_area', restrictions.empilharAreaIgual);
|
|
35
|
-
}
|
|
36
|
-
function assign_boolean_if_absent(contract, key, value) {
|
|
37
|
-
if (typeof value === 'boolean' && contract[key] === undefined) {
|
|
38
|
-
contract[key] = value;
|
|
39
|
-
}
|
|
40
|
-
}
|