AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
evaluation_result.h
1#ifndef EVALUATION_RESULT_H
2#define EVALUATION_RESULT_H
3
4#include "downward/operator_id.h"
5
6#include <limits>
7#include <vector>
8
9class EvaluationResult {
10 static const int UNINITIALIZED = -2;
11
12 int evaluator_value;
13 std::vector<OperatorID> preferred_operators;
14 bool count_evaluation;
15
16public:
17 // "INFINITY" is an ISO C99 macro and "INFINITE" is a macro in windows.h.
18 static const int INFTY;
19
20 EvaluationResult();
21
22 /* TODO: Can we do without this "uninitialized" business?
23
24 One reason why it currently exists is to simplify the
25 implementation of the EvaluationContext class, where we don't
26 want to perform two separate map operations in the case where
27 we determine that an entry doesn't yet exist (lookup) and hence
28 needs to be created (insertion). This can be avoided most
29 easily if we have a default constructor for EvaluationResult
30 and if it's easy to test if a given object has just been
31 default-constructed.
32 */
33
34 /*
35 TODO: Can we get rid of count_evaluation?
36 The EvaluationContext needs to know (for statistics) if the
37 heuristic actually computed the heuristic value or just looked it
38 up in a cache. Currently this information is passed over the
39 count_evaluation flag, which is somewhat awkward.
40 */
41
42 bool is_uninitialized() const;
43 bool is_infinite() const;
44 int get_evaluator_value() const;
45 bool get_count_evaluation() const;
46 const std::vector<OperatorID>& get_preferred_operators() const;
47
48 void set_evaluator_value(int value);
49 void set_preferred_operators(std::vector<OperatorID>&& preferred_operators);
50 void set_count_evaluation(bool count_eval);
51};
52
53#endif