Skip to content

优化三位一体循环缺料诊断 - #466

Merged
QiuYe-QAQ merged 1 commit into
1.21from
qy/trinity-cycle-planning-bounds
Nov 24, 2026
Merged

QiuYe-QAQ merged 1 commit into
1.21from
qy/trinity-cycle-planning-bounds

Conversation

@QiuYe-QAQ

@QiuYe-QAQ QiuYe-QAQ commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

目的

在整合包里下单 1 件「宇宙本源拓扑晶格」时,Trinity 需要规划一个包含 61 种材料、62 个样板变体的循环分量。库存无法满足需求时,精确整数求解会反复扩大变量范围,最终触发 10 万变量上限,部分材料因此显示为「未解析」。

实现细节

  • 在建立求解模型前,用 BigInteger 根据库存和净产出约束推导各样板执行次数的上下界,提前发现库存约束之间的矛盾。
  • 缺料诊断可以复用满足净产出约束的执行次数,重建所需库存,再通过现有的物料守恒校验和压缩调度验证执行顺序。直接验证通过时,求解器调用次数记为 0。

结果

使用实机抓取的样板和库存数据离线回放,目标循环的联合规划与缺料诊断耗时约 74 毫秒,确认了 6 种缺料,并生成了一条经过调度验证的循环证据。

验证

  • gradlew.bat compileTestJava --offline 通过。
  • IntelliJ IDEA 对 5 个修改文件的检查均未报错。
  • 离线回放调用生产规划器,验证了库存不足时的诊断结果。

@github-actions github-actions Bot added the 1.21 label Nov 24, 2026
@QiuYe-QAQ QiuYe-QAQ added Release: Major - 0.X.0 Releases focused on Content, changes to gameplay; While maintaining mostly API stability. type: refactor Suggestion to refactor a section of code labels Nov 24, 2026
@github-actions github-actions Bot added the Tests: Passed Game Tests have passed on this PR label Nov 24, 2026
@QiuYe-QAQ QiuYe-QAQ added type: bugfix General bug fixes Release: Patch - 0.0.X Smaller changes that either are bug fixes or very minor tweaks. and removed Release: Major - 0.X.0 Releases focused on Content, changes to gameplay; While maintaining mostly API stability. type: refactor Suggestion to refactor a section of code labels Nov 24, 2026
@QiuYe-QAQ
QiuYe-QAQ merged commit 8e1bfd5 into 1.21 Nov 24, 2026
6 of 11 checks passed
@QiuYe-QAQ
QiuYe-QAQ deleted the qy/trinity-cycle-planning-bounds branch November 24, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.21 Release: Patch - 0.0.X Smaller changes that either are bug fixes or very minor tweaks. Tests: Passed Game Tests have passed on this PR type: bugfix General bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant