--The final part of my design involves me recording down anytime a car breed drives into or in netlogo terms, is on the same patch or X and Y coordinate as the people breed as they navigate across the edge of the screen. Had this been java I could've done something like
if Car.xPostion == Person.xPostion
(Do something...)
But unfortunately I do not know how to do the same in NetLogo, all I've been able to do so far is just ask the two breeds by giving every turtle a boolean variable called movable and setting them to true and the rest to false, is there anyway I can check the two coordinates of two different turtles on Netlogo? This is all I 've been able to do so far.
to record-accidents ask turtles with [movable? = true] [ ]
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/23f9f913-74ac-4b5d-b7e5-5d5e7a0c77a5%40googlegroups.com.
Didn't really understand that, please explain
On Sunday, April 12, 2020 at 6:40:23 AM UTC+1, Ef D wrote:
You can use turtle-set to make a set from two different breeds and perform actions on them
On Sun, 12 Apr 2020 at 1:38 ZINAN <tiagoricar...@gmail.com> wrote:
--The final part of my design involves me recording down anytime a car breed drives into or in netlogo terms, is on the same patch or X and Y coordinate as the people breed as they navigate across the edge of the screen. Had this been java I could've done something like
if Car.xPostion == Person.xPostion
(Do something...)
But unfortunately I do not know how to do the same in NetLogo, all I've been able to do so far is just ask the two breeds by giving every turtle a boolean variable called movable and setting them to true and the rest to false, is there anyway I can check the two coordinates of two different turtles on Netlogo? This is all I 've been able to do so far.
to record-accidents ask turtles with [movable? = true] [ ]
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 netlog...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/23f9f913-74ac-4b5d-b7e5-5d5e7a0c77a5%40googlegroups.com.
--
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/14e5676c-bcb3-4c8e-9ffe-a2329218f24a%40googlegroups.com.
Hi,
I have attached a simple model in which collision info is output to the command center.
You can write the output to a file. See
https://ccl.northwestern.edu/netlogo/docs/dictionary.html#file-type
and the associated links.
The most relevant method is record-collision (see below) in which the people check for cars on their location using cars-here.
We need to be careful to account for the case when there are no cars here, so any? Is used.
See <breeds>-here
https://ccl.northwestern.edu/netlogo/docs/dictionary.html#turtles-here
and
any?
https://ccl.northwestern.edu/netlogo/docs/dictionary.html#any
to record-collision
; If a person has a car on its location, that is a collision.
; Note: if neither turtle moves, another collision at the same point will
; be recorded
ask people [
if any? cars-here [
type "Ouch! Collsion at "
type xcor
type " "
print ycor
]
]
End
Aaron
(I sent this earlier, but forgot to reply-all)
--
Aaron Brandes, Software Developer
Center for Connected Learning and Computer-Based Modeling
From: <netlog...@googlegroups.com> on behalf of ZINAN <tiagoricar...@gmail.com>
Date: Saturday, April 11, 2020 at 6:39 PM
To: netlogo-users <netlog...@googlegroups.com>
Subject: [netlogo-users] How to check if 2 different breeds of turtles are on the same patch
The final part of my design involves me recording down anytime a car breed drives into or in netlogo terms, is on the same patch or X and Y coordinate as the people breed as they navigate across the edge of the screen. Had this been java I could've done something like
if Car.xPostion == Person.xPostion
(Do something...)
But unfortunately I do not know how to do the same in NetLogo, all I've been able to do so far is just ask the two breeds by giving every turtle a boolean variable called movable and setting them to true and the rest to false, is there anyway I can check the two coordinates of two different turtles on Netlogo? This is all I 've been able to do so far.
to record-accidents
ask turtles with [movable? = true]
[
]
--
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/23f9f913-74ac-4b5d-b7e5-5d5e7a0c77a5%40googlegroups.com.