5#include "vipra/geometry/f3d.hpp"
7#include "vipra/types/idx.hpp"
8#include "vipra/vipra_behaviors/definitions/pedestrian_types.hpp"
10namespace VIPRA::Behaviors {
28 static constexpr auto index(typeUID type) -> VIPRA::idx
36 while ( (check & type) == 0U ) {
47 [[nodiscard]]
auto size() const -> VIPRA::size;
49 [[nodiscard]] auto
at(VIPRA::idx) const -> VIPRA::idxVec const&;
50 [[nodiscard]] auto operator[](VIPRA::idx) -> VIPRA::idxVec&;
52 [[nodiscard]] auto
get_group(typeUID) const -> const VIPRA::idxVec&;
54 void add_ped(VIPRA::idx, typeUID);
55 void move_ped(VIPRA::idx, typeUID, typeUID);
58 auto
set_used(VIPRA::idx, typeUID) ->
bool;
59 [[nodiscard]] auto
get_used(typeUID) const -> std::vector<
bool> const&;
60 [[nodiscard]] auto is_used(VIPRA::idx, typeUID) const ->
bool;
63 std::vector<VIPRA::idxVec> _groups;
64 std::vector<std::vector<
bool>> _used;
Holds the indexes for pedestrians in each type group.
Definition pedestrian_groups.hpp:16
void add_ped(VIPRA::idx, typeUID)
Adds a pedestrians index to the group with type.
Definition pedestrian_groups.cpp:61
auto set_used(VIPRA::idx, typeUID) -> bool
Sets a pedestrian as _used in a particular group, this pedestrian can then no longer be selected from...
Definition pedestrian_groups.cpp:76
void initialize(Ptype, VIPRA::size)
Initializes the _groups, starting with all pedestrians in group 0.
Definition pedestrian_groups.cpp:33
auto size() const -> VIPRA::size
Returns the number of _groups.
Definition pedestrian_groups.cpp:153
auto at(VIPRA::idx) const -> VIPRA::idxVec const &
Gets the group at index.
Definition pedestrian_groups.cpp:143
void clean_used()
Resets _used status of all pedestrians.
Definition pedestrian_groups.cpp:106
static constexpr auto index(typeUID type) -> VIPRA::idx
Gets the index into the container for a given type.
Definition pedestrian_groups.hpp:28
auto get_used(typeUID) const -> std::vector< bool > const &
Returns vector of _used pedestrians from a group.
Definition pedestrian_groups.cpp:97
auto get_group(typeUID) const -> const VIPRA::idxVec &
Returns the group with a given type.
Definition pedestrian_groups.cpp:50
auto remove_ped(VIPRA::idx, typeUID) -> bool
Removes the pedestrian from the group with type.
Definition pedestrian_groups.cpp:114
Pedestrian Type, used as a composite of typeUIDs.
Definition pedestrian_types.hpp:23