13#if !defined(ULTRA_EVALUATOR_H)
14# error "Don't include this file directly, include the specific .h instead"
17#if !defined(ULTRA_EVALUATOR_TCC)
18#define ULTRA_EVALUATOR_TCC
26test_evaluator<I>::test_evaluator(test_evaluator_type et) : et_(et)
28 ultraDEBUG(
"Creating a new instance of test_evaluator {}",
29 std::to_underlying(et));
49double test_evaluator<I>::operator()(
const I &prg)
const
51 if (delay_ > std::chrono::milliseconds{0})
52 std::this_thread::sleep_for(delay_);
56 case test_evaluator_type::fixed:
59 case test_evaluator_type::random:
60 return random::sup<double>(1000000);
62 case test_evaluator_type::age:
63 return static_cast<double>(prg.age());
67 const auto signature(prg.signature());
68 return static_cast<double>(
static_cast<std::uint32_t
>(signature.data[0]));
93template<Evaluator E>
bool load_eva(std::istream &in, E *e)
95 if constexpr (
requires { { e->load(in) } -> std::convertible_to<bool>; })
123 if constexpr (
requires { { e.save(
out) } -> std::convertible_to<bool>; })
137template<Indiv
idual I>
138void test_evaluator<I>::delay(std::chrono::milliseconds ms)
noexcept
bool save_eva(std::ostream &out, const E &e)
Definition evaluator.tcc:121
bool load_eva(std::istream &in, E *e)
Definition evaluator.tcc:93