swarm.space
Class DblBuffer2dImpl

java.lang.Object
  |
  +--swarm.BaseImpl
        |
        +--swarm.space.DblBuffer2dImpl

public class DblBuffer2dImpl
extends BaseImpl
implements Discrete2d, Discrete2dS, DblBuffer2dS, DblBuffer2d

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.


Constructor Summary
DblBuffer2dImpl()
           
DblBuffer2dImpl(Zone aZone)
          The create: message creates a new instance of a type with default options.
DblBuffer2dImpl(Zone aZone, int x, int y)
          Convenience constructor for Discrete2d lattice
 
Methods implemented by this class for interface swarm.space.Discrete2d
copyDiscrete2d$toDiscrete2d, fastFillWithObject, fastFillWithValue, fillWithObject, fillWithValue, putObject$atX$Y, putValue$atX$Y, setDiscrete2d$toFile
 
Methods implemented by this class for interface swarm.space.Discrete2dS
setObjectFlag
 
Methods implemented by this class for interface swarm.space.DblBuffer2d
putObject$atX$Y, putValue$atX$Y, updateLattice
 
Methods implemented by this class for interface swarm.objectbase.SwarmObject
getCompleteProbeMap, getProbeForMessage, getProbeForVariable, getProbeMap
 
Methods implemented by this class for interface swarm.space.GridData
getObjectAtX$Y, getSizeX, getSizeY, getValueAtX$Y
 
Methods implemented by this class for interface swarm.defobj.Drop
drop
 
Methods implemented by this class for 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
 
Methods implemented by this class for interface swarm.defobj.GetName
getName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DblBuffer2dImpl

public DblBuffer2dImpl()

DblBuffer2dImpl

public DblBuffer2dImpl(Zone aZone,
                       int x,
                       int y)
Convenience constructor for Discrete2d lattice

DblBuffer2dImpl

public DblBuffer2dImpl(Zone aZone)
The create: message creates a new instance of a type with default options. The zone argument specifies the source of storage for the new object. The receiving object of this message is a previously defined type object. The message is declared as a class message (with a + declaration tag) to indicate that the message is accepted only by the type object itself rather than an already created instance of the type (which a - declaration tag otherwise defines). The create: message returns the new object just created. This object is an instance of some class selected to implement the type. The class which a type selects to implement an object may be obtained by the getClass message, but is not otherwise visible to the calling program. A caller never refers to any class name when creating objects using these messages, only to type names, which are automatically published as global constants from any @protocol declaration.