12struct SelectorPercent {
13 NON_DEFAULT_CONSTRUCTIBLE(SelectorPercent)
14 COPYABLE(SelectorPercent)
15 MOVEABLE(SelectorPercent)
17 explicit SelectorPercent(VIPRA::f_pnt pnt) : percentage(pnt) {}
19 VIPRA::f_pnt percentage;
20 auto operator()(std::vector<VIPRA::idx>
const& fullGroup,
21 std::vector<VIPRA::idx>
const& group,
auto pack)
const ->
SelectorResult
23 auto groupPeds = group;
25 auto count =
static_cast<VIPRA::size
>(
26 std::floor(percentage *
static_cast<VIPRA::f_pnt
>(fullGroup.size())));
29 if ( count > group.size() ) {
36 std::shuffle(groupPeds.begin(), groupPeds.end(), pack.context.engine);
37 groupPeds.resize(count);
39 return {starved, groupPeds};
static VIPRA_INLINE void debug(fmt::format_string< param_ts... > message, param_ts &&... params)
Calls the provided Logger with Level DEBUG.
Definition logging.hpp:85