G02_SpaceColonization_NodeSizeBasedOnChildCount
G02_SpaceColonization_NodeSizeBasedOnChildCount
Based on G01_SpaceColonization with a few efficiency tweaks to the code and the algorithm tweaked slightly to allow for the seed nodes to track their children and descendants. In this case children refer to the immediate child nodes and descendants is the total number of nodes that are in that branch. This gives an interesting effect that looks like a root system of a tree (or even just a tree)
Algorithm
The Space Colonization Algorithms covered in G01_SpaceColonization is used, but each node tracks it’s children. With each iteration the size of each node in the network is determined by the following equations: maxRadius * growthRate * NUM_DESCENDANTS / NUM_CHILDREN
, the result of that is then clamped between minRadius
and maxRadius
. This means that the node can only grow so big (this is to prevent it from dominating the screen.
I also added the ability to draw the shape outlines that are being used as the source of the attractors
Progression
With The Attractor Shapes On
Smaller Max Radius and slower growth rate
Future Work
I am mostly happy with this. I also took some major strides forwards in reproducibility from a given seed and number of iterations, before the colors were still completely random and uncoupled from the structure, now they are linked together
- Create a library for this algorithm
- Draw paths from the seed nodes outwards, keeping track of the children was step one here. This is also referred to in G01_SpaceColonization#Future Work