| 14 | // priors: a chain draft stands 70% of the time (as alone), a lookup 80% (a match tends to run on) |
| 15 | constexpr double CHAIN_PRIOR = 0.7, LOOKUP_PRIOR = 0.8; |
| 16 | double ms_since(std::chrono::steady_clock::time_point t0) { |
| 17 | return std::chrono::duration<double, std::milli>(std::chrono::steady_clock::now() - t0).count(); |
| 18 | } |
| 19 | std::vector<int> tail(const std::vector<int>& v, int n) { |
| 20 | return std::vector<int>(v.size() > (size_t) n ? v.end() - n : v.begin(), v.end()); |
| 21 | } |