⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 !!!---itineraries.nlogo

📁 NETLOGO
💻 NLOGO
字号:
;;sliders;;num-travellers the number of travelling Romans;;to add more maps, save them as png files, and colour the desired routeways red;;call your map ''your-map.png", and save it in the same folder as the model.;;then you can choose it from the drop-down list.globals[ticks  ;; a counter that updates after each cycle through the 'go' routine]turtles-own[heard-it?   ;; yes or no variabletimes-heard-it ;; count of how many times a turtle has encountered another who passes on the 'message'];;;;;;setup routines;;;;;to setupca setup-patches setup-agents set ticks 0   ;; plot the initial state of the worldupdate-plotswatch turtle 0  ;; this is the original turtle who has the news; turn this line off to remove the 'halo' effect in the view windowend   to setup-patches  file-close-all  import-pcolors map-choice  ;; imports the map in the map chooserendto setup-agents  create-custom-turtles num-travellers [setup-agent]    ask turtles [        set color brown        set shape "person"        set heard-it? false          set times-heard-it 0               ]                   ask turtle 0 [set heard-it? true                  set color blue] endto setup-agent   ;;; this puts the turtles on the route  set size 3   while [not on-route?]     [     setxy random screen-size-x random screen-size-y    ]  endto-report on-route?  report (abs (pcolor - red) < 5) or  (abs (pcolor - orange) < 5) or  (abs (pcolor - pink) < 5)endto go-home ; agent proc  set pcolor green setup-agent ; prevents turtle from getting 'stuck' on odd pixels.end;;;Movement;;to goif ticks = 0 [if (count turtles) = 0 [setup]]    set ticks ticks + 1  ask turtles     [     pass-the-word     move-forward    ]    update-plotsif everyone-heard-it = 100    [stop]endto-report everyone-heard-itreport (((count turtles with [ color = blue]) / ( count turtles )) * 100)endto move-forward  ; turtle procedure - original from Cruise.netlogo, http://backspaces.net/models/cruise.html  locals [n p l]  set n neighbors with [on-route?]  ifelse count n = 0 [go-home] [    set l []    ask patch-left-and-ahead  90 3 [if on-route? [set l lput self l]]    ask patch-right-and-ahead 90 3 [if on-route? [set l lput self l]]    if (length l != 0) and (0 = random 3) [ set p random-one-of l ]    if p = 0      [ set p one-of n with [(heading-angle myself) = 0] ]    if p = nobody [ set p random-one-of n with [(heading-angle myself) <= 45] ]    if p = nobody [ set p random-one-of n with [(heading-angle myself) <= 90] ]    if p = nobody [ set p min-one-of n [heading-angle myself] ]    set heading towards p    forward distance p  ]endto-report heading-angle [t] ; patch proc  locals [h]  ;set h abs (heading-of t - (towards t + 180) mod 360)  set h (towards t + 180 - heading-of t) mod 360  if h > 180 [set h 360 - h]  report hend;;;;Message Transmission;;;to pass-the-wordask turtles with [heard-it?]    [ ask other-turtles-here with [ not heard-it? ]        [ if (random-float 100) < importance-of-the-news            [ get-the-word ] ] ]endto get-the-word ;; turtle procedure  set heard-it? true  set color blue  set times-heard-it times-heard-it + 1end;;;;plots;;;;to update-plotsupdate-message-impactupdate-message-diffusionendto update-message-impact  set-current-plot "Message Impact"  set-current-plot-pen "min-heard"  plot ( min values-from turtles [times-heard-it] ) / 100  set-current-plot-pen "max-heard"  plot ( max values-from turtles [times-heard-it] ) / 100endto update-message-diffusion  set-current-plot "Message Diffusion Over Time"  set-current-plot-pen "%hearing"  plot ( ((count turtles with [ color = blue]) / ( count turtles )) * 100 )end@#$#@#$#@GRAPHICS-WINDOW462109795481501501.68441101110001CC-WINDOW5567988662Command Center0BUTTON6106943NILsetupNIL1TOBSERVERTNILBUTTON791014243NILgoT1TOBSERVERTNILSLIDER2204942182num-travellersnum-travellers150020011NILMONITOR33391419140Elapsed Timeticks01BUTTON1491021443Step onegoNIL1TOBSERVERTNILMONITOR21592331141% Heard the rumour?everyone-heard-it01SLIDER2201042143importance-of-the-newsimportance-of-the-news110010011%PLOT6348421553Message ImpactTimeNumber of Times Heard0.010.00.010.0truefalsePENS"min-heard" 1.0 0 -16777216 true"max-heard" 1.0 0 -2674135 truePLOT2141418347Message Diffusion Over TimeTime in WeeksPercent who've heard the message0.010.00.010.0truefalsePENS"%hearing" 1.0 0 -16777216 trueCHOOSER5166189111map-choicemap-choice"britain.png" "italy.png" "spain.png" "france.png" "thewest.png" "your-map.png"0@#$#@#$#@INTRODUCTION-----------This model explores the effect of route network topology on the diffusion of information in the Roman world. It was built as part of my research as the Postdoctoral Research Fellow in Roman Archaeology at the University of Manitoba, funded by the Canada Research Chair in Roman Archaeology. It was first presented at the 35th Annual Medieval Workshop, "Cartography in Antiquity and the Middle Ages: Fresh Perspectives, New Methods" at the University of British Columbia on October 28th, in my paper  "The Antonine Itineraries and Agent-Based Modeling".  The comments and critiques offered by the participants of that workshop are gratefully acknowledged. I also am in debt to the participants at the Netlogo workshop at Mesa State College, Grand Junction Co., for teaching me how to develop models in Netlogo.The information presented here is intended as a preliminary description; an in-depth description of the model and the implications of this simulation will be discussed in print in due course.  To cite this model and this information page, please use:Graham, S. (2005) "An Agent-Based Exploration of the Antonine Itineraries" http://home.cc.umanitoba.ca/~grahams/itineraries.htmlSPACE AND REPRESENTATION-----------Most people have a mental image of how places interrelate, how they connect.  There is an excellent cartoon by Gary Larson, where a man wants to get from Point B to Point A. He asks for directions, but the local responds, 態eats me sonny. Most people want to go the other way

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -