Documentation Set for Swarm 2.2
Prev | Reference X. Space Library | Next

# Grid2d

## Name

Grid2d -- A 2d container class for agents.

## Description

Grid2d is a generic container class to represent agent position on a 2d lattice. It gets most of its behaviour from Discrete2d, adding extra code to check that you don't overwrite things by accident. Grid2d is pretty primitive: only one object can be stored at a site, no boundary conditions are implied, etc.

## Protocols adopted by Grid2d

Discrete2d CREATABLE

## Methods

### Phase: Using

- - setOverwriteWarnings: (BOOL)b
  If set to true, then if you try to store something at a site that doesn't have 0x0 there, a warning will be generated.

- - putObject: anObject atX: (unsigned)x Y: (unsigned)y
  Replaces the Discrete2d method. First check to see if it should do overwrite warnings, and if so if you're going to overwrite: if both conditions are true, print out a warning message. Regardless of the check, it writes the new object in.

Prev | Home | Next
Discrete2d | Up | GridData