I am trying to come up with a way of taking a created instance that acts as an environment for n-many sub-instances within; like having a overall ‘network’ instance with multiple dynamically-interconnecting objects inside. My current idea is for the network instance to first be instantiated, and then an initial sub-object created inside. The network would have a way to receive an input and send an output, and those inputs pass by the sub-objects and the sub-objects collectively form an output to send.
What I need is for a way that can have a cell, when certain parameters are met, take itself and create a new object that is a copy of itself but with different name and inserting a different stored data; not replacing the original, but expanding the collective in the network instance. So this would allow for a database-like system that could dynamically expand without being told a set range of object names, but be able to self-replicate. If it would be possible, the objects would replicate themselves as their instances and not call their class, but I’m completely open to ideas.
I have been able to test manually creating individual objects and have them interact how I would like, but still unable to get a simplified way of making the objects class self-replicate on its own initiative. So that’s what I really need, sorry for the wall of text, and thanks for reading.
Any new-style object can get a reference to its class by accessing its
__class__attribute. From there it can invoke a constructor, manipulate class attributes, etc.