[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Editing Observer Swarm. Can you tell me this?
From: |
Paul E. Johnson |
Subject: |
Editing Observer Swarm. Can you tell me this? |
Date: |
Tue, 26 Jan 1999 17:27:35 -0600 |
I'm working with a space that is ten dimensional, and I want to display
it two dimensions at a time in 5 2D objects of the familiar sort:
zoomRasters that have Object2dDisplays mapped onto them.(heatbugs etc).
Of course I could create a series of named rasters and spaces, but I'm
thinking of doing it in a way that is scalable, so I can create spaces
in a loop and add them to the end of "spaceLists" (the way we create
agents and add them to lists, for example). Before I write all this
code out, I figured I'd check with y'all to see if there is some big
mistake I'm going to make in the Scheduling (buildActions) sections of
the code.
If you can consider an out-of-context code snippit, suppose you've got
something like this in buildActions in ObserverSwarm. From buildObjects,
we already have 2 graphs (instabilityGraph,stabilityGraph), 2 rasters
(worldRaster and proposalRaster), and 3 Object2dDisplays (voterDisplay,
policyDisplay,proposalDisplay). (2 of the Object2dDisplays get sent to
one of the rasters). The buildActions schedules their updates like so::
displayActions = [ActionGroup create: [self getZone]];
[displayActions createActionTo: instabilityGraph message:
M(step)];
[displayActions createActionTo: stabilityGraph message:
M(step)];
[displayActions createActionTo: voterDisplay message:
M(display)];
[displayActions createActionTo: policyDisplay message:
M(display)];
[displayActions createActionTo: proposalDisplay message:
M(display)];
[displayActions createActionTo: worldRaster message:
M(drawSelf)];
[displayActions createActionTo: proposalRaster message:
M(drawSelf)];
Suppose that earlier in the code I created lists, a "rasterList", a
"Object2dList" and a "graphList" and add the above objects to them.
Then is there any reason it would not work to rewrite the codesnippit
as:
displayActions = [ActionGroup create: [self getZone]];
[displayActions createActionForEach: graphList message:
M(step)];
[displayActions createActionForEach: Object2dList message:
M(display)];
[displayActions createActionForEach: rasterList message:
M(drawSelf)];
??
--
Paul E. Johnson email: address@hidden
Dept. of Political Science http://lark.cc.ukans.edu/~pauljohn
University of Kansas Office: (913) 864-9086
Lawrence, Kansas 66045 FAX: (913) 864-5700
==================================
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.
- Editing Observer Swarm. Can you tell me this?,
Paul E. Johnson <=