Neighbours & probabilities

21 views
Skip to first unread message

Degenderus

unread,
Oct 12, 2021, 4:29:41 PM10/12/21
to netlogo-users
Hello there,
I am trying to model the increase in probability to poach by individuals who have seen adjacent individuals poaching. This probability has a temporal nature, that is it only last one tick and then gets back to normal. 

To do that I have used the following code, but something went wrong. Could you help me figuring out?

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; temporal poaching probability:
;; spiking after poached event from neighbouring poachers
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
to setup-temporal-poaching-probability

 let temporal_poaching_probability poaching_probability
  if [ poached = TRUE ]
  [ ask fishers-neighbors [ count neighbors with [ poached = TRUE ] ]
 set temporal_poaching_probability poaching_probability * (count neighbors with [poached = TRUE] / 8)
 ]
tick                     
end

Pradeesh Kumar K V

unread,
Oct 16, 2021, 3:21:16 AM10/16/21
to Degenderus, netlogo-users
Hi,

It looks like the line "if [ poached = TRUE ]" is not correct.

poached is an agent property/attribute. So if you need to check this, you should check with respect to a specific agent or a group of agents.

for example, " if [poached] of turtle 0 = TRUE [..."

On the other hand if you are asking whether any poaching has happened in the previous tick, then you should define a new variable and set it to true based on whether one or more of the agents poached in the previous tick.

Hope this helps.

Best,

Pradeesh

--
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/db05a9e0-970b-4557-9ade-ae9b3a796301n%40googlegroups.com.

Chiu9,C (ug)

unread,
Oct 23, 2021, 10:34:18 AM10/23/21
to netlogo-users

Hi,

I am writing to ask if it is possible to get the sum of a link-value (which changes whenever two turtles get linked) at each tick when they got link? Thank you!

Best,
Hei
Reply all
Reply to author
Forward
0 new messages