diff --git a/Cluster.cs b/Cluster.cs index 61e2897..a05f20b 100644 --- a/Cluster.cs +++ b/Cluster.cs @@ -388,10 +388,6 @@ public class Cluster : Nucleus { } public override void UpdateNuclei() { - // this.stale++; - // if (this.stale > staleValueForSleep) - // _outputValue = Vector3.zero; - foreach (Nucleus nucleus in this.nuclei) nucleus.UpdateNuclei(); } diff --git a/Neuron.cs b/Neuron.cs index 2022a78..4c7d0eb 100644 --- a/Neuron.cs +++ b/Neuron.cs @@ -130,31 +130,12 @@ public class Neuron : Nucleus { // this clone the nucleus without the synapses and receivers public override Nucleus ShallowCloneTo(Cluster newParent) { Neuron clone = new(newParent, this.name); - // { - // array = null, - // bias = this.bias, - // curve = this.curve, - // curvePreset = this.curvePreset, - // curveMax = this.curveMax, - // average = this.average - // }; CloneFields(clone); return clone; } public override Nucleus Clone(ClusterPrefab prefab) { Neuron clone = new(prefab, this.name); - // { - // //Neuron clone = new(this.parent, this.name) { - // array = this.array, - // curve = this.curve, - // curvePreset = this.curvePreset, - // curveMax = this.curveMax, - // average = this.average - // }; - // if (clone.cluster != null) - // clone.cluster.nuclei.Add(clone); - CloneFields(clone); foreach (Synapse synapse in this.synapses) { Synapse clonedSynapse = clone.AddSynapse(synapse.nucleus); @@ -199,8 +180,7 @@ public class Neuron : Nucleus { } } - //public float3 bias = float3(0, 0, 0); - public override void UpdateStateIsolated() { //float3 bias_unused) { + public override void UpdateStateIsolated() { Vector3 sum = this.bias; int n = 0; @@ -252,9 +232,8 @@ public class Neuron : Nucleus { } public virtual void ProcessStimulus(Vector3 inputValue, string thingName = null) { - //this.outputValue = inputValue; this.stale = 0; - //Debug.Log($"{this.name} processed stimulus"); this.bias = inputValue; + this.parent.UpdateFromNucleus(this); } } \ No newline at end of file diff --git a/Nucleus.cs b/Nucleus.cs index b4defa4..64d1fe4 100644 --- a/Nucleus.cs +++ b/Nucleus.cs @@ -16,9 +16,7 @@ public abstract class Nucleus { public virtual Vector3 outputValue { get { return _outputValue; } set { - //Debug.Log($"{this.name}: stale is reset, was: {this.stale}"); //this.stale = 0; - // this._isSleeping = false; _outputValue = value; if (this.isFiring) WhenFiring?.Invoke(); diff --git a/NucleusArray.cs b/NucleusArray.cs index b41aa68..c4141b4 100644 --- a/NucleusArray.cs +++ b/NucleusArray.cs @@ -127,8 +127,7 @@ public class NucleusArray { if (selectedReceiver is Neuron selectedNucleus) selectedNucleus.ProcessStimulus(inputValue); - //selectedReceiver.parent.UpdateStateIsolated(); - selectedReceiver.parent.UpdateFromNucleus(selectedReceiver); + //selectedReceiver.parent.UpdateFromNucleus(selectedReceiver); } private void CleanupReceivers() { diff --git a/Pulsar.cs b/Pulsar.cs index d4f4104..88e6251 100644 --- a/Pulsar.cs +++ b/Pulsar.cs @@ -39,7 +39,7 @@ public class Pulsar : Neuron { return clone; } - public override void UpdateStateIsolated() { //float3 _bias) { + public override void UpdateStateIsolated() { float3 product = this.bias; //Applying the weight factors