-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timeout feature on evaluation #185
Conversation
belowNodeLimit(model::CPModel) = isnothing(model.limit.numberOfNodes) || model.statistics.numberOfNodes < model.limit.numberOfNodes | ||
belowSolutionLimit(model::CPModel) = isnothing(model.limit.numberOfSolutions) || model.statistics.numberOfSolutions < model.limit.numberOfSolutions | ||
|
||
belowTimeLimit(model::CPModel) = isnothing(model.limit.searchingTime) || peektimer() < model.limit.searchingTime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
peektimer()
can be compared as the loop button on any stopwatch. It gives the elapsed time since the last call to tic()
.
@@ -19,7 +19,7 @@ at each branching and using `valueSelection` to choose how the branching will be | |||
|
|||
""" | |||
function search!(model::CPModel, strategy::S, variableHeuristic::AbstractVariableSelection, valueSelection::ValueSelection=BasicHeuristic(); out_solver::Bool=false) where S <: SearchStrategy | |||
|
|||
tic() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Timer is started at the beginning of a search.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything's good to me
Few modifications on CPModel to add the timeout feature on searches. CPModel now has a
limit.searchingTime
attribute.To use a timeout on evaluation, the user should add the optional argument
evalTimeOut
during theSameInstancesEvaluator
creation.I added the possibility to define 2 different strategies
strategy
andeval_strategy
for both the training and the evaluation.I fixed a little omission on
BasicHeuristic
that were previously not modifyingmodel.statistics.lastVar
during a DecisionPhasePrints during search, using
verbose=true
have also been updated.