[英]What is the recommended way to handle a hierarchical constraint in OptaPlanner?
I'm trying to learn OptaPlanner by building a playlist generator. 我正在尝试通过构建播放列表生成器来学习OptaPlanner。 My constraints look roughly like:
我的约束大致如下:
So by hierarchical, I mean you could choose the artist and then attempt to fill the block. 因此,通过分层,我的意思是您可以选择艺术家,然后尝试填补空白。
My current implementation expresses these as constraints on song selection. 我当前的实现将这些表示为歌曲选择的约束。 It's able to solve the problem, but I feel like it's spending a lot of time trying to align the artist constraint.
它可以解决问题,但是我觉得花很多时间试图调整艺术家的约束。
Reading through docs, it seems like there are some features which might be helpful: 通读文档,似乎有些功能可能会有所帮助:
What's the recommended way to handle this type of relationship? 处理这种类型关系的推荐方法是什么?
Sounds like these are just 4 constraints with 4 different score levels (see docs chapter on score calculation). 听起来这些只是4种约束,具有4种不同的分数级别 (请参阅有关分数计算的文档章节)。 So in that case, you'll need a
BendableScore
. 因此,在这种情况下,您将需要
BendableScore
。
In practice though, I would be surprised if 3. and 4. are hierarchical: 3 might just have a much heavier score weight than 4. In that case a HardMediumSoftScore
suffices. 但是实际上,如果3.和4.是分层的,我会感到惊讶:3的得分权重可能比4
HardMediumSoftScore
。在这种情况下,使用HardMediumSoftScore
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.