netlogo

Netlogo: getting agents to link if variables values are the same

这一生的挚爱 提交于 2019-12-12 20:30:16
问题 I am trying to get two breeds of agents (xagents and yagents) to check to see if the value of a variable is the same when they move within one of xagents' radius. Then they should link. When I try the code below, they link but when I inspect the values of the linked agents, the variable values are not equal; they should not be linking. The problem procedure is at the end of the code. Any ideas why this is? When I can move past this part, I want the agents to change the value of another

What is the sequence of Netlogo execution?

╄→гoц情女王★ 提交于 2019-12-12 12:48:45
问题 Have I got this correct please? If I write: ask turtles [go_forward go_backward] is it correct that a random turtle will move forward then move backward, and then a second random turtle will do the same, and so on? As opposed to: ask turtles [go_forward] ask turtles [go_backward] which will get all turtles in a random order to move forward, and then all turtles in a (different) random order to move backward. 回答1: That is correct. There's a very similar example right at the end of the section

Making a turtle stop and then go after a special event - Robotic lawn mower simulation project

自闭症网瘾萝莉.ら 提交于 2019-12-12 10:29:14
问题 I am trying to simulate a robotic lawn mower on Netlogo. My first goal was it finds its way home to recharge itself when the battery is low. This is now done (thanks Luke !) but I can't figure how to make the lawnmower stop when it reaches the house (it keeps moving 2 patches around). Therefore my energy slider goes infinitely below zero. I first thought of adding an event "recharge" and placing it after "check death" in to go with a if instance. But : How do I say if car goes on specific

how to create moving turtles out of a shapefile in Netlogo

风流意气都作罢 提交于 2019-12-12 08:14:38
问题 I'm just starting with using Netlogo to create an Agent Based Model. I have two shapefiles I want to use: a network map of a city (line-shapefile) and a point-shapefile of scooters in the city. The idea is to have them drive through the city on the lines of the network shapefile. Since I am new to Netlogo, I only managed to load these shapefiles in my model. Could someone give me a headstart by helping me to create turtles from the scooter registrations (points) and let them move over the

Limit the number of links an agent can make V2

与世无争的帅哥 提交于 2019-12-12 05:43:32
问题 I know, here it is the same question. The thing is... I've been trying to implement it but it doesn't seem to work for me. My simulation is running but 0 links are made even though the agentes are facing the activities at sight-radius . Here is the code: to participate ask activities [ if count my-links < n-capacity [ ask other agentes in-radius sight-radius with [shared-culture = [shared-culture] of other agentes] [ create-participations-with n-of n-capacity agentes ] ask links [ set color

Social networking v2

寵の児 提交于 2019-12-12 05:30:52
问题 I'm trying to make a network of friends like in this example previous to the final correction of JenB in here, since it is more comprehensible for me and Bryan Head said it would be the way he would do it with fewer agents. I'm planning to use around 200, maybe 300 agents. My question is... how could I do it without forming pairs? I want the agents to make friends with every agent in radius x during y ticks and with the same color (I'm still working on the tick condition). I tried with if and

Netlogo: How can I install the “initial value” of the decrement-timer with specific conditions

北城余情 提交于 2019-12-12 04:52:31
问题 I would like to set a decrement-timer when the turtle reaches the end of the road (right end). (I would like to activate the decrement- timer only for the turtle that reached the left end of the road.) And keep turning the decrement-timer until the turtle dies under the specified conditions. The setting time ("A") of the decrement-timer is set separately. I made the following sample program. But the model does not work well. Because in this sample program the initial value of the decrement

how to lineup the agents in the ascending or descending order of their who number in netlogo?

*爱你&永不变心* 提交于 2019-12-12 04:43:42
问题 I am creating an patient-surgeon-operation bed model, wherein I need to show surgeons lined up on the left side of patch awaiting to enter operation room in the center and the patients awaiting in the queue from the right side. I want the surgeons and patients to be located on the patch as per their who number S1 S2 S3 --> Operation room < -- P1 P2 P3 I use the below query, I am not sure where to incorporate the who number to lineup-patients LET gapp 10 LET directions [45 90 230 180 45 90 230

How to color patches within a given rectangle

左心房为你撑大大i 提交于 2019-12-12 04:35:28
问题 I created a grid containing several rectangles. These rectangles are represented by several orange patches and each rectangle is delimitated by white corridors. How can I color patches within a given orange rectangle ? Thanks in advance. This is a beginning of code : to create-yellow-patches ask one-of patches with [pcolor = orange] [ set pcolor yellow foreach list pxcor to max-pxcor [ ;; I don't know how to define a list from pxcor to max-pxcor let x ? foreach list min-pycor to max-pycor [ ;

Preferential Attachement Netlogo

夙愿已清 提交于 2019-12-12 04:18:03
问题 I'm trying to adapt the (simple) Preferential Attachment Network model (available in the Netlogo Models library) to include a slider variable that determines network structure. According to the theory of the Preferential Attachment model (or 'Opinion Leader' model) each individual in the network is assigned a number of ties, k , according to the distribution p(k) ∝ k^−γ, and connected randomly to this number of people. I thus want to have a slider for which i can adapt γ. In the heart of the