Reputation: 43
Like the title says, I have the following configuration:
<localSearch>
<localSearchType>TABU_SEARCH</localSearchType>
<termination>
<terminationCompositionStyle>OR</terminationCompositionStyle>
<unimprovedSecondsSpentLimit>5</unimprovedSecondsSpentLimit>
<secondsSpentLimit>10</secondsSpentLimit>
</termination>
</localSearch>
With this configuration, the local search should stop after 10 seconds. But it does not. I will have to wait until unimprovedSecondsSpentLimit
is triggered.
So how can I make the local search stop if the solution cannot be easily improved OR when its runtime exceeds a given duration?
Upvotes: 0
Views: 172
Reputation: 43
I created a OrCompositeTerminationTest, as mentioned by Geoffrey : everything is working as it should in OptaPlanner.
I found why my case was not working : here, OptaPlanner is configured with an xml file. But I was not aware that a bit of our code was messing with the termination conditions once the solver was built.
I am terribly sorry to have made you loose your time on something that dumb !
Upvotes: 1
Reputation: 1029
The OrCompositionTermination works for me both with current master branch and 7.22.0.Final tag. Could you please try turning on logging as Geoffrey suggested?
Upvotes: 1