VIPRA Documentation
Loading...
Searching...
No Matches
selector_location.hpp
1#pragma once
2
3#include "vipra/logging/logging.hpp"
4#include "vipra/types/idx.hpp"
5
6#include "vipra/vipra_behaviors/selectors/subselector.hpp"
7
8namespace VIPRA::Behaviors {
13struct SelectorLocation {
14 NON_DEFAULT_CONSTRUCTIBLE(SelectorLocation)
15 COPYABLE(SelectorLocation)
16 MOVEABLE(SelectorLocation)
17
18 explicit SelectorLocation(VIPRA::idx loc) : location(loc) {}
19
20 VIPRA::idx location;
21 auto operator()(const VIPRA::idxVec& /*unused*/, const VIPRA::idxVec& group,
22 auto pack) const -> SelectorResult
23 {
24 auto const& loc = pack.context.locations[location];
25 size_t pedCnt = 0;
26 VIPRA::idxVec groupPeds;
27
28 for ( auto idx : group ) {
29 if ( loc.is_point_inside(pack.pedset.ped_coords(idx)) ) {
30 groupPeds.push_back(idx);
31 }
32 }
33
34 VIPRA::Log::debug("Selector Exaclty N: Selecting {} Pedestrians", pedCnt);
35
36 return {false, groupPeds};
37 }
38};
39} // namespace VIPRA::Behaviors
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
Result of a selection.
Definition subselector.hpp:17