Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Criminal-tendency is calculated too early #219

Open
mariopaolucci opened this issue Oct 29, 2020 · 2 comments
Open

Criminal-tendency is calculated too early #219

mariopaolucci opened this issue Oct 29, 2020 · 2 comments
Assignees
Labels
bug Something isn't working netlogo This issue is related to the development of the model in netlogo

Comments

@mariopaolucci
Copy link
Contributor

In the setup we have:

PROTON-OC/PROTON-OC.nlogo

Lines 224 to 226 in 5e7e34a

calculate-criminal-tendency
calculate-arrest-rate
setup-oc-groups

But this means that the OC members don't get the OC multiplier, and that won't be corrected until the end of the first year.

I'm asking @Kubasinska to check the numbers and, if this is the case, to repair the bug.

@mariopaolucci mariopaolucci added bug Something isn't working netlogo This issue is related to the development of the model in netlogo labels Oct 29, 2020
@ambitious-octopus
Copy link
Contributor

ambitious-octopus commented Oct 30, 2020

Yes, but no! Is true that during setup the oc-member agents don't get their OC multiplier. The setup-oc-groups procedure assumes that the criminal-tendency has already been calculated, so we can't just move the procedure.
I checked the criminal tendency through this code to see the variation through ticks.

 show word "tick: " ticks 
  show (word "oc-member? = true: " "mean=" mean [criminal-tendency] of persons with [oc-member? = true] 
                                   "min=" min [criminal-tendency] of persons with [oc-member? = true]
                                   "max=" max [criminal-tendency] of persons with [oc-member? = true])
  
  show (word "oc-member? = false: " "mean=" mean [criminal-tendency] of persons with [oc-member? = false] 
                                   "min=" min [criminal-tendency] of persons with [oc-member? = false]
                                   "max=" max [criminal-tendency] of persons with [oc-member? = false])
  show "-----------------------------------"

At tick 12 I expected a leap in the criminal tendency, and indeed there is a variation but it seems too low and also, the two averages, should be more or less equal (even if the oc-members are definitely lower than the non oc-members) and they are not.

image

The calculate-criminal-tendency procedure activates if tick modulo tick-per-year is equal to 0.
If we assume that tick = 0 and tick-per-year = 12, 0 - (12 * int(0/12))] = 0. This means that all procedures that are activated every tick-per-year are also activated at tick=0 . Therefore the criminal-tendency is correctly calculated at the beginning of the simulation.

@mariopaolucci
Copy link
Contributor Author

it worked. We must change the comment..

 if ((ticks mod ticks-per-year) = 0) [ ; this should be 11, probably, otherwise

@mariopaolucci mariopaolucci mentioned this issue Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working netlogo This issue is related to the development of the model in netlogo
Projects
None yet
Development

No branches or pull requests

2 participants