- optim/search_space.py: Genome encodes only indices into the real component database plus continuous/discrete geometry parameters; number of stages is itself mutable via add/remove/duplicate-stage operators. repair() clips everything back into bounds after mutation/crossover so decode() never sees an invalid genome. - optim/objective.py: evaluate() decodes a genome, computes real BOM cost from wire length/price and component prices, runs the full chain, and scores fitness = efficiency for feasible runs or a soft penalty scaled by how many stages it got through for infeasible ones (so the GA gets gradient instead of a wall). Tested against the real component database (not synthetic fixtures) — including an explicit infeasible case using the real inductive sensor's actual sensitivity/threshold values. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2.3 KiB
2.3 KiB