7-001 // Sugarscape in Swarm. Copyright © 1997 Nelson Minar
7-002 // This program is distributed without any warranty; without even the
7-003 // implied warranty of merchantability or fitness for a particular purpose.
7-004 // See file LICENSE for details and terms of copying.
7-005 
7-006 #import <objectbase/Swarm.h>
7-007 #import "SugarSpace.h"
7-008 #import "SugarAgent.h"
7-009 #import  <collections.h> // for ListShuffler
7-010 
7-011 
7-012 // The model swarm encapsulates all the objects that go into the Sugarscape
7-013 // model. In the simplest case, this is basically a list of agents, a
7-014 // sugarspace world, and various parameters.
7-015 
7-016 @interface ModelSwarm: Swarm
7-017 {
7-018   // Parameters for the model
7-019   int numAgents;
7-020   int alpha;					  // growth rate for sugar
7-021   int replacement;				  // use replacement rule?
7-022   int maxVision, maxMetabolism;
7-023   int minInitialSugar, maxInitialSugar;
7-024   int deathAgeMin, deathAgeMax;
7-025   int worldXSize, worldYSize;
7-026   char *datafile;
7-027 
7-028   // Objects in the list
7-029   id agentList;
7-030   id <ListShuffler> shuffler;
7-031   SugarSpace *sugarSpace;
7-032   id reaperQueue;
7-033 
7-034   // Schedule stuff
7-035 
7-036   id modelSchedule;
7-037 }
7-038 
7-039 // Methods to handle the agents in the world
7-040 - addNewRandomAgent;
7-041 - agentBirth: (SugarAgent *)agent;
7-042 - agentDeath: (SugarAgent *)agent;
7-043 
7-044 // Accessor functions
7-045 - (SugarSpace *)getSugarSpace;
7-046 - getAgentList;
7-047 
7-048 // Scheduling methods
7-049 - buildObjects;
7-050 - buildActions;
7-051 - activateIn: swarmContext;
7-052 
7-053  @end
