Skip to content

Differences between NetLogo and Python versions

Francesco Mattioli edited this page Mar 25, 2021 · 5 revisions

1. too many siblings

The fundamental part of the standard setup of the model is the household creation (ProtonOC.setup_households()). Households consisting of one or two parents and one or several children. At this point, however, we only have groups of agents who do not have any kind of connection between them except for the household. The standard setup_siblings procedure takes parents within households and creates sibling type links by creating a network of relatives outside the household. In both the Netlogo code and the Python code, the agents eligible for this operation are selected and merged recursively. But the Netlogo code contains a bug, the agents that are merged with each other do not leave the pool and continue to be added to other siblings creating an exaggerated number of siblings. In Python this procedure has been fixed by removing from the pool the agents who have already received their siblings. For more information on how to reproduce the error: https://github.com/LABSS/PROTON-OC/issues/194

2. p-fertility

During the make-baby procedure a fertility rate is calculated for each woman depending on her age and the number of children she already has. This number determines whether or not this agent will have a new baby. The number of children that each woman has is kept within the number-of-children variable. The problem in Netlogo is that this variable only takes into account the children that arrive during the to-go procedure of the model while it should also take into account the children that are assigned to each woman during the standard setup of the model. In Python this problem has been solved. For more information and how to reproduce the error: https://github.com/LABSS/PROTON-OC/issues/211

3. too many facilitators

Too many facilitators are added in the netlogo version when searching for accomplices. Fixed in the Python version. For more information and how to reproduce the error: https://github.com/LABSS/PROTON-OC/issues/209

4. in netlogo agents reach a higher level of education

During setup, in the init-students procedure, student enrolment at school does not take the max-education-level parameter into account. Solved in Python. For more information and how to reproduce the error: https://github.com/LABSS/PROTON-OC/issues/181 and https://github.com/LABSS/PROTON-OC/issues/201

5. father removal is partial

When we remove fathers, we cut only the offspring links. That means we keep other links, of which household is most important; and since household links are included in person links, that father can potentially still commit crimes with that offspring. For more information and how to reproduce the error: https://github.com/LABSS/PROTON-OC/issues/197