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

nbrhdRandomER

Declaration
Parameters
Remarks
Example
See Also

Declaration

void __stdcall nbrhdRandomER(
	float linksPerNode, // average number of neighbours for each site
	bool symmetric      // whether links are symmetric or not
);
Top of page

Parameters

linksPerNode
Number of links (neighbours) each site has, an average.
symmetric
true if links are symmetric (reciprocal), otherwise false.
Top of page

Remarks

This function is available through the API. It can be called within the model-supplied routine
setNbrhd to set the neighbourhood to an Erdos-Renyi random graph in which each agent is randomly connected to other agents (never itself) selected from anywhere on the lattice (non-local). The probability of a link between any two agents is linksPerNode/(N-1) where N is the number of agents in the simulation.

If symmetric=true then all links are reciprocal: a is a neighbour of b if and only if b is a neighbour of a. Otherwise the links are directed. Top of page


Example

void __stdcall setNbrhd(double *param) { nbrhdRandomER(1.5,true); }
Top of page

See Also

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