Search code examples
optaplannerheuristics

optaplanner heuristic limit number of moves


does anyone knows if its possible to limit the moves in the heuristic phase? or what can be done to make this possible?

I have a large dataset to work with but the heuristics phase takes a really long time to complete, and its wight because the large amount of comparations to be done, in the middle steps it takes like 800 moves per step, I'd like to limit this to some moves less like 50, I know that this eliminates a lot of good possible answers but will cut the heuristics phase from 30 minutes to a fraction of it.


Solution

  • Use termination by score calculation count, which is the number of moves evaluated.

    If it doesn't for any reason, clearly motivate why in a jira that asks for an extra Termination manner (which would be moveCountLimit I presume which would probably be easy to implement, just copy StepCountTermination.java).