swarm-support
[Top][All Lists]
Advanced

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

Re: [Swarm-Support] Heatbug code question


From: Paul Johnson
Subject: Re: [Swarm-Support] Heatbug code question
Date: Mon, 15 Nov 2004 10:25:28 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922

I agree with the spirit of your question. It can be done either way. I think we should consider re-designing Heatbugs to have the agents make that calculation. It would be more in tune with the agent-based philosophy.

It does not happen in this model, but there is a potential benefit to having the HeatSpace make the calculation. There is a major slow-down if each agent searches each cell finding what's best. In some models, you can have the space calculate various values and give them to the agents and if you write the model "just so", it avoids repeated calculations. That's the idea behind this code:

http://lark.cc.ku.edu/~pauljohn/Swarm/MySwarmCode/Protest/activists-20020412.tar.gz

and this:

http://lark.cc.ku.edu/~pauljohn/Swarm/MySwarmCode/Schelling/schelling2-2.0-Swarm-2.1.141.tar.gz


Crile Doscher wrote:
Hi there,
This question relates to the logic of the Heatbug code, specifically why a method is implemented where it is. If that sounds like you, read on! I'm putting together a simulation of braided rivers where water objects (originally called drops until I realised that that name was special...) flow over a river bed and find their way by moving in the direction of the steepest slope. I've been paying attention to how Heatbug implements bug movement and wonder why it is that the actual method that looks at the eight cell neighbourhood around a particular cell (findExtremeType) is implemented in HeatSpace.m rather than in Heatbug.m. The Heatbug then determines which cell it will move to, but HeatSpace does the work of figuring out which cell would be the best to move to. This is part of the process of getting my head around Objective C. Any thoughts? Thanks -
Crile

Dr Crile Doscher
Natural Resources Engineering
Lincoln University
New Zealand _______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support


--
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ku.edu/~pauljohn
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]