nsum4
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 the non-diagonal (N,E,S,W) neighboring patches and places it in patch-sum-variable. Variable should be a patch variable.
Examples:
nsum4 grass totalgrass adds up the value of grass in the non-diagonal patches and places it in totalgrass.
Notes:
nsum4 must be run by the observer even though it affects patches.
Related Commands:
diffuse
diffuse4
nsum