AIToolbox
A library that offers tools for AI problem solving.
|
Go to the documentation of this file. 1 #ifndef AI_TOOLBOX_TYPE_TRAITS_HEADER_FILE
2 #define AI_TOOLBOX_TYPE_TRAITS_HEADER_FILE
15 template <
typename CopiedType,
typename ConstReference>
17 using type =
typename std::conditional_t<std::is_const_v<ConstReference>,
18 std::add_const_t<CopiedType>,
19 std::remove_const_t<CopiedType>>;
21 template <
typename CopiedType,
typename ConstReference>
27 template <
typename A,
typename B>
35 { m[0][0] } -> std::convertible_to<double>;
43 { m[0][0][0] } -> std::convertible_to<double>;
51 { t[0][0] } -> std::convertible_to<long unsigned>;
59 { t[0][0][0] } -> std::convertible_to<long unsigned>;
77 { m.getS() } -> different_from<void>;
85 { m.getA() } -> different_from<void>;
93 { m.getA(m.getS()) } -> different_from<void>;
105 template <
typename M>
107 { m.getO() } -> different_from<void>;
113 template <
typename M>
115 { m.getS() } -> std::same_as<size_t>;
121 template <
typename M>
124 (HasFixedActionSpace<M> && requires {{ m.getA() } -> std::same_as<size_t>; }) ||
125 (HasVariableActionSpace<M> && requires {{ m.getA(m.getS()) } -> std::same_as<size_t>; });
131 template <
typename M>
133 { m.getO() } -> std::same_as<size_t>;
158 template <
typename M>
160 { m.getDiscount() } -> std::convertible_to<double>;
161 { m.isTerminal(m.getS()) } -> std::convertible_to<bool>;
164 (HasFixedActionSpace<M> && requires {{ m.sampleSR(m.getS(), m.getA()) } -> std::convertible_to<std::tuple<std::remove_cvref_t<decltype(m.getS())>,
double>>; }) ||
165 (HasVariableActionSpace<M> && requires {{ m.sampleSR(m.getS(), m.getA(m.getS())) } -> std::convertible_to<std::tuple<std::remove_cvref_t<decltype(m.getS())>,
double>>; });