Move Towards Target Example
Model was written in NetLogo 5.0.4
•
Viewed 1641 times
•
Downloaded 126 times
•
Run 7 times
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
Comments and Questions
Please start the discussion about this model!
(You'll first need to log in.)
Click to Run Model
breed [people person] people-own [target] breed [houses house] to setup clear-all set-default-shape houses "house" ;; CREATE-ORDERED-distributes the houses evenly create-ordered-houses number-of-houses [ fd max-pxcor ] create-people number-of-people [ setxy random-xcor random-ycor set target one-of houses face target ] reset-ticks end to go ask people [ ;; if at target, choose a new random target if distance target = 0 [ set target one-of houses face target ] ;; move towards target. once the distance is less than 1, ;; use move-to to land exactly on the target. ifelse distance target < 1 [ move-to target ] [ fd 1 ] ] tick end ; Public Domain: ; To the extent possible under law, Uri Wilensky has waived all ; copyright and related or neighboring rights to this model.
There are 8 versions of this model.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Move Towards Target Example.png | preview | Preview for 'Move Towards Target Example' | over 11 years ago, by Uri Wilensky | Download |
This model does not have any ancestors.
This model does not have any descendants.