Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
2ee70c7
Add prototype build and set it as default.
salome-eriksson Jul 19, 2023
1fd17c6
Move unpacking of options to LandmarkCutHeursiticFeature.
salome-eriksson Jul 19, 2023
4530dba
Move unpacking of options to GEvaluatorFeature.
SimonDold Jul 19, 2023
e951abc
Move unpacking of options to SumEvaluatorFeature.
SimonDold Jul 19, 2023
88d8195
Move unpacking of options to TieBreakingOpenListFeature.
SimonDold Jul 19, 2023
463fde8
unpack opts in factory constructor.
SimonDold Jul 24, 2023
7841f80
Change parameter order, add default values.
SimonDold Jul 24, 2023
3afdf95
Move unpacking of opts to astar creation.
SimonDold Jul 25, 2023
beb0578
Move unpacking of opts to plugin_astar.
SimonDold Jul 25, 2023
cd5b7c9
Remove unpacking of opts from eager_search.
SimonDold Jul 25, 2023
6acaf71
Move unpacking of options to TieBreakingOpenListFeature.
SimonDold Jul 19, 2023
e958cad
Uncrustify.
SimonDold Jul 26, 2023
9336de1
add TI-lmc.
SimonDold Jul 27, 2023
f0c682a
add TI-g.
SimonDold Jul 27, 2023
3d5f949
add TI-sum.
SimonDold Jul 27, 2023
4037756
comments.
SimonDold Jul 27, 2023
46d3b8f
move class definition into header.
SimonDold Jul 28, 2023
c77cb5c
add TI-TieBreakingOpenList (move template class definition from .cc t…
SimonDold Jul 28, 2023
3ef59fa
fix inheritance.
SimonDold Jul 28, 2023
208cc7d
improve test.
SimonDold Jul 28, 2023
bcc07bd
remove unused function.
SimonDold Aug 17, 2023
c419418
add TI EagerSearch.
SimonDold Aug 18, 2023
7011a34
replace testrun with working search.
SimonDold Sep 5, 2023
74f4561
remove comments.
SimonDold Sep 5, 2023
e1b4dd5
Uncrustify.
SimonDold Sep 5, 2023
5c4230a
merge TI_search_engine/TI_evaluator into search_engine/evaluator.
SimonDold Sep 11, 2023
a5fb9fb
clean-up of TaskIndependentOpenListFactory.
SimonDold Sep 12, 2023
377aa28
add ComponentMap.
SimonDold Sep 12, 2023
475b4ec
change TypedCategoryPlugin name.
SimonDold Sep 13, 2023
fb59ce3
restore missing plugins.
SimonDold Sep 14, 2023
854c941
move unpacking in alt_open_list.
SimonDold Sep 14, 2023
ec2436e
add TI alt_open_list.
SimonDold Sep 14, 2023
0b3b0e8
add unpacked constructor to WeightedEvaluator.
SimonDold Sep 14, 2023
5d83461
fix sum_eval.
SimonDold Sep 14, 2023
ee70768
add TI weighted_eval.
SimonDold Sep 14, 2023
300723a
move unpacking in BestFirstOpenList.
SimonDold Sep 14, 2023
84c1c54
add TI BestFirstOpenList.
SimonDold Sep 14, 2023
444f70e
add Component class.
SimonDold Sep 15, 2023
a478a71
Add TI_CostAdaptedTask.
SimonDold Sep 27, 2023
eb0d133
Add TI_RootTask.
SimonDold Sep 27, 2023
fdabd02
expect TI_Evaluators.
SimonDold Sep 27, 2023
e1a2c07
add default values.
SimonDold Sep 27, 2023
5316015
fix style.
SimonDold Sep 28, 2023
9b3f33c
add TI_RootTask.
SimonDold Sep 28, 2023
6146f55
add task_transformation to TI_LMCutHeurisitc.
SimonDold Oct 2, 2023
9932ea1
move unpacking in IteratedSearch.
SimonDold Oct 3, 2023
9382a47
add TI_IteratedSearch.
SimonDold Oct 4, 2023
7509076
add depth indent.
SimonDold Oct 4, 2023
b1e0b0e
add conditional depth indent.
SimonDold Oct 4, 2023
ab8e6e8
make shared_ptr<AbstractTask> const.
SimonDold Oct 4, 2023
2b40a72
fix depth+1 calls.
SimonDold Oct 4, 2023
34551b3
add bound.
SimonDold Oct 4, 2023
dbab1c4
remove couts.
SimonDold Oct 4, 2023
cafd937
remove couts.
SimonDold Oct 4, 2023
4162e96
add get_description() to TI_SearchEngine.
SimonDold Oct 4, 2023
5cec4cc
get rid of LazyValue.
SimonDold Oct 5, 2023
caaaf92
get rid of LazyValue completely.
SimonDold Oct 5, 2023
69152b1
remove constructors with Options parameter.
SimonDold Oct 5, 2023
2033d5c
slightly un-bloat TI_Heuristic.
SimonDold Oct 5, 2023
b806d32
use unique_ptr for component_map.
SimonDold Oct 5, 2023
3ec2521
use unique_ptr.
SimonDold Oct 5, 2023
07abf26
use unique_ptr.
SimonDold Oct 5, 2023
2177efe
fix style.
SimonDold Oct 5, 2023
8271e8c
handle warnings.
SimonDold Oct 5, 2023
3d78146
handle warnings.
SimonDold Oct 6, 2023
8c4d0d6
enable iterated search.
SimonDold Oct 6, 2023
20819a1
improve log message.
SimonDold Oct 6, 2023
d2e85d4
simplify create_task_specific calls.
SimonDold Oct 6, 2023
e7496a5
simplify componentmap.
SimonDold Oct 9, 2023
2ee79da
remove ComponentMap class.
SimonDold Oct 9, 2023
07d618e
remove component_map from IteratedSearch.
SimonDold Nov 23, 2023
aef47fd
rebase fixes
SimonDold Nov 23, 2023
1d96e2c
rebase fixes
SimonDold Nov 23, 2023
865171f
add test name
SimonDold Dec 24, 2023
7103fa4
move 'name' up in hierarchy.
SimonDold Dec 25, 2023
dfe1173
move 'name' up in hierarchy to Evaluator.
SimonDold Dec 26, 2023
5d95e80
add 'name' to eagersearch.
SimonDold Dec 27, 2023
5362f73
move 'name' to SearchAlgo.
SimonDold Dec 27, 2023
c5e440f
state name in log.
SimonDold Dec 27, 2023
2c80e20
forward default name.
SimonDold Dec 27, 2023
6ad09ca
removing placeholder default names.
SimonDold Dec 27, 2023
5a5d38c
remove TODO comment.
SimonDold Dec 27, 2023
90b3059
use default destructors.
SimonDold Dec 28, 2023
a2ac1b1
make 'create_task_specific' const.
SimonDold Dec 29, 2023
4b1aae0
add test alias
SimonDold Dec 29, 2023
c4b593f
uncrustify
SimonDold Dec 29, 2023
604ebe2
remove some laziness.
SimonDold Dec 29, 2023
05a9625
remove cloning.
SimonDold Dec 29, 2023
880b971
move ConstructionContext into cc file.
SimonDold Dec 29, 2023
adbc3a1
remove unused code.
SimonDold Dec 29, 2023
ee9fe03
remove unused copy constructor.
SimonDold Dec 29, 2023
5e3e1ef
adjust parameter order to wiki.
SimonDold Dec 29, 2023
0e50542
handle warnings.
SimonDold Dec 29, 2023
e802f32
construct TI_Evaluators with verbosity.
SimonDold Dec 29, 2023
ef2e7d9
adjust parameter order to match wiki better.
SimonDold Dec 29, 2023
b43a21f
adjust parameters order to match wiki better.
SimonDold Dec 29, 2023
232427e
adjust parameters order to wiki.
SimonDold Dec 29, 2023
2184384
adjust OpenListFactory parameters order to match wiki.
SimonDold Dec 29, 2023
e549ceb
adjust Evaluator parameter order to match wiki.
SimonDold Dec 29, 2023
2c982b1
remove unparsed_config from search_algos.
SimonDold Dec 29, 2023
e4dda06
adjust parameter order.
SimonDold Dec 29, 2023
dfc8fd5
remove unparsed_config from evals.
SimonDold Dec 29, 2023
2106fb4
replace description with name.
SimonDold Dec 29, 2023
f31bd83
add blind heuristic.
SimonDold Dec 29, 2023
b29e663
rename method.
SimonDold Dec 30, 2023
3105a6b
prepare templating.
SimonDold Dec 30, 2023
33be1d8
prepare templating in h files.
SimonDold Dec 30, 2023
f5cf56e
prepare templating in cc files.
SimonDold Dec 30, 2023
0dc719a
put logger into openlistfactory.
SimonDold Dec 30, 2023
186fa09
move logger into TIcomponent.
SimonDold Dec 30, 2023
f9649d5
uncrustify.
SimonDold Dec 30, 2023
0dc07f1
move get_name to TIComponent.
SimonDold Dec 30, 2023
567acb9
remove options field.
SimonDold Dec 30, 2023
4de064e
return original default transformation.
SimonDold Dec 30, 2023
6cc1048
add template TODO.
SimonDold Dec 30, 2023
e247745
add TODO
SimonDold Dec 30, 2023
3cd3afd
remove option constructors.
SimonDold Jan 2, 2024
2fecd56
add TI_NullPruningMethod.
SimonDold Jan 2, 2024
2086a6d
match parameter order to wiki.
SimonDold Jan 2, 2024
1ce8e9d
remove empty lines.
SimonDold Jan 2, 2024
5ebe8e4
fix plugin.
SimonDold Jan 2, 2024
630cb0c
uncrustify.
SimonDold Jan 2, 2024
e0b97f1
add overflow check.
SimonDold Jan 11, 2024
bac530f
add alias.
SimonDold Jan 17, 2024
595e2fa
uncrustify.
SimonDold Jan 18, 2024
c44a369
merge
SimonDold Jul 11, 2024
a874b37
reduce diff
SimonDold Jul 12, 2024
713b3a9
reduce diff
SimonDold Jul 12, 2024
1bd6f7d
reduce diff
SimonDold Jul 12, 2024
c822c69
reduce diff heuristics
SimonDold Jul 12, 2024
0a1a0b7
move func def to reduce diff
SimonDold Jul 12, 2024
8e5decb
reduce diff in search_common
SimonDold Jul 12, 2024
a4a63b7
replace 'name' with 'description'
SimonDold Jul 12, 2024
7b32e9c
update typecategoryplugin
SimonDold Jul 12, 2024
b00e7ac
reduce diff in search_common
SimonDold Jul 12, 2024
37c4dfc
take care of warning
SimonDold Jul 12, 2024
2880692
use template for get_task_specific (deactivate reusing)
SimonDold Jul 16, 2024
616013e
fix reusing, use HashMap.
SimonDold Jul 16, 2024
9b484b8
fix style, reduce TICBase class
SimonDold Jul 16, 2024
cbec657
fix style
SimonDold Jul 16, 2024
c7a1856
fix style
SimonDold Jul 16, 2024
a4c344f
style
SimonDold Jul 16, 2024
62b6fc3
renaming
SimonDold Jul 17, 2024
9c5f827
fix style
SimonDold Jul 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion build_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
# USE_GLIBCXX_DEBUG is not compatible with USE_LP (see issue983).
glibcxx_debug = ["-DCMAKE_BUILD_TYPE=Debug", "-DUSE_LP=NO", "-DUSE_GLIBCXX_DEBUG=YES"]
minimal = ["-DCMAKE_BUILD_TYPE=Release", "-DDISABLE_LIBRARIES_BY_DEFAULT=YES"]
prototype = ["-DCMAKE_BUILD_TYPE=Release",
"-DDISABLE_LIBRARIES_BY_DEFAULT=YES",
"-DLIBRARY_ITERATED_SEARCH_ENABLED=YES",
"-DLIBRARY_CORE_TASKS_ENABLED=YES",
"-DLIBRARY_PLUGIN_EAGER_ENABLED=YES",
"-DLIBRARY_PLUGIN_ASTAR_ENABLED=YES",
"-DLIBRARY_LANDMARK_CUT_HEURISTIC_ENABLED=YES",
"-DLIBRARY_BLIND_SEARCH_HEURISTIC_ENABLED=YES"]

DEFAULT = "release"
DEFAULT = "prototype"
DEBUG = "debug"
73 changes: 73 additions & 0 deletions driver/aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,79 @@ def _get_lama(pref):
ALIASES["seq-opt-lmcut"] = [
"--search", "astar(lmcut())"]

ALIASES["issue559_test1"] = [
"--search",
"let(h, lmcut(description=\"AllTimeLMcut\"),"
" iterated([astar(description=\"ASTAR_1\",eval=h),"
" eager(tiebreaking([sum([g(\"my_G_Eval\"), "
" h]), "
" h],"
" unsafe_pruning=false"
" ),"
" reopen_closed=true,"
" f_eval=sum([g(), "
" h]))"
" ]))"] # TODO issue559 remove this
ALIASES["issue559_test2"] = [
"--search",
"let(h, lmcut(description=\"AllTimeLMcut\"),"
" iterated([astar(description=\"ASTAR_1\",eval=h),"
" eager(tiebreaking([sum([g(\"my_G_Eval\"), "
" h]), "
" h],"
" unsafe_pruning=false"
" ),"
" reopen_closed=true,"
" f_eval=sum([g(), "
" h])),"
" eager(tiebreaking([sum([g(), "
" blind()]), "
" blind()],"
" unsafe_pruning=false"
" )"
" ,description=\"eager3\")"
" ],pass_bound=false))"] # TODO issue559 remove this
ALIASES["issue559_test3"] = [
"--search",
"let(h, lmcut(description=\"AllTimeLMcut\"),"
" iterated([astar(description=\"ASTAR_1\",eval=h),"
" eager(tiebreaking([sum([g(\"my_G_Eval\"), "
" h]), "
" h],"
" unsafe_pruning=false"
" ),"
" reopen_closed=true,"
" f_eval=sum([g(), "
" h])),"
" eager(tiebreaking([sum([g(), "
" blind(transform=adapt_costs(normal))]), "
" blind()],"
" unsafe_pruning=false"
" )"
" ,description=\"eager3\")"
" ],pass_bound=false))"] # TODO issue559 remove this
ALIASES["issue559_test4"] = [
"--search",
"let(h, lmcut(description=\"AllTimeLMcut\"),"
" iterated("
"[iterated([astar(description=\"ASTAR_1\",eval=h),"
" eager(tiebreaking([sum([g(\"my_G_Eval\"), "
" h]), "
" h],"
" unsafe_pruning=false"
" ),"
" reopen_closed=true,"
" f_eval=sum([g(), "
" h]))"
"],pass_bound=false), iterated(["
" eager(tiebreaking([sum([g(), "
" blind(transform=adapt_costs(normal))]), "
" blind()],"
" unsafe_pruning=false"
" )"
" ,description=\"eager3\")"
" ])"
"],pass_bound=false))"] # TODO issue559 remove this

PORTFOLIOS = {}
for portfolio in os.listdir(PORTFOLIO_DIR):
Expand Down
6 changes: 5 additions & 1 deletion src/search/abstract_task.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ ostream &operator<<(ostream &os, const FactPair &fact_pair) {
return os;
}

static class AbstractTaskCategoryPlugin : public plugins::TypedCategoryPlugin<AbstractTask> {
TaskIndependentAbstractTask::TaskIndependentAbstractTask()
: TaskIndependentComponent("abstract_task", utils::Verbosity::NORMAL) {
}

static class AbstractTaskCategoryPlugin : public plugins::TypedCategoryPlugin<TaskIndependentAbstractTask> {
public:
AbstractTaskCategoryPlugin() : TypedCategoryPlugin("AbstractTask") {
// TODO: Replace empty string by synopsis for the wiki page.
Expand Down
9 changes: 8 additions & 1 deletion src/search/abstract_task.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef ABSTRACT_TASK_H
#define ABSTRACT_TASK_H

#include "component.h"
#include "operator_id.h"

#include "algorithms/subscriber.h"
Expand Down Expand Up @@ -48,7 +49,7 @@ inline void feed(HashState &hash_state, const FactPair &fact) {
}
}

class AbstractTask : public subscriber::SubscriberService<AbstractTask> {
class AbstractTask : public subscriber::SubscriberService<AbstractTask>, public Component {
public:
AbstractTask() = default;
virtual ~AbstractTask() override = default;
Expand Down Expand Up @@ -103,4 +104,10 @@ class AbstractTask : public subscriber::SubscriberService<AbstractTask> {
const AbstractTask *ancestor_task) const = 0;
};

class TaskIndependentAbstractTask : public TaskIndependentComponent<AbstractTask> {
public:
explicit TaskIndependentAbstractTask();
virtual ~TaskIndependentAbstractTask() override = default;
};

#endif
18 changes: 9 additions & 9 deletions src/search/command_line.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@ static vector<string> replace_old_style_predefinitions(const vector<string> &arg
return new_args;
}

static shared_ptr<SearchAlgorithm> parse_cmd_line_aux(const vector<string> &args) {
static shared_ptr<TaskIndependentSearchAlgorithm> parse_cmd_line_aux(const vector<string> &args) {
string plan_filename = "sas_plan";
int num_previously_generated_plans = 0;
bool is_part_of_anytime_portfolio = false;

using SearchPtr = shared_ptr<SearchAlgorithm>;
SearchPtr search_algorithm = nullptr;
using TISearchPtr = shared_ptr<TaskIndependentSearchAlgorithm>;
TISearchPtr ti_search_algorithm = nullptr;
// TODO: Remove code duplication.
for (size_t i = 0; i < args.size(); ++i) {
string arg = args[i];
bool is_last = (i == args.size() - 1);
if (arg == "--search") {
if (search_algorithm)
if (ti_search_algorithm)
input_error("multiple --search arguments defined");
if (is_last)
input_error("missing argument after --search");
Expand All @@ -103,7 +103,7 @@ static shared_ptr<SearchAlgorithm> parse_cmd_line_aux(const vector<string> &args
parser::ASTNodePtr parsed = parser::parse(tokens);
parser::DecoratedASTNodePtr decorated = parsed->decorate();
plugins::Any constructed = decorated->construct();
search_algorithm = plugins::any_cast<SearchPtr>(constructed);
ti_search_algorithm = plugins::any_cast<TISearchPtr>(constructed);
} catch (const utils::ContextError &e) {
input_error(e.get_message());
}
Expand Down Expand Up @@ -154,16 +154,16 @@ static shared_ptr<SearchAlgorithm> parse_cmd_line_aux(const vector<string> &args
}
}

if (search_algorithm) {
PlanManager &plan_manager = search_algorithm->get_plan_manager();
if (ti_search_algorithm) {
PlanManager &plan_manager = ti_search_algorithm->get_plan_manager();
plan_manager.set_plan_filename(plan_filename);
plan_manager.set_num_previously_generated_plans(num_previously_generated_plans);
plan_manager.set_is_part_of_anytime_portfolio(is_part_of_anytime_portfolio);
}
return search_algorithm;
return ti_search_algorithm;
}

shared_ptr<SearchAlgorithm> parse_cmd_line(
shared_ptr<TaskIndependentSearchAlgorithm> parse_cmd_line(
int argc, const char **argv, bool is_unit_cost) {
vector<string> args;
bool active = true;
Expand Down
4 changes: 2 additions & 2 deletions src/search/command_line.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#include <memory>
#include <string>

class SearchAlgorithm;
class TaskIndependentSearchAlgorithm;

extern std::shared_ptr<SearchAlgorithm> parse_cmd_line(
extern std::shared_ptr<TaskIndependentSearchAlgorithm> parse_cmd_line(
int argc, const char **argv, bool is_unit_cost);

extern std::string usage(const std::string &progname);
Expand Down
64 changes: 64 additions & 0 deletions src/search/component.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#ifndef COMPONENT_H
#define COMPONENT_H

#include "utils/logging.h"
#include "utils/hash.h"

#include <memory>

class AbstractTask;

class Component {
public:
virtual ~Component() = default;
};

class TaskIndependentComponentBase {
};

using ComponentMap = utils::HashMap<const TaskIndependentComponentBase *,
std::shared_ptr<Component>>;

template<typename AbstractProduct>
class TaskIndependentComponent : public TaskIndependentComponentBase {
protected:
const std::string description;
const utils::Verbosity verbosity;
mutable utils::LogProxy log;
public:
explicit TaskIndependentComponent(const std::string &description,
utils::Verbosity verbosity)
: description(description), verbosity(verbosity),
log(utils::get_log_for_verbosity(verbosity)) {
}
virtual ~TaskIndependentComponent() = default;
std::string get_description() const {return description;}
std::shared_ptr<AbstractProduct> get_task_specific(
[[maybe_unused]] const std::shared_ptr<AbstractTask> &task,
std::unique_ptr<ComponentMap> &component_map, int depth) const {
std::shared_ptr<AbstractProduct> component;
const TaskIndependentComponentBase *key =
static_cast<const TaskIndependentComponentBase *>(this);
if (component_map->count(key)) {
log << std::string(depth, ' ')
<< "Reusing task specific component '" << description
<< "'..." << std::endl;
component = dynamic_pointer_cast<AbstractProduct>(
component_map->at(key));
} else {
log << std::string(depth, ' ')
<< "Creating task specific component '" << description
<< "'..." << std::endl;
component = create_task_specific(task, component_map, depth);
component_map->emplace(key, component);
}
return component;
}

virtual std::shared_ptr<AbstractProduct> create_task_specific(
const std::shared_ptr<AbstractTask> &task,
std::unique_ptr<ComponentMap> &component_map,
int depth) const = 0;
};

#endif
19 changes: 12 additions & 7 deletions src/search/evaluator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,24 +74,29 @@ int Evaluator::get_cached_estimate(const State &) const {
ABORT("Called get_cached_estimate when estimate is not cached.");
}

TaskIndependentEvaluator::TaskIndependentEvaluator(
bool use_for_reporting_minima, bool use_for_boosting,
bool use_for_counting_evaluations,
const std::string &description, utils::Verbosity verbosity)
: TaskIndependentComponent(description, verbosity),
use_for_reporting_minima(use_for_reporting_minima),
use_for_boosting(use_for_boosting),
use_for_counting_evaluations(use_for_counting_evaluations) {
}

void add_evaluator_options_to_feature(
plugins::Feature &feature, const string &description) {
feature.add_option<string>(
"description",
"description used to identify evaluator in logs",
"\"" + description + "\"");
utils::add_log_options_to_feature(feature);
utils::add_log_options_to_feature(feature, description);
}

tuple<string, utils::Verbosity> get_evaluator_arguments_from_options(
const plugins::Options &opts) {
return tuple_cat(
make_tuple(opts.get<string>("description")),
utils::get_log_arguments_from_options(opts)
);
}

static class EvaluatorCategoryPlugin : public plugins::TypedCategoryPlugin<Evaluator> {
static class EvaluatorCategoryPlugin : public plugins::TypedCategoryPlugin<TaskIndependentEvaluator> {
public:
EvaluatorCategoryPlugin() : TypedCategoryPlugin("Evaluator") {
document_synopsis(
Expand Down
17 changes: 16 additions & 1 deletion src/search/evaluator.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef EVALUATOR_H
#define EVALUATOR_H

#include "abstract_task.h"
#include "component.h"
#include "evaluation_result.h"

#include "utils/logging.h"
Expand All @@ -14,7 +16,7 @@ namespace plugins {
class Options;
}

class Evaluator {
class Evaluator : public Component {
const std::string description;
const bool use_for_reporting_minima;
const bool use_for_boosting;
Expand Down Expand Up @@ -99,6 +101,19 @@ class Evaluator {
virtual int get_cached_estimate(const State &state) const;
};

class TaskIndependentEvaluator : public TaskIndependentComponent<Evaluator> {
const bool use_for_reporting_minima;
const bool use_for_boosting;
const bool use_for_counting_evaluations;
public:
explicit TaskIndependentEvaluator(
bool use_for_reporting_minima, bool use_for_boosting,
bool use_for_counting_evaluations,
const std::string &description, utils::Verbosity verbosity);
virtual ~TaskIndependentEvaluator() = default;
};


extern void add_evaluator_options_to_feature(
plugins::Feature &feature, const std::string &description);

Expand Down
16 changes: 13 additions & 3 deletions src/search/evaluators/combining_evaluator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,28 @@ void CombiningEvaluator::get_path_dependent_evaluators(
for (auto &subevaluator : subevaluators)
subevaluator->get_path_dependent_evaluators(evals);
}


TaskIndependentCombiningEvaluator::TaskIndependentCombiningEvaluator(
vector<shared_ptr<TaskIndependentEvaluator>> subevaluators,
const string &description,
utils::Verbosity verbosity)
: TaskIndependentEvaluator(false, false, false, description, verbosity),
subevaluators(subevaluators) {
}

void add_combining_evaluator_options_to_feature(
plugins::Feature &feature, const string &description) {
feature.add_list_option<shared_ptr<Evaluator>>(
feature.add_list_option<shared_ptr<TaskIndependentEvaluator>>(
"evals", "at least one evaluator");
add_evaluator_options_to_feature(feature, description);
}

tuple<vector<shared_ptr<Evaluator>>, const string, utils::Verbosity>
tuple<vector<shared_ptr<TaskIndependentEvaluator>>, const string, utils::Verbosity>
get_combining_evaluator_arguments_from_options(
const plugins::Options &opts) {
return tuple_cat(
make_tuple(opts.get_list<shared_ptr<Evaluator>>("evals")),
make_tuple(opts.get_list<shared_ptr<TaskIndependentEvaluator>>("evals")),
get_evaluator_arguments_from_options(opts)
);
}
Expand Down
14 changes: 13 additions & 1 deletion src/search/evaluators/combining_evaluator.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,22 @@ class CombiningEvaluator : public Evaluator {

extern void add_combining_evaluator_options_to_feature(
plugins::Feature &feature, const std::string &description);
extern std::tuple<std::vector<std::shared_ptr<Evaluator>>,
extern std::tuple<std::vector<std::shared_ptr<TaskIndependentEvaluator>>,
const std::string, utils::Verbosity>
get_combining_evaluator_arguments_from_options(
const plugins::Options &opts);


class TaskIndependentCombiningEvaluator : public TaskIndependentEvaluator {
protected:
std::vector<std::shared_ptr<TaskIndependentEvaluator>> subevaluators;
public:
TaskIndependentCombiningEvaluator(
std::vector<std::shared_ptr<TaskIndependentEvaluator>> subevaluators,
const std::string &description,
utils::Verbosity verbosity);
virtual ~TaskIndependentCombiningEvaluator() override = default;
};
}

#endif
Loading