The version of preferential attachment implemented in the model is linear (see:

https://en.wikipedia.org/wiki/Preferential_attachment https://en.wikipedia.org/wiki/Preferential_attachment). Once you move away from that, as you want to do, the approach in the code is no longer viable. The idea of "using links as lottery tickets" only works for linear preferential attachment. Now you are in the business of biased coin tossing, except that the coin has n faces instead of 2.

In a different model, I implemented a hack:

Let k_i be the degree of node i

Let a variable D (for denominator) be the sum of all (k_i)^(gamma)

Iterate on the nodes; for each node i, create an edge if random-float 1.0 <= k_i ^ gamma / D

This is a hack, because the model creates on average one link per turn. It does not create exactly one link per turn.

You are welcome to adapt the code from my model (

http://modelingcommons.org/account/models/2048): the routing in question is called "connect".