We plan a slightly more invasive re-design of all the open list stuff:
The search will be able to access two objects:
An "Evaluator" with the following public interface:
void evaluate(const State &state, int g, bool preferred)
bool is_dead_end()
void get_preferred_operators(std::vector<const Operator *> &result);
and the actual OpenList<Entry> with the following interface:
void insert(const Entry &entry);
Entry remove_min();
bool empty() const;
(if we don't really need the template parameter at the
end, we might remove it).
The open list will know its evaluator and will get all
relevant information from there.
So when the search handles a state, it will have to take
care that the Evaluator is evaluated for that state before
its other methods or adds the state to the open list.
Some words on the role of the Evaluator: Evaluators can be
combinations of heuristics, heuristics (in the long term,
it might be the case that Heuristic will inherit from
Evaluator), preferredness information, the g-value, ...
|