netlogo

netlogo comparing turtle variables

人走茶凉 提交于 2020-01-05 11:37:00
问题 I'm writing a program which groups turtles into different groups. I am trying to write a command where if there is a turtle in a different group within a 1 until radius of the turtle the command runs. This is what I have to confront ask turtles [if [ group ] of turtles in-cone 1 180 != group [set color brown]] end However the command is coming out true even when there is not a turtle in a different group nearby. 回答1: may be something like : to confront ask turtles if any? turtles in radius 2

Changing Node ID with every Setup in Netlogo

一世执手 提交于 2020-01-05 10:19:43
问题 We try to show a simple infection via Netlogo. For our purpose we need to start the infection with the same turtle for several times. But right now with every setup another turtle begins with the infection. We already tried to work with the Node ID, but unfortunately the ID of the different turtles changes with every setup, too. We are out of ideas but maybe there is a way to sove this problem I am happy for any answers :) This is our Code so far: extensions [nw] globals [ num-informed

NetLogo Turtle position

微笑、不失礼 提交于 2020-01-05 08:29:15
问题 I'm really new at programming in NetLogo and i need a little help. I have an assignment and i did most of it. The thing left to do is to make robot walk in labyrinth. Robot can walk only on a black patches (violet patches represent the obstacles). So, the thing i need help with is to position robot in the center of the labyrinth - i must do it with "patch-here" (...i did it little bit differently in procedure "stvori-agenta") and mark that patch on which robot stands as black. So, afterwards

Robot obstacle avoidance and skipping visited patches/places

北战南征 提交于 2020-01-03 06:27:44
问题 I'm really new at programming in NetLogo and i need help. I am doing research project in which i created a world like real world in which roads and buildings were created. Building are of black color and roads are of white. A robot can only walk on white patches i.e. on roads. I am having problem with obstacle avoidance algorithm and not visiting the visited places. I need human like behavioral-based algorithm for obstacle avoidance i.e. humans see an obstacle in front of them, then they move

Robot obstacle avoidance and skipping visited patches/places

一笑奈何 提交于 2020-01-03 06:27:29
问题 I'm really new at programming in NetLogo and i need help. I am doing research project in which i created a world like real world in which roads and buildings were created. Building are of black color and roads are of white. A robot can only walk on white patches i.e. on roads. I am having problem with obstacle avoidance algorithm and not visiting the visited places. I need human like behavioral-based algorithm for obstacle avoidance i.e. humans see an obstacle in front of them, then they move

Integrating NetLogo and Java : when should we think about this integration as a good option?

和自甴很熟 提交于 2020-01-02 11:28:06
问题 I just came to know about this excellent tutorials http://scientificgems.wordpress.com/2013/12/11/integrating-netlogo-and-java-part-1/ http://scientificgems.wordpress.com/2013/12/12/integrating-netlogo-and-java-2/ http://scientificgems.wordpress.com/2013/12/13/integrating-netlogo-and-java-3/ Their example concerns about computation needed for patch diffusion and shows how to access patch variable from java and change them in netlogo. I was wondering if anyone has any idea or comments on when

Is the placement of set patch-size within my code correct and is set the right command to use?

六月ゝ 毕业季﹏ 提交于 2019-12-31 07:56:28
问题 upon compilation I receive an error message saying set is the wrong commander before patch size 10 what commander should I use instead and why? globals[road?] to setup clear-all ask patches [set pcolor green] end to go if mouse-down? [ ask patch mouse-xcor mouse-ycor [ edit-world ] end to edit-world if EDIT_TOOL = "Road" [set pcolor grey set patch-size 10 ] end 回答1: The right command is set-patch-size , with the hyphen after set . 回答2: Patch-size can not be changed programatically but only in

How can I increase speed up simulation of my least-cost path model

守給你的承諾、 提交于 2019-12-31 01:43:06
问题 By using network extension, the following code builds the least-cost path between two polygons (composed of several patches) : to calculate-LCP [ID-polygon-1 ID-polygon-2] let path [] let path-cost -1 ;;;;;;;;;;;;;;;;;;;;;;;; ;; Define polygon edges ask patches with [plabel != ID-polygon-1] [ ask neighbors with [plabel = ID-polygon-1] [ ask nodes-here [ set color red ] ] ] ask patches with [plabel != ID-polygon-2] [ ask neighbors with [plabel = ID-polygon-2] [ ask nodes-here [ set color red ]

NetLogo: Is there a way to customize CSV files generated by export-plot to only include certain columns?

二次信任 提交于 2019-12-30 10:55:11
问题 This might seems really basic , but using export plot feature of NetLogo what I get is something like this: x,y,color,pen down?,x,y,color,pen down?,x,y,color,pen down?,x,y,color,pen down? Is there a way to not to include color and pen down and Just one X using netlogo itself? x,y,y,y,y I can filter unwanted data in R or excel but I have many plots and having clutter free data files make my work much easier :) 回答1: In a word, no. Someone could write an extension that provides this. 回答2:

Get mean heading of neighboring turtles

一笑奈何 提交于 2019-12-29 09:28:11
问题 I was trying to program my turtles to move with a heading that's the mean heading of its neighbors (turtles within a specific radius). Should I use in-radius to achieve this? 回答1: Given Nicolas' response to Arthur's answer, here's the code to get what wikipedia considers to be the mean of angles: to-report mean-heading [ headings ] let mean-x mean map sin headings let mean-y mean map cos headings report atan mean-x mean-y end Note that because up is 0 is NetLogo angles, sin heading is the x