[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Running Village4-1 under Swarm 1.0.5
From: |
Marcus G. Daniels |
Subject: |
Re: Running Village4-1 under Swarm 1.0.5 |
Date: |
19 Jan 1998 09:49:08 -0800 |
FWIW, these are my changes to Village4 to get it in sync swarm-1.0.5.
Index: Agent.h
===================================================================
RCS file: /opt/src/hive/cvs/Swarm/village/Agent.h,v
retrieving revision 1.1.1.1
retrieving revision 1.3
diff -c -r1.1.1.1 -r1.3
*** Agent.h 1996/10/01 15:13:12 1.1.1.1
--- Agent.h 1998/01/15 22:30:44 1.3
***************
*** 2,8 ****
// 08-16-95 the Swarm room
// variables and methods of agent class
! #import <swarmobject.h>
#import <collections.h>
#import <simtools.h>
#import <space.h>
--- 2,8 ----
// 08-16-95 the Swarm room
// variables and methods of agent class
! #import <objectbase.h>
#import <collections.h>
#import <simtools.h>
#import <space.h>
***************
*** 115,121 ****
--- 115,123 ----
-(int) getMaizeStorage;
-(int) getFarmPlAt: (int) i;
-(int) getYield;
+ #if 0
-(int) getState;
+ #endif
-(int) getMaxStore;
// extra display code, to be removed
Index: AgentModelSwarm.h
===================================================================
RCS file: /opt/src/hive/cvs/Swarm/village/AgentModelSwarm.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
*** AgentModelSwarm.h 1996/10/01 15:13:13 1.1.1.1
--- AgentModelSwarm.h 1997/12/17 18:47:05 1.2
***************
*** 1,7 ****
// AgentModelSwarm.h
// swarm room 1996
! #import <swarmobject.h>
#import <space.h>
#import <activity.h>
#import <collections.h>
--- 1,7 ----
// AgentModelSwarm.h
// swarm room 1996
! #import <objectbase.h>
#import <space.h>
#import <activity.h>
#import <collections.h>
Index: AgentObserverSwarm.h
===================================================================
RCS file: /opt/src/hive/cvs/Swarm/village/AgentObserverSwarm.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -c -r1.2 -r1.3
*** AgentObserverSwarm.h 1997/02/11 15:13:06 1.2
--- AgentObserverSwarm.h 1997/12/17 18:47:05 1.3
***************
*** 1,7 ****
// AgentObserverSwarm.h
// Swarm room 1996
! #import <swarmobject.h>
#import <space.h>
#import <activity.h>
#import <tkobjc.h>
--- 1,7 ----
// AgentObserverSwarm.h
// Swarm room 1996
! #import <objectbase.h>
#import <space.h>
#import <activity.h>
#import <tkobjc.h>
Index: AgentObserverSwarm.m
===================================================================
RCS file: /opt/src/hive/cvs/Swarm/village/AgentObserverSwarm.m,v
retrieving revision 1.2
retrieving revision 1.4
diff -c -r1.2 -r1.4
*** AgentObserverSwarm.m 1997/02/11 15:13:07 1.2
--- AgentObserverSwarm.m 1998/01/15 22:30:44 1.4
***************
*** 57,64 ****
return self;
}
! +setAgentModelSwarmProbeMap: (id) aZone {
! ProbeMap * probeMap;
probeMap = [EmptyProbeMap createBegin: aZone];
[probeMap setProbedClass: [AgentModelSwarm class]];
--- 59,67 ----
return self;
}
! + setAgentModelSwarmProbeMap: aZone
! {
! id <ProbeMap> probeMap;
probeMap = [EmptyProbeMap createBegin: aZone];
[probeMap setProbedClass: [AgentModelSwarm class]];
***************
*** 114,121 ****
return self;
}
! +setAgentProbeMap: (id) aZone {
! ProbeMap * probeMap;
probeMap = [EmptyProbeMap createBegin: aZone];
[probeMap setProbedClass: [Agent class]];
probeMap = [probeMap createEnd];
--- 118,126 ----
return self;
}
! + setAgentProbeMap: aZone
! {
! id <ProbeMap> probeMap;
probeMap = [EmptyProbeMap createBegin: aZone];
[probeMap setProbedClass: [Agent class]];
probeMap = [probeMap createEnd];
***************
*** 167,174 ****
// Now create probe objects on the model and ourselves. This gives a
// simple user interface to let the user change parameters.
! [probeDisplayManager createProbeDisplayFor: agentModelSwarm];
! [probeDisplayManager createProbeDisplayFor: self];
// Instruct the control panel to wait for a button event: we halt here
// until someone hits a control panel button so the user can get a
--- 174,181 ----
// Now create probe objects on the model and ourselves. This gives a
// simple user interface to let the user change parameters.
! CREATE_ARCHIVED_PROBE_DISPLAY (agentModelSwarm);
! CREATE_ARCHIVED_PROBE_DISPLAY (self);
// Instruct the control panel to wait for a button event: we halt here
// until someone hits a control panel button so the user can get a
***************
*** 218,224 ****
[[agentModelSwarm getAgentList] forEach: M(setColor:) : (void *) 200];
// Next, create a 2d window for display, set its size, zoom factor, title.
! worldRaster = [ZoomRaster create: [self getZone]];
[worldRaster setColormap: colormap];
[worldRaster setZoomFactor: zoomFactor];
[worldRaster setWidth: [[agentModelSwarm getWorld] getSizeX]
--- 225,234 ----
[[agentModelSwarm getAgentList] forEach: M(setColor:) : (void *) 200];
// Next, create a 2d window for display, set its size, zoom factor, title.
! worldRaster = [ZoomRaster createBegin: [self getZone]];
! SET_WINDOW_GEOMETRY_RECORD_NAME (worldRaster);
! worldRaster = [worldRaster createEnd];
!
[worldRaster setColormap: colormap];
[worldRaster setZoomFactor: zoomFactor];
[worldRaster setWidth: [[agentModelSwarm getWorld] getSizeX]
***************
*** 252,257 ****
--- 262,268 ----
if (GRAPH) {
// Create the graph widget to display num plots
avgGraph = [EZGraph createBegin: [self getZone]];
+ SET_WINDOW_GEOMETRY_RECORD_NAME (avgGraph);
[avgGraph setTitle: "Average size of plots and family vs. time"];
[avgGraph setAxisLabelsX: "time" Y: "average size"];
avgGraph = [avgGraph createEnd];
***************
*** 268,273 ****
--- 279,285 ----
// Create the graph widget to display yield
yieldGraph = [EZGraph createBegin: [self getZone]];
+ SET_WINDOW_GEOMETRY_RECORD_NAME (yieldGraph);
[yieldGraph setTitle: "Yields Actual/Average vs. time"];
[yieldGraph setAxisLabelsX: "time" Y: "yield"];
yieldGraph = [yieldGraph createEnd];
***************
*** 284,289 ****
--- 296,302 ----
// Create the graph widget to display num plots
popGraph = [EZGraph createBegin: [self getZone]];
+ SET_WINDOW_GEOMETRY_RECORD_NAME (popGraph);
[popGraph setTitle: "Number Households Simulated/Estimated vs. time"];
[popGraph setAxisLabelsX: "time" Y: "households"];
popGraph = [popGraph createEnd];
***************
*** 303,309 ****
// Probes can also be created on the fly, we just do this here for demo.
agentToProbe = [[[agentModelSwarm getAgentList] begin: [self getZone]]
next];
[agentToProbe setColor: 202];
! [probeDisplayManager createProbeDisplayFor: agentToProbe];
// All done - we're ready to build a schedule and go.
return self;
--- 316,322 ----
// Probes can also be created on the fly, we just do this here for demo.
agentToProbe = [[[agentModelSwarm getAgentList] begin: [self getZone]]
next];
[agentToProbe setColor: 202];
! CREATE_ARCHIVED_PROBE_DISPLAY (agentToProbe);
// All done - we're ready to build a schedule and go.
return self;
***************
*** 343,349 ****
// Finally, schedule an update for the whole user interface code.
// This is crucial: without this, no graphics update and the control
// panel will be dead. It's best to put it at the end of the display
schedule
! [displayActions createActionTo: controlPanel message: M(doTkEvents)];
// And the display schedule. Note the repeat interval is set from our
// own Swarm data structure. Display is frequently the slowest part of a
--- 357,363 ----
// Finally, schedule an update for the whole user interface code.
// This is crucial: without this, no graphics update and the control
// panel will be dead. It's best to put it at the end of the display
schedule
! [displayActions createActionTo: actionCache message: M(doTkEvents)];
// And the display schedule. Note the repeat interval is set from our
// own Swarm data structure. Display is frequently the slowest part of a
Index: Cell.h
===================================================================
RCS file: /opt/src/hive/cvs/Swarm/village/Cell.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
*** Cell.h 1996/10/01 15:13:12 1.1.1.1
--- Cell.h 1997/12/17 18:47:06 1.2
***************
*** 2,8 ****
// 10-01-95 the Swarm room
// variables and methods for cell class
! #import <swarmobject.h>
#import <space.h>
#import <collections.h>
#import <tkobjc/Raster.h>
--- 2,8 ----
// 10-01-95 the Swarm room
// variables and methods for cell class
! #import <objectbase.h>
#import <space.h>
#import <collections.h>
#import <tkobjc/Raster.h>
Index: DataBase.h
===================================================================
RCS file: /opt/src/hive/cvs/Swarm/village/DataBase.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
*** DataBase.h 1996/10/01 15:13:12 1.1.1.1
--- DataBase.h 1997/12/17 18:47:06 1.2
***************
*** 2,8 ****
// 11-11-95
// place holder for the database soon to be driving the model with real world
data
! #import <swarmobject.h>
#import <simtools.h> // rngs
#import <math.h>
#import <stdio.h>
--- 2,8 ----
// 11-11-95
// place holder for the database soon to be driving the model with real world
data
! #import <objectbase.h>
#import <simtools.h> // rngs
#import <math.h>
#import <stdio.h>
Index: Exchange.h
===================================================================
RCS file: /opt/src/hive/cvs/Swarm/village/Exchange.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
*** Exchange.h 1996/10/01 15:13:13 1.1.1.1
--- Exchange.h 1997/12/17 18:47:07 1.2
***************
*** 2,8 ****
// the Swarm room
// variables and methods for exchange class
! #import <swarmobject.h>
#import <collections.h>
typedef struct trader{
--- 2,8 ----
// the Swarm room
// variables and methods for exchange class
! #import <objectbase.h>
#import <collections.h>
typedef struct trader{
Index: Exchange.m
===================================================================
RCS file: /opt/src/hive/cvs/Swarm/village/Exchange.m,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
*** Exchange.m 1996/10/01 15:13:13 1.1.1.1
--- Exchange.m 1997/12/17 18:47:07 1.2
***************
*** 4,9 ****
--- 4,11 ----
#import "Exchange.h"
+ #include <stdlib.h>
+
@implementation Exchange
Index: Makefile
===================================================================
RCS file: /opt/src/hive/cvs/Swarm/village/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -c -r1.2 -r1.3
*** Makefile 1997/02/11 15:13:09 1.2
--- Makefile 1997/12/17 18:47:07 1.3
***************
*** 1,4 ****
! SWARMHOME=../swarm-1.0.0
APPLICATION=vila4
OBJECTS=Agent.o Exchange.o Cell.o AgentModelSwarm.o AgentObserverSwarm.o
DataBase.o main.o
APPLIBS=-lspace
--- 1,6 ----
! ifeq ($(SWARMHOME),)
! SWARMHOME=../swarm
! endif
APPLICATION=vila4
OBJECTS=Agent.o Exchange.o Cell.o AgentModelSwarm.o AgentObserverSwarm.o
DataBase.o main.o
APPLIBS=-lspace
Index: main.m
===================================================================
RCS file: /opt/src/hive/cvs/Swarm/village/main.m,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
*** main.m 1996/10/01 15:13:12 1.1.1.1
--- main.m 1998/01/15 22:30:45 1.2
***************
*** 25,31 ****
if (swarmGUIMode == 1) {
// We've got graphics, so make a full ObserverSwarm to get GUI objects
! observerSwarm = [AgentObserverSwarm create: globalZone];
[observerSwarm buildObjects];
[observerSwarm buildActions];
[observerSwarm activateIn: nil];
--- 25,34 ----
if (swarmGUIMode == 1) {
// We've got graphics, so make a full ObserverSwarm to get GUI objects
! observerSwarm = [AgentObserverSwarm createBegin: globalZone];
! SET_WINDOW_GEOMETRY_RECORD_NAME (observerSwarm);
! observerSwarm = [observerSwarm createEnd];
!
[observerSwarm buildObjects];
[observerSwarm buildActions];
[observerSwarm activateIn: nil];
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.
==================================