swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Swarm limitation?


From: Brian George
Subject: Swarm limitation?
Date: Thu, 01 Aug 1996 23:30:59 -0400

To whom it may concern-

        I have been attempting to design a SugarScape simulation using Swarm.
Unfortunately, I haven't been able to come up with a way in which to
conveniently associate more than one value/object in a cell of a grid.
For example, in my simulation I have a number of items that could be
located at any postion in the world (the world is a Grid2d in all
likelihood, right?):

Items that could be at a discrete position in the world:
        bugs
        pollution
        resources (sugar, spice, etc...)

I could design this as in heatbugs, and have a Discrete2d object for
each group of items, i.e. a bugs grid, a pollution grid.  These grids
could then be displayed on a Lattice as in heatbugs.  The problem with
this approach is that it is not very extensible in that each new type of
item would require the user to define a new grid and "plug it in" to the
existing simulation.  This is not straightforward and involves messy
hacks into existing code (or at least it seems this way).

Another option would be to have a discrete grid of "MyCell" objects,
where each Cell would contain the bugs, the pollution, the resources,
etc.  In other words, all the data in one cell is encapsulated within a
single object (the MyCell object).  It would seem, however, that
problems arise when we start to think about how to display all this
information.  Because each resource is no longer in its own Discrete2d
object, there isn't any "automatic" method of display, is there?  Also,
it would be nice to be able to display, for example, only the bugs and
pollution on one lattice and the bugs and resources on another.  We
considered maintaining another external Discrete2d that contained copies
(or pointers or something) of the bugs, etc. contained in the cells.  In
this way, you could access the bugs, etc. not only from the Cells, but
also through this other Discrete2d object.  Unfortunately you run into
the same problem as above, namely an explosion in the number of seperate
classes and a lack of extensibility/maintainability.

Does anyone know of a good way to solve the problem of multiple values
per cell?  I hope that I've described my problem well enough that some
of you will have some ideas...I would guess that someone has had this
problem before, however.

Thank you in advance,
Brian George


reply via email to

[Prev in Thread] Current Thread [Next in Thread]