Optaplanner List Planning variable

妖精的绣舞 提交于 2019-12-11 17:31:42

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!