Optaplanner列表计划变量 [英] Optaplanner List Planning variable
问题描述
下载了OptaPlanner示例,并对它们进行了测试.在提供的会议计划示例中,在解决的解决方案中返回单个计划变量.例如,对于会议安排,将返回一个会议室.如果位置不同(假设为远程会议室启用了VC),我打算为一个会议安排分配多个会议室.当前会议计划示例未显示此信息.我需要将计划变量室更改为列表吗?
Downloaded OptaPlanner examples, testing them. In the Meeting Scheduling example provided, a single planning variable is returned in the solved solution. for example, for a meeting scheduling, one Room is returned. I am planning to allocate multiple rooms for a single meeting schedule if the locations are different (assuming VC enabled for remote rooms). Current Meeting Scheduling example does not show this. Do I need to change the planning variable room to a List?
推荐答案
计划变量可以采用由ValueRangeProviderRefs
指定的一系列值.这总是 一个Collections
对象.
Planning variables can take on a range of values, as specified by ValueRangeProviderRefs
. This is always a Collections
object.
检查@PlanningSolution
类.那里应该有一个注释:@ValueRangeProvider(id="...")
,它返回仅由一个单间组成的List
.修改它以返回房间列表.您可能还需要调整计分机制,以考虑多个房间.
Check the @PlanningSolution
class. There should be a annotation there: @ValueRangeProvider(id="...")
, that returns a List
comprised of just 1 single room. Modify this to return a list of rooms. You'll probably also need to adjust the scoring mechanism to account for multiple rooms.
这篇关于Optaplanner列表计划变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!