The generator's working state (graph, attachment pool, rng) moves into a holmeKimBuilder struct so each algorithm step is a small named method: attachNewNode, link, pickMutualFriend, degreeProportionalSample. Max nesting drops from five levels to two. The RNG call order is untouched, and the golden test (99/70/7 reached) plus the fixed-seed determinism test prove behaviour is bit-for-bit identical. Go bits: pointer receivers ((b *holmeKimBuilder)) let methods mutate the builder; (value, ok) multiple returns are the idiom for 'may not exist', as in pickMutualFriend. |
||
|---|---|---|
| .. | ||
| cascade.go | ||
| cascade_test.go | ||
| educate.go | ||
| educate_test.go | ||
| graph.go | ||
| graph_test.go | ||
| holmekim.go | ||
| holmekim_test.go | ||
| rng.go | ||
| rng_test.go | ||
| scenario.go | ||
| scenario_test.go | ||