1#ifndef FPMAS_GRID_AGENT_MAPPING_G
2#define FPMAS_GRID_AGENT_MAPPING_G
14namespace fpmas {
namespace model {
15 using api::model::DiscretePoint;
29 std::unordered_map<DiscreteCoordinate, std::unordered_map<DiscreteCoordinate, std::size_t>> count_map;
52 template<
typename DistributionX,
typename DistributionY>
56 std::size_t agent_count
66 template<
typename DistributionX,
typename DistributionY>
70 std::size_t agent_count) {
72 for(std::size_t i = 0; i < agent_count; i++) {
74 count_map[p.x][p.y]++;
99 std::size_t agent_count
118 std::unordered_map<DiscreteCoordinate, std::unordered_map<DiscreteCoordinate, std::size_t>>
138 std::size_t agent_count,
139 std::size_t max_agent_by_cell
virtual DiscretePoint location() const =0
Definition: spatial_model.h:656
Definition: grid_agent_mapping.h:116
ConstrainedGridAgentMapping(DiscreteCoordinate grid_width, DiscreteCoordinate grid_height, std::size_t agent_count, std::size_t max_agent_by_cell)
Definition: grid_agent_mapping.cpp:6
std::size_t countAt(api::model::GridCell *cell) override
Definition: grid_agent_mapping.cpp:64
Definition: grid_agent_mapping.h:27
RandomGridAgentMapping(DistributionX &&x, DistributionY &&y, std::size_t agent_count)
Definition: grid_agent_mapping.h:67
std::size_t countAt(api::model::GridCell *cell) override
Definition: grid_agent_mapping.h:59
long DiscreteCoordinate
Definition: grid.h:15
Distribution< std::uniform_int_distribution< IntType > > UniformIntDistribution
Definition: distribution.h:78
DiscreteCoordinate x
Definition: grid.h:25
DiscreteCoordinate y
Definition: grid.h:29
static random::mt19937_64 rd
Definition: spatial_agent_mapping.h:31