Class MultiGrid1D

Inheritance Relationships

Base Type

Class Documentation

class MultiGrid1D : public kami::Grid1D

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

The grid is linear and may wrap around in its only dimension.

See also

Grid1D

See also

SoloGrid1D

Public Functions

MultiGrid1D(unsigned int maximum_x, bool wrap_x)

Constructor.

Parameters
  • maximum_x[in] the length of the grid.

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

virtual AgentID add_agent(AgentID agent_id, const GridCoord1D &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