My model has two breeds of agents, police officers and sex workers, and intends to model the effects of different policies on trust creation (vs. fear) between police and sex workers. It includes a variety of other aspects, but I based it on a mix of the Biology/Virus model and a diffusion network.
As the model is currently, sex workers change their property [trust?] based on one-time interactions with police officers (depending on the policy, these act controllingly or trust-inducing, or a mix), while sex workers are also connected among each other on a preferential-attachment network that affects [trust?] based on the majority of their neighbors.
Now, I want to make it more complex by adding a counter so that property is changed only after a certain amount of police interactions, not after the first one.
How can I include such a counter?
Thank you so much!
Upon request, here the sample code of the behaviors that affect trust:
;; determines officers' behavior based on policy and friendliness
ask officers [
move
if friendly? = true [ ask officers [comfort] ]
if malicious? = true [ ask officers [control] ]
if policy = "criminalize" AND friendly? = false [ ask officers [control] ]
if policy = "regulate" AND friendly? = false AND malicious? = false [ ask officers [regulate] ]
if policy = "decriminalize" AND friendly? = false AND malicious? = false [ ask officers [comfort] ]
]
;; asks sex workers next to officers to trust
to comfort
ask other sexworkers-here with [ trust? = false ] [ trust ]
end
;; asks sex workers next to officers to be scared
to control
ask other sexworkers-here with [ trust? = true ] [ fear ]
end
;; asks sex workers next to officers to be scared if they are young
;; or have less than two links
;; asks sex workers next to officers to trust if they are older
to regulate
ask other sexworkers-here with [ age < 10 ] [ fear ]
if network = "preferential-attachment" [
ask other sexworkers-here with [ count link-neighbors < 3 ] [ fear ] ]
ask other sexworkers-here with [ age < 30 AND count link-neighbors > 3 ] [ trust ]
end