In Swarm, spaces are really just another kind of agent. In the heatbugs model we create a HeatSpace, a subclass of a diffusion object from the Swarm space libaries (specified in HeatSpace.m). Here is the code from buildObjects in the HeatbugModelSwarm.
heat = [HeatSpace createBegin: [self getZone]]; [heat setSizeX: worldXSize Y: worldYSize]; [heat setDiffusionConstant: diffuseConstant]; [heat setEvaporationRate: evaporationRate]; heat = [heat createEnd]; |
the object is created, a few parameters are set, and then the creation is finalized.