swarm.space
Interface Grid2d
- All Known Implementing Classes:
- Grid2dImpl
- public abstract interface Grid2d
- extends Discrete2dS, Discrete2d
A 2d container class for agents..
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.
Methods inherited from interface swarm.space.Discrete2d |
copyDiscrete2d$toDiscrete2d,
fastFillWithObject,
fastFillWithValue,
fillWithObject,
fillWithValue,
getObjectAtX$Y,
getSizeX,
getSizeY,
getValueAtX$Y,
putValue$atX$Y,
setDiscrete2d$toFile |
Methods inherited from interface swarm.defobj.Drop |
drop |
Methods inherited from interface swarm.defobj.DefinedObject |
compare,
describe,
describeID,
getDisplayName,
getTypeName,
getZone,
perform,
perform$with,
perform$with$with,
perform$with$with$with,
respondsTo,
setDisplayName,
xfprint,
xfprintid,
xprint,
xprintid |
putObject$atX$Y
public Object putObject$atX$Y(Object anObject,
int x,
int 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.
- Specified by:
- putObject$atX$Y in interface Discrete2d
setOverwriteWarnings
public Object setOverwriteWarnings(boolean 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.