1 #ifndef MAXFUNCTIONSELECTOR_H 2 #define MAXFUNCTIONSELECTOR_H 7 #include "iselection_strategy.hpp" 19 template <
typename Context,
typename Config>
26 vector<node_t *> children = node->
children();
27 vector<double> values(children.size());
29 for (
unsigned i = 0; i < children.size(); ++i){
34 std::max_element(values.begin(), values.end()) - values.begin();
35 max_node = children[max_index];
37 if (max_node == NULL) {
38 throw std::logic_error(
"MaxFunctionSelector failed to select a node.");
52 virtual double evaluate(node_t *node)
const = 0;
selector selects the child of a node that maximises a given metric.
interface for all selection strategies. A selection strategy selects one child of a parent node accor...
basic interface for a node in the tree. Every node has to implement this functions.
virtual double evaluate(node_t *node) const =0
this function has to be implemented in derived classes that specializes the metric to be used....
node_t * select(node_t *node)
select a child of node
virtual const vector< node_t * > children() const =0
get the children of the current node