try

try preview image

1 collaborator

Z_ch z ch (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.2.0 • Viewed 200 times • Downloaded 25 times • Run 0 times
Download the 'try' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

(a general understanding of what the model is trying to show or explain)

HOW IT WORKS

(what rules the agents use to create the overall behavior of the model)

HOW TO USE IT

(how to use the model, including a description of each of the items in the Interface tab)

THINGS TO NOTICE

(suggested things for the user to notice while running the model)

THINGS TO TRY

(suggested things for the user to try to do (move sliders, switches, etc.) with the model)

EXTENDING THE MODEL

(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)

NETLOGO FEATURES

(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)

RELATED MODELS

(models in the NetLogo Models Library and elsewhere which are of related interest)

CREDITS AND REFERENCES

(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

breed [trackers tracker]
breed [people person]
patches-own [
  road
  density
]
globals[
  tx
  ty
]

to startup
  ;; read the elevations from an external file
  ;; note that the file is formatted as a list
  ;; so we only have to read once into a local variable.
  file-open "try.txt"
  let patch-roads file-read
  file-close

  ;; transfer the data from the file into the sorted patches
  (foreach sort patches patch-roads [ [the-patch the-road] ->
    ask the-patch [ set road the-road ]
  ])
  set-default-shape turtles "circle"
  setup
end 

to setup
  clear-drawing
  clear-turtles
  create-trackers 1 [ setxy -71 96       ;;lxxx
                    set color green
                    set size 4]  ;;lxxx

  create-people 1 [ setxy -21 -25       ;;lxxx
                    set color red
                    set size 4]  ;;lxxx
  ask patches with [ road = 1] [set pcolor white
  ;;set people count turtles in-radius 30
    ;;set dist distance turtle 0

  ]

  reset-ticks
end 

to goonce
  ask patches[
   set density count people in-radius 5
   ;;set pcolor density
  ]
   ask trackers[
    let target max-one-of patches in-radius 10 [density]
    face target
    if any? people-here [  ;; if there are sheep here then eat one
      ask one-of people-here
         [die]
     ]
    fd 1
  ]
end 

to go
  ask patches with [pcolor =  white]
  [ set density count people in-radius 5]

     ask trackers[
    let target max-one-of patches in-radius 10 [density]
    face target
    if any? people-here [  ;; if there are sheep here then eat one
      ask one-of people-here
         [die]
     ]
    fd 1
  ]




 ; ask turtle 0 [
   ;; move-to one-of neighbors4 with [pcolor = white]
    ;;ask turtles [ show max-one-of turtles [distance myself] ]
   ;; let p max-one-of neighbors [patch-variable]
    ;;if [patch-variable] of p > patch-variable [
    ;;face p
;;move-to p
;;]
    ;; uphill patch-variable uphill4 patch-variable
 ;   move-to one-of neighbors4  with [pcolor = white]

 ; ]
end 

There is only one version of this model, created about 1 year ago by z ch.

Attached files

File Type Description Last updated
try.png preview Preview for 'try' about 1 year ago, by z ch Download

This model does not have any ancestors.

This model does not have any descendants.