netlogo

How do I create a column of means of specific columns in a data.frame?

北城以北 提交于 2019-12-24 12:31:14
问题 Thanks all for your responses and answers. I can see I've unintentionally left out some important details that may help you understand my problem better. I was trying to keep it simple and generic, but that didn't actually help. Here's an updated version with more information. I have a data.frame with many columns that came from a NetLogo model generated by BehaviorSpace . Each column is a time series that represents a reported value under different experimental conditions with repetitions

How can I compute the distance between two patches?

三世轮回 提交于 2019-12-24 12:04:47
问题 I need to find the minimum distance between patches in front of my agent to a certain patch (goal), in order to select the patch that would create the most optimal (shortest) path. The primitive distance only requires one argument so I can't use it as is for this function. 回答1: The distance primitive only requires one argument, yes, but it is a "patch or turtle primitive": it must be run in the context of a particular agent by "asking" it for its distance to another, so you can think of the

Accessing patch through coordinates stored in a list

萝らか妹 提交于 2019-12-24 11:29:33
问题 I have a list which is storing the list of coordinates of patches. let coor [ [0 1] [ 1 0] [1 -1] ] Now I want to ask the patch at the location of the 2nd element of the list to change its color to red. ask patch (item 1 coor) [ set pcolor red ] This gives an error that patch expects a number instead of a list or block. How to make NetLogo understand that the (item 1 coor) is a set of two numbers? Any other way to approach this? I have also tried using 'table' extension for this but there

Rotating a vector denoting turtle position by an angle Netlogo

点点圈 提交于 2019-12-24 10:41:07
问题 I set/update each turtle's position as follows: set xcor xcor + item 0 vector set ycor ycor + item 0 vector Therefore I add a vector to the current agent's coordinates. PROBLEM: I wish to rotate the added vector by angle x. Thus the vector "vector" should be rotated by angle x. The angle should be taken from a Gaussian distribution with a specified deviation. I am trying to achieve something similar to Couzin's model. http://www.csim.scu.edu.tw/~chiang/course/ComputerGameAdvance/Collective

NETLOGO: Storing and using the value of a variable in the last 3 ticks

一世执手 提交于 2019-12-24 10:24:47
问题 I am trying to model a stock market. I am trying to give agents a certain kind of behaviour to base their prediction of the prices on. So basically, every agent predicts the price of the share. In the Setup procedure, a random predicted price is assigned to each agent. As the time passes, the predicted price is supposed to be calculated as follows: total of predicted price of the last 3 periods / 3 I don't know how to approach this issue. I tried using the last command but it does not work. I

NetLogo: line break in output file?? Not so simple.

你离开我真会死。 提交于 2019-12-24 09:58:11
问题 I tried all options to create a new line in my output file, but still I get a txt-file with everything behind the previous information. Even with this supersimple code: globals [file] to setup clear-all set file "results\\GA1.txt" if is-string? file [while [file-exists? file] [set file replace-item (length file - 5) file "11" ] file-open file] end to go tick write-to-file end to write-to-file file-print (word ticks) FILE-TYPE "\n" file-write 1 file-print (word " " 2 ";") file-write 1 file

How to make a turtle able to save other turtles ID in Netlogo?

女生的网名这么多〃 提交于 2019-12-24 08:38:15
问题 Here is what I want to do: I want a team consists of 3 turtles in a group . All turtles need to store their own ID and teammatesID inside the variable called teammatesID . (Imagine you want to create a group, you will put your name and your friends' name in a list, that's why this variable need to store ownID, I am bad in explaning things..) Instead of just showing (agentset,3 turtles) , I need them to be able to show all teammates ID. After they have gathered all 3 members , they will get

How to replace color with another color in a polygon?

别说谁变了你拦得住时间么 提交于 2019-12-24 08:37:01
问题 I have patches as follows: I would like to color white patches as in this figure: Here my code to color white patches in blue: ask patches with [pcolor = white] [ if any? neighbors with [pcolor = blue] [set pcolor blue] ] But the problem is that I obtain this figure: . Thanks in advance for your help. 回答1: Alan is right about the cause of your problem, but you don't need to create a next-pcolor patch variable. If you put both conditions inside the with block, NetLogo will first construct the

Unable to use link between Netlogo 6.0.1 and Mathematica 11.1 on a 64 bit processor pc running Windows 10

一个人想着一个人 提交于 2019-12-24 07:40:02
问题 I am unable to run the mathematica-netlogo link on my PC with a 64 bit processor running window 10. The versions of Netlogo and Mathematica are 6.0.1 and 11.1 Student Edition respectively. The error arises when the function "NLStart[]" is run with the path of the Netlogo directory provided as an input to this function. The error message is as follows: NLStart::netlogonotfound: NetLogo could not be found in: C:\Program Files\NetLogo 6.0.1\ Prior to this step, I successfully loaded the NetLogo

Recommended hotpatch for Mathematica Link to NetLogo 6 didn't work

人走茶凉 提交于 2019-12-24 07:39:33
问题 I have the same problem as the user who posted in "Unable to use Mathematica Link in NetLogo 6.0" (Unable to use Mathematica Link in NetLogo 6.0). For me, the Mathematica Link seems to work fine with Netlogo version 5.3.1. Even after I attempted the recommended hotpatch (which was the answer to the original posted question on this topic), still no luck (I get the same error message posted in the original comment cited above). I tried extracting the hotpatch in the NetLogo 6.0 directory and in