Documentation Set for Swarm 2.2
Prev | Chapter 4. Mag 4x:Sketch of Code | Next

# 4.4. Building Space objects

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.

Prev | Home | Next
Building Agents | Up | Scheduling a Model Swarm