问题
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?
回答1:
Planning variables can take on a range of values, as specified by ValueRangeProviderRefs
. This is always a Collections
object.
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.
来源:https://stackoverflow.com/questions/48257903/optaplanner-list-planning-variable