![]() |
Nano Brain for Unity v0.1
|
A Cluster combines a collection of Nuclei to implement reusable behaviour.
A Cluster is an instantiation of a ClusterPrefab. Clusters can be nested inside other clusters.
Public Types | |
| enum | Type { None , Neuron , MemoryCell , Cluster } |
| The types of Nucleus. | |
Public Member Functions | |
| Cluster (ClusterPrefab prefab, Cluster parent) | |
| Instantiate a new copy of a ClusterPrefab in the given parent. | |
| Cluster (ClusterPrefab prefab, ClusterPrefab parent=null) | |
| Add a new cluster to a ClusterPrefab. | |
| override Nucleus | Clone (ClusterPrefab parent) |
| override Nucleus | ShallowCloneTo (Cluster parent) |
| void | AddInstance () |
| void | AddInstance (ClusterPrefab prefab) |
| void | RemoveInstance () |
| bool | SameSiblingsAs (Cluster[] otherSiblingClusters) |
| void | AddArrayReceiver (Nucleus receiverToAdd, float weight=1) |
| void | RefreshComputeOrders () |
| void | RefreshOutputs () |
| bool | TryGetNucleus (string nucleusName, out Nucleus foundNucleus) |
| Nucleus | GetNucleus (string nucleusName) |
| Neuron | GetNeuron (string neuronName) |
| Neuron | GetNeuron (int thingId, string neuronName, string thingName=null) |
| bool | DeleteNucleus (Nucleus nucleus) |
| virtual List< Nucleus > | CollectReceivers (bool removeDuplicates=false) |
| List<(Neuron, Nucleus)> | CollectConnections () |
| List< Synapse > | CollectSynapsesTo (Cluster otherCluster) |
| void | MoveReceivers (Cluster newCluster) |
| void | UpdateFromNucleus (Nucleus startNucleus) |
| override void | UpdateStateIsolated () |
| void | Refresh () |
| virtual void | Initialize () |
| virtual void | UpdateNuclei () |
| Update the state and recursively all Nuclei receiving data from this Nucleus. | |
Static Public Member Functions | |
| static int | GetNucleusIndex (List< Nucleus > nuclei, Nucleus nucleus) |
| static int | GetNucleusIndex (List< Nucleus > nuclei, string nucleusName) |
Public Attributes | |
| ClusterPrefab | prefab |
| Cluster[] | siblingClusters |
| int | instanceCount = 1 |
| Dictionary< int, Cluster > | thingClusters = new() |
| List< Nucleus > | nuclei = new() |
| List< Nucleus > | sortedNuclei |
| List< Nucleus > | _inputs = null |
| string | name |
| The name of the Nucleus. | |
| Cluster | parent |
| The cluster prefab in which the nucleus is located. | |
Protected Member Functions | |
| int | GetNucleusIndex (Nucleus[] nuclei, Nucleus nucleus) |
Protected Attributes | |
| List< Neuron > | _outputs = null |
Properties | |
| string | baseName [get] |
| The base name of the cluster. I don't think this is actively used at this moment. | |
| virtual List< Nucleus > | inputs [get] |
| Dictionary< Nucleus, List< Nucleus > > | computeOrders [get] |
| virtual Neuron | defaultOutput [get] |
| List< Neuron > | outputs [get] |
| NanoBrain.Cluster.Cluster | ( | ClusterPrefab | prefab, |
| Cluster | parent | ||
| ) |
Instantiate a new copy of a ClusterPrefab in the given parent.
| prefab | The prefab to use |
| parent | The cluster in which this new cluster will be placed |
| NanoBrain.Cluster.Cluster | ( | ClusterPrefab | prefab, |
| ClusterPrefab | parent = null |
||
| ) |
Add a new cluster to a ClusterPrefab.
| prefab | The prefab to copy |
| parent | The prefab in which the new copy is placed |
|
virtualinherited |
Update the state and recursively all Nuclei receiving data from this Nucleus.
Reimplemented in NanoBrain.MemoryCell.
|
inherited |
The cluster prefab in which the nucleus is located.
The cluster instance in which the nucleus is located