Class SoloGrid2D

Inheritance Relationships

Base Type

Class Documentation

class SoloGrid2D : 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

MultiGrid2D

Public Functions

SoloGrid2D(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

false if the agent is not placed at the specified location, otherwise, true