Class MultiGrid2D

Inheritance Relationships

Base Type

Class Documentation

class MultiGrid2D : public kami::Grid2D

A two-dimensional grid where each cell may contain multiple agents.

The grid is linear and may wrap around in either dimension.

See also

Grid2D

See also

SoloGrid2D

Public Functions

MultiGrid2D(unsigned int maximum_x, unsigned int maximum_y, bool wrap_x, bool wrap_y)

Constructor.

Parameters
  • maximum_x[in] the length of the grid in the first dimension

  • maximum_y[in] the length of the grid in the second dimension

  • wrap_x[in] should the grid wrap around on itself in the first dimension

  • wrap_y[in] should the grid wrap around on itself in the second dimension

virtual AgentID add_agent(AgentID agent_id, const GridCoord2D &coord) override

Place agent on the grid at the specified location.

Parameters
  • agent_id[in] the AgentID of the agent to add.

  • coord[in] the coordinates of the agent.

Returns

the AgentID of the agent added