swarm-support
[Top][All Lists]
Advanced

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

Re: [Swarm-Support] MoGrid2d in SugarScape


From: Paul Johnson
Subject: Re: [Swarm-Support] MoGrid2d in SugarScape
Date: Wed, 03 Jun 2009 14:50:30 -0500
User-agent: Thunderbird 2.0.0.21 (X11/20090409)

Lord Jim wrote:
> Hello,
> 
> did any of you come across an implementation of the class "MoGrid2d" (by Sven 
> Thommesen available in langtonAntSpace-1.3-Swarm-2.1.141), to allow multiple 
> occupancy by agents, in SugarScape?
> And\or, do you think it is feasible?
> Thanks in advance, and thanks for your answers on "torus" topic,
> Greets
> Antonio Catalano
> Master in Cognitive Systems and Interactive Media UPF
> 
> 
>       
> 
> 

I don't know if it would make much difference, except for depleting your
food faster.  But it would be a fun project to find out.

I think Sven had a good idea with MoGrid2d, but it was not as thorough
as I needed.  I developed a much more elaborate version of that same
thing, MultiGrid2d.  And I've used it in several programs, it would be
easy to substitute it into the sugarscape if you want. One of the
enhancements I made was to allow the class of each cell to be
customized, so you can control the type of collection stored there as
well as allowing the cells to answer requests for information (for
example, from rasters).

 I have a recollection of uploading it to the swarm ftp at one time.
But it is probably better if you just look at an example.

Example usages of that are:

http://pj.freefaculty.org/Swarm/MySwarmCode/OpinionFormation/Opinion-2.0.1.tar.gz


http://pj.freefaculty.org/Swarm/MySwarmCode/SocialImpact/SocialImpact-20030224.tar.gz

I put in lots and lots of comments that can be extracted if anybody on
earth still has a working version of the Appkit ObjC document builder :)


Look for:

MultiGrid2d.[hm]

the top level class, the one you substitute in place of Grid2d

MultiGridCell

the generic class that holds objects in a spot, which can be customized,
as for example, I do with the class

AppSpecificCell.

Read the ModelSwarm to see how the grid and the customized cells are
created.

At one time, I was working on a project that ran very slowly because
Swarm lists are slow to find specific objects.  To speed that up, a
binary search tree class AVLSet was created and it, at least in theory,
is much faster at finding particular objects (but at the price of being
slower at insertion of objects).  I don't recall that the speedup was so
immense as I'd hoped.







-- 
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://pj.freefaculty.org
1541 Lilac Lane, Rm 504
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66044-3177           FAX: (785) 864-5700


reply via email to

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