Guilherme Pontes (Spatial Modeling)

Spatial Modeling Assignments

Guilherme Pontes (Spatial Modeling)

Assignment 3

In this video I used 500 ticks with the Directed-Walk on and using a random walk.

https://www.youtube.com/watch?v=AoX6momWRR4&feature=youtu.be

Screen Shot 2015-04-28 at 9.15.59 PM

– Describe in 4-5 sentences the utility of using a pattern oriented modeling approach for understanding the observed patterns of both species.

The utility of using the pattern oriented modeling approach for understanding the observed patterns of both species will require a major model change in the strategies of modeling and data collection, and it is must that more emphasis must be placed on observing and documenting relevant patterns in addition to attempts to obtain direct estimates of model parameters.

– For each movement model, describe how agent interactions lead to emergent patterns in both space and time.

Both of Foraging and Random Walk have the same end and essentially, they only differ nearness ratios when we reduce the number of turtles. However, the Flocking model provides you what you want with a remote average nearness.

Screen Shot 2015-04-28 at 11.50.20 PM Screen Shot 2015-04-28 at 11.50.08 PM Screen Shot 2015-04-28 at 11.49.52 PM Flocking, Foraging and Random Walk respectively.

– Which movement model best describes the patterns observed for species A? Why?

The flocking model best describes the patterns observed for species A. The flocking model best describes because as we know in species A, they have the choice for the nearness and they tend to cluster.

https://www.youtube.com/watch?v=bMNDsLhdT3M&feature=youtu.be

agent-movement: Flocking (Recorded using 500 ticks with the Directed-Walk on.

– Which movement model best describes the patterns observed for species B? Why?

The foraging and random walk could best describe the patterns observed for species B. They best describe because of the proximity between the Random Walk model and the Foraging model and their differences with the Flocking model, which does not fit in the species B.

https://www.youtube.com/watch?v=AoX6momWRR4&feature=youtu.be

agent-movement: Random Walk (Recorded using 500 ticks with the Directed-Walk on.

https://www.youtube.com/watch?v=VnUtTcuXgKc&feature=youtu.be

agent-movement: Foraging (Recorded using 500 ticks with the Directed-Walk on.

– How did a pattern oriented modeling approach allow you to determine the answers to (iii) and (iv)?

The Pattern Oriented Modeling allows us to determine differentiation among the species A and B and many other things that can be fitted to observed data. If we don’t use the Pattern Oriented Modeling, we will have no information or basis that would support us.

Code:

turtles-own[energy
flockmates
nearest-neighbor
nearest-neighbor-distance]

patches-own [food]
to setup
clear-all
setup-patches
setup-turtles
reset-ticks
end
to setup-patches
ask patches [set pcolor white]
ask n-of 5 patches
[set pcolor green]
end
to setup-turtles
crt 20
[set color blue
set size 1.5
setxy 0 0]
ask turtles [set energy 500]

end
to go
if agent-movement = “Random Walk” [random-walk]
if agent-movement = “Foraging” [forage]
if agent-movement = “Flocking” [flock]
tick
end
to random-walk
ask turtles
[ifelse (directed-walk?)
[rt random 90 lt random 90]
[rt random 360]
forward .25]
update-plot
end
to forage
ask turtles [
ifelse (directed-walk?)
[rt random 90 lt random 90]
[rt random 360]
forward .25
set energy energy – 1
if energy = 0 [move-to min-one-of patches
with [pcolor = green] [distance myself]]
if pcolor = green [set energy 500
set color blue]
]
update-plot
end
to flock
ask turtles [ flocking ]
repeat 5 [ ask turtles [ fd 0.2 ] display ]
update-plot
end
to flocking
find-flockmates
if any? flockmates
[ find-nearest-neighbor
ifelse distance nearest-neighbor < 1
[ separate ]
[ align
cohere ]
]
end
to find-flockmates
set flockmates other turtles in-radius 3
end
to find-nearest-neighbor
set nearest-neighbor min-one-of flockmates [distance myself]
end
to separate
turn-away ([heading] of nearest-neighbor) 1.5

end
to align
turn-towards average-flockmate-heading 5
end
to-report average-flockmate-heading ;; turtle
;procedure
;; We can’t just average the heading variables here.
;; For example, the average of 1 and 359 should be 0,
;; not 180. So we have to use trigonometry.
let x-component sum [dx] of flockmates
let y-component sum [dy] of flockmates
ifelse x-component = 0 and y-component = 0
[ report heading ]
[ report atan x-component y-component ]
end
to cohere
turn-towards average-heading-towards-flockmates 3
end
to-report average-heading-towards-flockmates
let x-component mean [sin (towards myself + 180)] of flockmates
let y-component mean [cos (towards myself + 180)] of flockmates
ifelse x-component = 0 and y-component = 0
[ report heading ]
[ report atan x-component y-component ]
end
to turn-towards [new-heading max-turn]
turn-at-most (subtract-headings new-heading heading)
max-turn
end
to turn-away [new-heading max-turn]
turn-at-most (subtract-headings heading new-heading)
max-turn
end
to turn-at-most [turn max-turn]
ifelse abs turn > max-turn
[ ifelse turn > 0
[ rt max-turn ]
[ lt max-turn ] ]
[ rt turn ]
end
to update-plot
ask turtles [
let nd min-one-of other turtles [distance myself]
set nearest-neighbor-distance distance nd
]
end

to make-movie
user-message “First, save your new movie file (lab3.mpg)”
let path user-new-file if not is-string? path [stop]
;; stop if user canceled

;; run the model
setup
movie-start path
movie-grab-view
while [ticks < 123 ]
[go
movie-grab-view ]

;; export the movie
movie-close
user-message (word “Exported movie to ” path)
end

No Comments

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment

Skip to toolbar