1 #ifndef MIN_FUNCTION_SELECTOR_H 2 #define MIN_FUNCTION_SELECTOR_H 5 #include "iselection_strategy.hpp" 17 template <
typename Context,
typename Config>
23 vector<node_t *> children = node->
children();
24 vector<double> values(children.size());
27 for (
unsigned i = 0; i < children.size(); i++) {
32 std::min_element(values.begin(), values.end()) - values.begin();
33 min_node = children[min_index];
35 if (min_node == NULL) {
36 throw std::logic_error(
"MinFunctionSelector failed to select a node.");
50 virtual double evaluate(node_t *node)
const = 0;
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.
selects a node that minimises a given metric
virtual double evaluate(node_t *node) const =0
this function has to be implemented in derived classes that specializes the metric to be used....
virtual const vector< node_t * > children() const =0
get the children of the current node
node_t * select(node_t *node)
select a child of node