swarm.space
Interface DblBuffer2dC
- All Known Subinterfaces:
- Ca2dC, ConwayLife2dC, Diffuse2dC
- All Known Implementing Classes:
- DblBuffer2dCImpl
- public interface DblBuffer2dC
- extends Discrete2dS, Discrete2dC
A double buffered space..
DblBuffer2d augments Discrete2d to provide a form of double buffered space. Two lattices are maintained: lattice (the current state), and newLattice (the future state). All reads take place from lattice, all writes take place to newLattice. newLattice is copied to lattice when updateLattice is called. DblBuffer2d can be used to implement one model of concurrent action, like in Ca2ds. NOTE: be very careful if you're using low-level macro access to the world, in particular be sure that you preserve the write semantics on the newLattice.
create$setSizeX$Y
public Object create$setSizeX$Y(Zone aZone,
int x,
int y)
- Convenience constructor for DblBuffer lattice
- Specified by:
- create$setSizeX$Y in interface Discrete2dC
createEnd
public Object createEnd()
- Rewrites the method from Discrete2d. Allocate two lattices, makes the offsets.
- Specified by:
- createEnd in interface Discrete2dC