问题描述
我正在处理一个规划问题,涉及:
I am working on a planning problem involving:
- 一组规划实体,每个实体都包含规划变量 A
- 全局规划变量 B(包含在规划解决方案中)
由于我是 Optaplanner 和规划优化的初学者,所以我开始解决一个更简单的版本问题,重点是优化 A,并将 B 建模为规划事实.
Since I am a beginner with Optaplanner and planning optimization in general, I started on a simpler version problem, focusing on optimizing A with B modeled as a planning fact.
现在我有一个程序成功优化 A 给定 B.我想实现一个新的求解器优化 A 和 B.事实证明,最佳优化搜索策略是先选择一个 B 值,然后优化 A 给定那个 B 值.这个过程应该重复直到找到一个最优值(手头的问题是分层的)
Now that I have a program successfully optimizing A given B. I want to implement a new solver optimizing both A and B. It turns out that the best optimization search strategy is to first select a B value, and then optimize A given that B value. This process should be repeated until an optimum is found (the problem at hand is hierarchical)
我正在寻找有关如何使用 Optaplanner 实现此功能的建议.我最初认为我会将其实现为两个阶段(优化 B -> 优化 A),但我现在明白 Optaplanner 阶段并不打算这样做.例如,求解器无法遍历这个有序的两阶段序列.
I am looking for advice on how to implement this with Optaplanner. I initially thought I would implement this as two phases (optimize B -> optimize A) but I now understand Optaplanner phases are not meant to do that. For example, the solver cannot loop over this ordered sequence of two phases.
相反,我认为我应该实现一个自定义的 MoveSelector,它以 B 上的移动开始,然后是 A 移动的无限列表..
Instead, I think I should implement a custom MoveSelector which starts with a move on B, and then an infinite list of A move..
你怎么看?我在正确的轨道上吗?
What do you think ? Am I on the right track ?
亲切的问候,
推荐答案
A 和 B 是不同的阶段,不是不同的阶段(在 OptaPlanner 术语中).
A and B are different stages, not different phases (in OptaPlanner terminology).
在多阶段规划(请参阅文档中的简短条目)中,基本上是 2 个不同的求解器,一个与另一个相结合.当 A 和 B 发生在不同的时间(考虑战略 vs 战术 vs 运营计划)或由于康威定律(用户的组织结构)时,这是非常常见的.这是最简单的解决方案,而且通常也是企业变更管理过程中最实用的解决方案.这是最小的风险.然而,它并不理想(至少在理论上是这样).
In multi-stage planning (see short entry in docs), it's basically 2 different solvers, with one feeding into the other. This is very common when A and B occur at different times (think strategic vs tactical vs operation planning) or due to Conway's law (the organization structure of the users). This is the easy solution and often also by far the most practical during change management for the business. It's the least risk. However, it's suboptimal (in theory at least).
替代方案确实是拥有多个规划实体,这使其成为一个大规划问题.这就是完美的解决方案.那很有挑战性.完美可能是善良的敌人.OptaPlanner 的架构支持它,但确实需要自定义移动(今天在 OptaPlanner 7.35 中),因为默认的移动选择器不会经常逃避局部最优.
The alternative is indeed to have multiple planning entities, which makes it one big planning problem. That is the perfect solution. That is challenging. Perfect can be the enemy of good. OptaPlanner's architecture supports it, but custom moves are indeed required (today in OptaPlanner 7.35), as the default move selectors won't escape local optima often enough.
这篇关于实现分层问题的规划优化算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!