diff --git a/src/space_colonization/space_colonization.rs b/src/space_colonization/space_colonization.rs index 0fbf471..ba50803 100644 --- a/src/space_colonization/space_colonization.rs +++ b/src/space_colonization/space_colonization.rs @@ -42,6 +42,10 @@ pub struct SpaceColonization { /// /// If density is 10, then there will be an average distance of 10 between attractors density: i32, + // TODO learning opportunity : avoid Rc and RefCell to have memory contiguous, increase + // performance and simplify code. Using a mutable struct instead of pointers to nodeswill + // improve performance. If required, use ids to point to nodes, those ids can be simply their + // indices in the array. If the node pointed to is deep, the index can be a vec or a tuple. new_nodes: RefCell, Rc)>>, /// Tree like representation of all nodes /// [node: [child1: [grand-child], child2: [grand-child2]]]