The use of "heading and "right" commands

8 views
Skip to first unread message

Rafaela Lorena

unread,
Sep 19, 2021, 8:34:10 AM9/19/21
to netlogo-users
Hello,

I have a question that I'm not trying to get an answer from either the NetLogo dictionary or the internet.

Imagine a closed world (box) of 5x5. Each patch in the world has 10 agents. Each agent walks around the world and when they walk 17 patches die. On this walk when using the line of code:

"set heading random-float 360"

some agents that arrive at the edge are stationary (walked 16 patches) and pass several ticks and do not die.

But if I use that same line of code above ("set heading random-float 360") and put an open world in all directions. Agents move around and die.

Additionally, when using the line of code below with the closed world:

"right random-float 360"

Agents, too, move around and die.

So I would like to know why this happens?

What is the difference between using heading and the right? And why does the closed or open world interfere when using the heading and right commands?

I've read the description of these commands in the NetLogo dictionary several times and I can't understand why this is happening in my code. Does anyone have any guesses?

Thanks in advance

Pradeesh Kumar K V

unread,
Sep 21, 2021, 12:49:38 AM9/21/21
to Rafaela Lorena, netlogo-users
Heading command works for me even when the agent is at edge of the world. Could it be that some code is not getting executed?

--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/CAHs8kB_NFHWkL4Q1G44nhtKR6d63vxyBssaby5p4vbtc9LUTow%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages