Declaration Parameters Remarks Example See Also
| Declaration
void __stdcall nbrhdBlocks(
int xRange, // horizontal range
int yRange // vertical range
);

Parameters
- xRange
- Range of neighbourhood in horizontal direction.
- yRange
- Range of neighbourhood in vertical direction.

Remarks
This function is available through the API. It can be called within the model-supplied routine onSimCreate to partition the 2-dimensional world into non-overlapping rectangular blocks of xRange by yRange, where all sites within a block are linked to each other. The blocks are tiled starting at the top, left corner of the grid (0,0). Any partial blocks extending past the boundaries are left incomplete.
nbrhdBlocks() provides a convenient way to run multiple, isolated simulations in parallel or it can be used to generate clusters for use with another nbrhd*() function (see the example below).

Example
void __stdcall setNbrhd(double *param)
{
// clustered, scale-free network
nbrhdBlocks(2,3); // clustered
nbrhdFractal(2,3,true,true); // scale-free
}

See AlsoonSimCreate, nbrhd1D, nbrhdCCDM, nbrhdFractal, nbrhdMoore, nbrhdRandom, nbrhdRandomER, nbrhdVonNeumann. |