AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
constant_evaluator.h
1#ifndef PROBFD_HEURISTICS_CONSTANT_EVALUATOR_H
2#define PROBFD_HEURISTICS_CONSTANT_EVALUATOR_H
3
4#include "probfd/evaluator.h"
5#include "probfd/task_evaluator_factory.h"
6#include "probfd/type_traits.h"
7#include "probfd/value_type.h"
8
9namespace probfd::heuristics {
10
14template <typename State>
15class ConstantEvaluator : public Evaluator<State> {
16 const value_t value_;
17
18public:
22 explicit ConstantEvaluator(value_t value)
23 : value_(value)
24 {
25 }
26
27 [[nodiscard]]
29 {
30 return value_;
31 }
32};
33
37template <typename State>
38class BlindEvaluator : public ConstantEvaluator<State> {
39public:
44 : ConstantEvaluator<State>(0_vt)
45 {
46 }
47};
48
49class BlindEvaluatorFactory : public TaskEvaluatorFactory {
50public:
51 std::unique_ptr<FDREvaluator> create_evaluator(
52 std::shared_ptr<ProbabilisticTask> task,
53 std::shared_ptr<FDRCostFunction> task_cost_function) override;
54};
55
56} // namespace probfd::heuristics
57
58#endif // PROBFD_HEURISTICS_CONSTANT_EVALUATOR_H
The interface representing heuristic functions.
Definition mdp_algorithm.h:16
Returns an estimate of zero for each state.
Definition constant_evaluator.h:38
BlindEvaluator()
Construct with constant estimate value .
Definition constant_evaluator.h:43
Returns a constant estimate for each state.
Definition constant_evaluator.h:15
value_t evaluate(param_type< State >) const override
Evaluates the heuristic on a given state and returns the heuristic value.
Definition constant_evaluator.h:28
ConstantEvaluator(value_t value)
Construct with constant estimate value .
Definition constant_evaluator.h:22
This namespace contains heuristic implementations.
Definition additive_cartesian_heuristic.h:19
double value_t
Typedef for the state value type.
Definition aliases.h:7
typename std::conditional_t< is_cheap_to_copy_v< T >, T, const T & > param_type
Alias template defining the best way to pass a parameter of a given type.
Definition type_traits.h:25