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.4. ECOLOGICAL AND EVOLUTIONARY MODELS 457agents = []rdata = []fdata = []...def observe():global agents, rdata, fdatasubplot(2, 1, 1)cla()rabbits = [ag for ag in agents if ag.type == ’r’]rdata.append(len(rabbits))if len(rabbits) > 0:x = [ag.x for ag in rabbits]y = [ag.y for ag in rabbits]plot(x, y, ’b.’)foxes = [ag for ag in agents if ag.type == ’f’]fdata.append(len(foxes))if len(foxes) > 0:x = [ag.x for ag in foxes]y = [ag.y for ag in foxes]plot(x, y, ’ro’)axis(’image’)axis([0, 1, 0, 1])subplot(2, 1, 2)cla()plot(rdata, label = ’prey’)plot(fdata, label = ’preda<strong>to</strong>r’)legend()A typical simulation result with this revised code is shown in Fig. 19.6. You can seethat <strong>the</strong> populations <strong>of</strong> <strong>the</strong> two species are definitely showing oscilla<strong>to</strong>ry dynamics, yet<strong>the</strong>y are nothing like <strong>the</strong> regular, cyclic ones predicted by equation-based models (e.g.,Fig. 4.8). Instead, <strong>the</strong>re are significant fluctuations <strong>and</strong> <strong>the</strong> period <strong>of</strong> <strong>the</strong> oscillations isnot regular ei<strong>the</strong>r. Spatial extension, discreteness <strong>of</strong> individual agents, <strong>and</strong> s<strong>to</strong>chasticity

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

Saved successfully!

Ooh no, something went wrong!