I’m running a netlogo model with around 120000 turtles. At some point while the program is running, netlogo is changing one entry of a matrix to negative value. It is always happening at the same entry but the time and value differ. Normally nothing should be changed in this matrix and when I am running the program with a reduced Agentset, for example with 100000 turtles, everything works fine and the matrix is not changed.
Does anyone know why this is happening and probably has an answer to this issue?
Hi everyone, This is the code snippet where the failure occurs:
set mxH2_seg1_tpa matrix:times-element-wise mx_seg1_tpa mxH1_av set mxH2_seg1_tpb matrix:times-element-wise mx_seg1_tpb mxH1_av set mxH2_r_seg1_tp matrix:times-element-wise mx_r_seg1_tp mxH1_av set row 0 set column 0 ;At this point everything is fine while [row <= 9][ while [column <= 24][ if matrix:get mxH2_seg1_tpa column row != 0 [matrix:set mxH_seg1_tpa column row (ln matrix:get mxH2_seg1_tpa column row)] if matrix:get mxH2_seg1_tpb column row != 0 [matrix:set mxH_seg1_tpb column row (ln matrix:get mxH2_seg1_tpb column row)] ;After here matrix mx_r_seg1_tp is changed and partly filled with strange values if matrix:get mxH2_r_seg1_tp column row != 0 [matrix:set mxH_r_seg1_tp column row (ln matrix:get mxH2_r_seg1_tp column row)] set column column + 1] set column 0 set row row + 1]
The complete code is already very long so if the mistake is somewhere there I need some advice what to look for.