问题
So I am looking at modelling an overconstrained routing problem, where not all tasks have to be picked up in that specific planning problem. Rather the objective will be to maximise the tasks picked up in that planning problem.
I was thinking this should be easy to achieve by allowing the planning variable to be nullable, but it seems that Optaplanner does not allow this on chained planning variables.
So the workaround I am thinking about would be to devise a Dummy/Ghost vehicle for which the objective be to rather minimise the tasks assigned to this vehicle. This approach seems to echo what has been said here.
Alternatively, I think I can put the value null
in the valueRangeProvider
but I am not sure if this would work as intended.
Is this a reasonable approach, or are there caveats using this approach ?
回答1:
null in ValueRangeProvider doesn't work.
The Dummy workaround is very, very common - I did it a few times myself (including for the RH summit demo). But once PLANNER-226 is fixed, we can get rid of that dummy workaround.
来源:https://stackoverflow.com/questions/57518793/nullable-chained-planning-variable-in-optaplanner