swarm-support
[Top][All Lists]
Advanced

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

Re: Mining sugarscape


From: Paul E Johnson
Subject: Re: Mining sugarscape
Date: Tue, 25 Jul 2000 15:00:32 -0500

Sharon Gifford wrote:
> 
> I want to adapt sugarscape so that after an agent visits a site, it continues 
> to generate "sugar" for that agent, as if the agent had set up an ongoing 
> mining operation that continues to operate while the agent leaves to explore 
> for additional sites.  However, others can also mine the same site, reducing 
> the amount of sugar available for others who mine the site.  Each agent can 
> return to the site to improve the performance of that agent's mine.  I have 
> the Multi2D files for multiple occupancy, and will probably use a listOfMines 
> like the listOfFriends in hello-world to keep track of each agent's mines.  
> However, each cite now seems to be an object itself, whose behavior changes 
> each period depending on how many agents have visited it.  Is it best to 
> create a pair of .h and .m files for a class of "cites" objects?  Has anyone 
> done anything like this before.  I'm still a novice with Swarm and very 
> afraid to try this alone.
> 
> Sharon
> 
> Prof. Sharon Gifford
> Faculty of Management
> Department of Finance and Economics
I am not sure which Multi2d you have, but let me say this. Sven did a
multi-occupancy grid, that I updated and enhanced and called
"WrappedListGrid" and I think it is in Swarm's ftp site (but not in
their graphical interface http thing.).  This might be the ideal
approach for your project.  It has a Grid, and in each Grid location
there is a multi-purpose object.  That multi-purpose object is of type
"ApplicationSpecific", meaning you say what it does/is.  THe generic
multi-object functions are performed by ApplicationSpecific with methods
it inherits from a generic class I include called "ListWrapper", meaning
a wrapper around a list.  It is the thing that holds a list of the
objects in that cell, and it can count them, get them, etc.  You Write
whatever details you need into the ApplicationSPecific class, and then
you interact with those objects through the interface defined by
WrappedListGrid.

I have a bad tendency to create names that make sense only to me.  That
is on top of Sven's tendency to make names that only make sense to him
:) (sorry, ST).  But if you look at this just a bit, or study the
example application "culture" application, you will see what I mean.

I think it is  in the swarm ftp as well, but I keep a copy here too:

http://lark.cc.ukans.edu/~pauljohn/Swarm/MySwarmCode/cultureWrappedListBatchRaster-990823.tar.gz
Lately a windows user notified me that model crashes at quit time
because it does not have enableDestroyNotification in the observer swarm
(compare to heatbugs), but otherwise I don't know of any significant
problems.

-- 
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

                  ==================================
   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.



reply via email to

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