Commit 2c9f2b70 authored by Dmitry Bagaev's avatar Dmitry Bagaev
Browse files

upd

parent d67b29ab
......@@ -222,7 +222,7 @@ int main(int argc, char **argv) {
properties["eps:use_closest"] = "false";
properties["eps:strict_bound"] = "false";
TTSP::Optimizers::SaveOptimizerOrReplace("test", optimizerType, properties, 10);
TTSP::Optimizers::SaveOptimizerOrReplace("test", optimizerType, properties, 15);
TTSP::OptimizerInterface *topt = TTSP::Optimizers::GetSavedOptimizer("test");
......
......@@ -259,6 +259,18 @@ namespace TTSP {
return changed_parameters;
}
bool BayesianOptimizer::UpdateSpaceWithLatestResults() {
const OptimizationParameterResult &last = results.at(0);
if (last.IsGood() && (last.GetMetricsBefore() < 0.0 || (last.GetMetricsAfter() < last.GetMetricsBefore()))) {
parameters.Update(last.GetChangedParameters(), last.GetMetricsAfter());
return true;
} else {
return false;
}
}
BayesianOptimizer::~BayesianOptimizer() {}
......
......@@ -40,6 +40,8 @@ namespace TTSP {
mutable BayesianUniformDistribution random;
protected:
bool UpdateSpaceWithLatestResults() override;
SuggestionChangedParameters AlgorithmMakeSuggestion(const std::function<OptimizationFunctionInvokeResult(const OptimizationParameterPoints &,
const OptimizationParameterPoints &,
void *)> &invoke, void *data) const override;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment