Rik's Treehouse > Babbling in Binary > My Software > Orphanware > R2DToo > R2DToo Help > For the Programmer > nbrhdBlocks

nbrhdBlocks

Declaration
Parameters
Remarks
Example
See Also

Declaration

void __stdcall nbrhdBlocks(
	int xRange, // horizontal range
	int yRange  // vertical range
);
Top of page

Parameters

xRange
Range of neighbourhood in horizontal direction.
yRange
Range of neighbourhood in vertical direction.
Top of page

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). Top of page


Example

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

See Also

onSimCreate, nbrhd1D, nbrhdCCDM, nbrhdFractal, nbrhdMoore, nbrhdRandom, nbrhdRandomER, nbrhdVonNeumann.
Top of page
[Rik's Office Hours] [Contact Rik]
Last updated: Fri Apr 30 2004, 1:41pm