From af398235ef9f3a909991fddbb71d43434d6cf3a1 Mon Sep 17 00:00:00 2001 From: Gereon Kremer Date: Mon, 12 Apr 2021 22:58:14 +0200 Subject: Refactor resource manager (#6322) This PR does another round of refactoring of the resource manager and related code. - it moves the Resource enum out of the ResourceManager class - it treats the resources in a generic way (storing the statistics in a vector) instead of the manual treatment we had before - weights no longer live in the options, but in the ResourceManager and are changed accordingly in the ResourceManager constructor - following the generic treatment of resources, it also removes all the resource-specific options --x-step in favor of a generic --rweight name=weight - removed several unused methods from the ResourceManager Note that we handle the Resource enum in a way that allows to easily use other enums as additional resources, for example InferenceId. The general idea is that we will at some point have sensible default weights (so that the cumulative resources somewhat simulate the solver runtime) and users (almost) never need to modify them. --- src/preprocessing/passes/static_learning.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/preprocessing/passes/static_learning.cpp') diff --git a/src/preprocessing/passes/static_learning.cpp b/src/preprocessing/passes/static_learning.cpp index 278252da9..09d24d900 100644 --- a/src/preprocessing/passes/static_learning.cpp +++ b/src/preprocessing/passes/static_learning.cpp @@ -33,7 +33,7 @@ StaticLearning::StaticLearning(PreprocessingPassContext* preprocContext) PreprocessingPassResult StaticLearning::applyInternal( AssertionPipeline* assertionsToPreprocess) { - d_preprocContext->spendResource(ResourceManager::Resource::PreprocessStep); + d_preprocContext->spendResource(Resource::PreprocessStep); for (unsigned i = 0; i < assertionsToPreprocess->size(); ++i) { -- cgit v1.2.3