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

nbrhdFractal

Declaration
Parameters
Remarks
Example
See Also

Declaration

void __stdcall nbrhdFractal(
	int xRange,   // horizontal range
	int yRange,   // vertical range
	bool uplink,  // are my ancestors my neighbours?
	bool downlink // are my descendents my neighbours?
);
Top of page

Parameters

xRange, yRange
Range of neighbourhood in horizontal and vertical directions, respectively.
uplink, downlink
Determines whether links are propagated up the fractal structure to the root or down to the leaves, or both. (Why computer scientists don't make good gardeners: they plant all their trees upside down!)
Top of page

Remarks

This function is available through the API. It can be called within the model-supplied routine
onSimCreate to generate a deterministic, scale-free network. The grid is divided into blocks of xRange×yRange sites linked to their "parents" (the top left site in each block). This pattern is repeated with blocks of xRange2yRange2 and so on, up to the system size, when the uppermost left site is linked to all other sites of the lattice. By definition this creates a scale-free (power law) distribution of links.


Sample neighbourhood structure for xRange=yRange=2.

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, nbrhdBlocks, nbrhdCCDM, nbrhdMoore, nbrhdRandom, nbrhdRandomER, nbrhdVonNeumann.
Top of page
[Rik's Office Hours] [Contact Rik]
Last updated: Fri Apr 30 2004, 1:41pm