nsum
neighbor-variable patch-sum-variable
Parameters:
| neighbor-variable |
Variable |
the variable of the neighbor you would like to sum up |
| patch-sum-variable |
Variable |
the variable that should be set to the sum of the neighbors' variables |
Description:
For each patch, takes the sum of neighbor-variable from all neighboring patches and places it in patch-sum-variable. Both neighbor-variable and patch-sum-variable should be patch variables.
Examples:
nsum food surrounding-food takes the food variable of all the surrounding patches and stores the value of their sum in the patch-variable surrounding-food.
Notes:
nsum must be run by the observer even though it affects patches.
Related Commands:
diffuse
diffuse4
nsum4