Turtles and Conditional Probability
Model was written in NetLogo 6.2.2
•
Viewed 478 times
•
Downloaded 40 times
•
Run 0 times
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
Demo of independence, conditional independence and failure of contditional independence.
Pure independence: set stepsize to 0.
Conditional independence (one back): set stepsize > 0 and angle = 180 The current position is the starting point for a random step. This is a "random walk" (Brownian motion).
Conditional independence (two back): set stepsize > 0 and angle < 180 The current and previous positions determine the direction from which the turtle swivels.
Comments and Questions
Please start the discussion about this model!
(You'll first need to log in.)
Click to Run Model
globals [ turtle-my-color my-turn] directed-link-breed [ paths path] breed [ turtle-starts turtle-start ] breed [ turtle-ends turtle-end ] to setup clear-all set-default-shape turtles "turtle" create-turtle-starts number [ set turtle-my-color 15 + 10 * who set color turtle-my-color setxy 0 0 set size turtle-size ] reset-ticks end to go ;; if not any? turtles [ stop ] ask turtle-starts [ ifelse label-on? [ set label who + 1] [ set label "" ] ifelse do-stamp [ stamp ] [ ] ifelse is-pen-down [ pen-down ] [pen-up] move ] ;;ask links [ connect-turtles ] tick end to move ;; turtle procedure set my-turn 2 * (random angle) - angle / 2 rt random angle ;; right turn ;;lt random angle ;; left turn ifelse stepsize = 0 [ setxy random-xcor random-ycor ] ;; random jump [fd stepsize ] ;; forward end
There are 2 versions of this model.
This model does not have any ancestors.
This model does not have any descendants.