From 619ced65052bda431241726833280c4c836d16a8 Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Fri, 17 Apr 2026 16:52:37 +0200 Subject: [PATCH] Removed the use of Receptors --- Editor/ClusterInspector.cs | 22 +++++++++++----------- Editor/ClusterViewer.cs | 4 ++-- Runtime/Scripts/Core/Cluster.cs | 2 +- Runtime/Scripts/Core/IReceptor.cs | 8 +++++--- Runtime/Scripts/Core/Nucleus.cs | 2 +- Runtime/Scripts/Core/Receptor.cs | 8 +++++--- 6 files changed, 25 insertions(+), 21 deletions(-) diff --git a/Editor/ClusterInspector.cs b/Editor/ClusterInspector.cs index b9f2cdc..d4fe1c6 100644 --- a/Editor/ClusterInspector.cs +++ b/Editor/ClusterInspector.cs @@ -212,7 +212,7 @@ namespace NanoBrain { // Synapses - if (this.currentNucleus is not Receptor) { //} && this.currentNucleus is not ClusterReceptor) { + //if (this.currentNucleus is not Receptor) { //} && this.currentNucleus is not ClusterReceptor) { showSynapses = EditorGUILayout.BeginFoldoutHeaderGroup(showSynapses, "Synapses"); if (showSynapses) { if (this.currentNucleus is Neuron neuron2) { @@ -320,7 +320,7 @@ namespace NanoBrain { anythingChanged |= AddSynapse(this.prefab, this.currentNucleus); } EditorGUILayout.EndFoldoutHeaderGroup(); - } + //} // Activation @@ -410,9 +410,9 @@ namespace NanoBrain { case Nucleus.Type.Cluster: AddClusterInput(nucleus); break; - case Nucleus.Type.Receptor: - AddReceptorInput(nucleus); - break; + // case Nucleus.Type.Receptor: + // AddReceptorInput(nucleus); + // break; // case Nucleus.Type.ClusterReceptor: // AddClusterReceptorInput(nucleus); // break; @@ -446,12 +446,12 @@ namespace NanoBrain { subclusterInstance.defaultOutput.AddReceiver(nucleus); } - protected virtual void AddReceptorInput(Nucleus nucleus) { - Receptor newReceptor = new(this.prefab, "New Receptor"); - newReceptor.AddReceiver(nucleus); - this.currentNucleus = newReceptor; - BuildLayers(); - } + // protected virtual void AddReceptorInput(Nucleus nucleus) { + // Receptor newReceptor = new(this.prefab, "New Receptor"); + // newReceptor.AddReceiver(nucleus); + // this.currentNucleus = newReceptor; + // BuildLayers(); + // } // protected virtual void AddClusterReceptorInput(Nucleus nucleus) { // ClusterPickerWindow.ShowPicker(prefab => OnClusterReceptorPicked(nucleus, prefab), "Select Cluster"); diff --git a/Editor/ClusterViewer.cs b/Editor/ClusterViewer.cs index 2cc0233..fe94305 100644 --- a/Editor/ClusterViewer.cs +++ b/Editor/ClusterViewer.cs @@ -490,7 +490,7 @@ namespace NanoBrain { } } - if (expandArray == false || nucleus is not IReceptor) { + if (expandArray == false) {// || nucleus is not IReceptor) { // put name below nucleus Vector3 labelPos = position - Vector3.down * (size + 5); // below neuron style.alignment = TextAnchor.UpperCenter; @@ -574,7 +574,7 @@ namespace NanoBrain { private void HandleClicked(Nucleus nucleus) { if (nucleus == this.currentNucleus) { - if (nucleus is Receptor) // || nucleus is ClusterReceptor) + if (nucleus is Cluster) //is Receptor) // || nucleus is ClusterReceptor) expandArray = !expandArray; else expandArray = false; diff --git a/Runtime/Scripts/Core/Cluster.cs b/Runtime/Scripts/Core/Cluster.cs index 12d105a..3264d8a 100644 --- a/Runtime/Scripts/Core/Cluster.cs +++ b/Runtime/Scripts/Core/Cluster.cs @@ -557,7 +557,7 @@ namespace NanoBrain { else { string nucleusName0 = nucleusName + ": 0"; foreach (Nucleus nucleus in this.clusterNuclei) { - if (nucleus is IReceptor receptor) { + if (nucleus is Cluster) { //IReceptor receptor) { if (nucleus.name == nucleusName | nucleus.name == nucleusName0) return nucleus; } diff --git a/Runtime/Scripts/Core/IReceptor.cs b/Runtime/Scripts/Core/IReceptor.cs index 1f8cbcd..f6380f5 100644 --- a/Runtime/Scripts/Core/IReceptor.cs +++ b/Runtime/Scripts/Core/IReceptor.cs @@ -1,3 +1,4 @@ +/* using UnityEngine; namespace NanoBrain { @@ -47,7 +48,7 @@ namespace NanoBrain { } public static class IReceptorHelpers { - /* + /// /// Implementation for the NanoBrain::IReceptor::AddReceptorElement which can be used for all implementations of IReceptor /// @@ -119,6 +120,7 @@ namespace NanoBrain { } - */ + } -} \ No newline at end of file +} +*/ \ No newline at end of file diff --git a/Runtime/Scripts/Core/Nucleus.cs b/Runtime/Scripts/Core/Nucleus.cs index 25f958f..60352b2 100644 --- a/Runtime/Scripts/Core/Nucleus.cs +++ b/Runtime/Scripts/Core/Nucleus.cs @@ -54,7 +54,7 @@ public abstract class Nucleus { Neuron, MemoryCell, Cluster, - Receptor, + //Receptor, //ClusterReceptor, //ClusterArray, } diff --git a/Runtime/Scripts/Core/Receptor.cs b/Runtime/Scripts/Core/Receptor.cs index 6e9efaf..a72da67 100644 --- a/Runtime/Scripts/Core/Receptor.cs +++ b/Runtime/Scripts/Core/Receptor.cs @@ -1,3 +1,4 @@ +/* using UnityEngine; #if UNITY_MATHEMATICS using Unity.Mathematics; @@ -55,7 +56,7 @@ namespace NanoBrain { return clone; } - /* + [SerializeReference] private NucleusArray _array; public NucleusArray array { @@ -78,7 +79,7 @@ namespace NanoBrain { public virtual void AddArrayReceiver(Nucleus receiverToAdd, float weight = 1) { IReceptorHelpers.AddArrayReceiver(this, receiverToAdd, weight); } - */ + public override void UpdateStateIsolated() { this.outputValue = this.bias; @@ -116,4 +117,5 @@ namespace NanoBrain { } } -} \ No newline at end of file +} +*/ \ No newline at end of file