swarm-support
[Top][All Lists]
Advanced

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

RE: [Swarm-Support] 3-D Representation


From: Mrinal Singh
Subject: RE: [Swarm-Support] 3-D Representation
Date: Wed, 16 Jul 2003 21:38:49 -0000

Hi
I am refering to 3dLib-0.1.tar.gz. I am attaching the readme file of the 3d 
demo. I am also attaching gif of the kind of representation I am looking 
for.

regards

                              3dDemo App

   This is a *very* simple demo to illustrate usage of the Discrete3d
class.  It fully implements and uses a 3d discrete space.  The code is
commented only in places where using this space would be different
from how a Discrete2d might be used.  Hence, if you see a piece of
code in this demo that you don't understand and is not commented, you
will find very good explanations in one of the other demos.  The
comments of interest begin with "// 3d-specific:".

   The problem that naturally accompanies a class like this is how to
visualize that space.  This is a complex issue and no attempt to solve
it was made in this demo or in the 3dLib.  Sometime later, this
problem will be addressed in a general way.

   What is in place in this demo is a projection of all the agents
onto the (x,y) plane, which is displayed by the raster.  This makes
probing on the fly impossible because the Object2dDisplay sends a
"getObjectAtX:Y:" message to the space in order to make a probe for
that object.  There are a number of ways to get around this and retain
the projection visualization.

   Probing on the fly could be handled by sub-classing from
Object2dDisplay and creating a method that is capable of taking slices
out of the 3d space.  All that would be required is a method that
dynamically built a collection of agents that reside on that slice at
any given time step, then perform a makeProbe on each agent in that
collection.

   Or, if one desires a probe at any given (x,y), the subclass of
Object2dDisplay could provide a method that accepted a collection from
the "getObjectAtX:Y:" message to the space.  Then the collection would
have to be parsed and each member probed.  This would be like taking a
linear subspace of the 3d space.


Other noteworthy peculiarities:

  - A neighborhood of an agent is the 3d equivalent of a 2d Moore
neighborhood.  That means that an agent can move from where it is to
any of 9*3 surrounding cells (including the one it's currently in).

  - A "trail-duster" was added to the agents so that they cache the
spot they occupied last iteration and blacken it each time they move.
This results in some loss of data if one agent occludes another then
moves out of the way in the next iteration.  If that movement happens
after the occluded agent draws itself on the raster, the agent that
did the occluding will blacken the cell, thereby showing a black cell
even though there's an agent back there somewhere.  This is trivial to
fix; but, it serves as an example of the type of problems 3d
visualization presents.


   This is just a contribution to give others an idea of how they can
implement a 3d space.  It is by no means the last word on 3d spaces.



-----Original Message-----
From:   Paul E. Johnson [SMTP:address@hidden
Sent:   Wednesday, July 16, 2003 8:02 PM
To:     address@hidden
Subject:        Re: [Swarm-Support] 3-D Representation

Mrinal Singh wrote:

>I kind of went over glen's 3-d lib. But I am using a swarm binary and the
>patch does not work? Should download the source and build and then patch
>(eeeeks 8-) or there any other solutions. Will this solve my primary
>problem in the first place?
>
>
I don't know about that library. What features does it provide?

--
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ukans.edu/~pauljohn
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66045                FAX: (785) 864-5700


_______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support

GIF image


reply via email to

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