15.08.2015 Views

Introduction to the Modeling and Analysis of Complex Systems

introduction-to-the-modeling-and-analysis-of-complex-systems-sayama-pdf

introduction-to-the-modeling-and-analysis-of-complex-systems-sayama-pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

19.3. AGENT-ENVIRONMENT INTERACTION 443The o<strong>the</strong>r way is <strong>the</strong> chemotaxis, which can be implemented in several different ways. Forexample, we can have each agent look at a cell r<strong>and</strong>omly chosen from its neighborhood,<strong>and</strong> move <strong>the</strong>re with a probability determined by <strong>the</strong> difference in cAMP concentration(∆c) between <strong>the</strong> neighbor cell <strong>and</strong> <strong>the</strong> cell where <strong>the</strong> agent is currently located. A sigmoidfunctionP (∆c) = e∆c/c 01 + e ∆c/c 0(19.1)would be suitable for this purpose, where c 0 is a parameter that determines how sensitivethis probability is <strong>to</strong> ∆c. P (∆c) approaches 1 with ∆c → ∞, or 0 with ∆c → −∞. Thispart can be implemented in <strong>the</strong> update function as follows:Code 19.12:# simulating chemotaxis <strong>of</strong> agentsfor ag in agents:newx, newy = (ag.x + r<strong>and</strong>int(-1, 2)) % w, (ag.y + r<strong>and</strong>int(-1, 2)) % wdiff = (env[newx, newy] - env[ag.x, ag.y]) / 0.1if r<strong>and</strong>om() < exp(diff) / (1 + exp(diff)):ag.x, ag.y = newx, newyHere diff corresponds <strong>to</strong> ∆c, <strong>and</strong> we used c 0 = 0.1.5. Describe <strong>the</strong> rules for how agents behave on <strong>the</strong>ir own. All <strong>the</strong> actions taken by<strong>the</strong> agents in this model are interactions with <strong>the</strong> environment, so we can skip this designtask.6. Describe <strong>the</strong> rules for how agents interact with each o<strong>the</strong>r. In this model, agentsdon’t interact with each o<strong>the</strong>r directly; all interactions among <strong>the</strong>m are indirect, mediatedby environmental variables (cAMP concentration in this case), so <strong>the</strong>re is no need <strong>to</strong>implement anything for <strong>the</strong> agents’ direct interaction with each o<strong>the</strong>r. Indirect agent-agentinteraction through informational signals written in <strong>the</strong> environment is called stigmergy,which is an essential coordination mechanism used by many social organisms [88].By putting everything <strong>to</strong>ge<strong>the</strong>r, <strong>and</strong> adding <strong>the</strong> observe function for visualization, <strong>the</strong>entire simula<strong>to</strong>r code looks like this:Code 19.13: keller-segel-abm.pyimport matplotlibmatplotlib.use(’TkAgg’)from pylab import *

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!