AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
types.h
1#ifndef PROBFD_TYPES_H
2#define PROBFD_TYPES_H
3
4#include "downward/operator_id.h"
5#include "downward/state_id.h"
6
7#include <cstdint>
8#include <functional>
9#include <limits>
10#include <type_traits>
11
12namespace probfd {
13
22struct StateID {
23 using size_type = unsigned long long;
24 static constexpr size_type UNDEFINED =
25 std::numeric_limits<size_type>::max();
26
27 StateID(size_type id = StateID::UNDEFINED)
28 : id(id)
29 {
30 }
31
32 StateID(::StateID id)
33 : id(id.get_value())
34 {
35 }
36
37 operator ::StateID() const { return ::StateID(id); }
38
39 operator size_type() const { return id; }
40
41 size_type id;
42};
43
44} // namespace probfd
45
46inline auto operator<=>(OperatorID left, OperatorID right)
47{
48 return left.get_index() <=> right.get_index();
49}
50
51namespace std {
52
53template <>
54struct hash<probfd::StateID> {
55 size_t operator()(const probfd::StateID& sid) const
56 {
57 return hash<probfd::StateID::size_type>()(sid);
58 }
59};
60
61} // namespace std
62
63#endif // PROBFD_TYPES_H
The top-level namespace of probabilistic Fast Downward.
Definition command_line.h:8
STL namespace.
A StateID represents a state within a StateIDMap. Just like Fast Downward's StateID type,...
Definition types.h:22