Cleanup
This commit is contained in:
parent
360346eeac
commit
ed0a95b4d8
@ -388,10 +388,6 @@ public class Cluster : Nucleus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override void UpdateNuclei() {
|
public override void UpdateNuclei() {
|
||||||
// this.stale++;
|
|
||||||
// if (this.stale > staleValueForSleep)
|
|
||||||
// _outputValue = Vector3.zero;
|
|
||||||
|
|
||||||
foreach (Nucleus nucleus in this.nuclei)
|
foreach (Nucleus nucleus in this.nuclei)
|
||||||
nucleus.UpdateNuclei();
|
nucleus.UpdateNuclei();
|
||||||
}
|
}
|
||||||
|
|||||||
25
Neuron.cs
25
Neuron.cs
@ -130,31 +130,12 @@ public class Neuron : Nucleus {
|
|||||||
// this clone the nucleus without the synapses and receivers
|
// this clone the nucleus without the synapses and receivers
|
||||||
public override Nucleus ShallowCloneTo(Cluster newParent) {
|
public override Nucleus ShallowCloneTo(Cluster newParent) {
|
||||||
Neuron clone = new(newParent, this.name);
|
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);
|
CloneFields(clone);
|
||||||
return clone;
|
return clone;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Nucleus Clone(ClusterPrefab prefab) {
|
public override Nucleus Clone(ClusterPrefab prefab) {
|
||||||
Neuron clone = new(prefab, this.name);
|
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);
|
CloneFields(clone);
|
||||||
foreach (Synapse synapse in this.synapses) {
|
foreach (Synapse synapse in this.synapses) {
|
||||||
Synapse clonedSynapse = clone.AddSynapse(synapse.nucleus);
|
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() {
|
||||||
public override void UpdateStateIsolated() { //float3 bias_unused) {
|
|
||||||
Vector3 sum = this.bias;
|
Vector3 sum = this.bias;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
|
|
||||||
@ -252,9 +232,8 @@ public class Neuron : Nucleus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public virtual void ProcessStimulus(Vector3 inputValue, string thingName = null) {
|
public virtual void ProcessStimulus(Vector3 inputValue, string thingName = null) {
|
||||||
//this.outputValue = inputValue;
|
|
||||||
this.stale = 0;
|
this.stale = 0;
|
||||||
//Debug.Log($"{this.name} processed stimulus");
|
|
||||||
this.bias = inputValue;
|
this.bias = inputValue;
|
||||||
|
this.parent.UpdateFromNucleus(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -16,9 +16,7 @@ public abstract class Nucleus {
|
|||||||
public virtual Vector3 outputValue {
|
public virtual Vector3 outputValue {
|
||||||
get { return _outputValue; }
|
get { return _outputValue; }
|
||||||
set {
|
set {
|
||||||
//Debug.Log($"{this.name}: stale is reset, was: {this.stale}");
|
|
||||||
//this.stale = 0;
|
//this.stale = 0;
|
||||||
// this._isSleeping = false;
|
|
||||||
_outputValue = value;
|
_outputValue = value;
|
||||||
if (this.isFiring)
|
if (this.isFiring)
|
||||||
WhenFiring?.Invoke();
|
WhenFiring?.Invoke();
|
||||||
|
|||||||
@ -127,8 +127,7 @@ public class NucleusArray {
|
|||||||
|
|
||||||
if (selectedReceiver is Neuron selectedNucleus)
|
if (selectedReceiver is Neuron selectedNucleus)
|
||||||
selectedNucleus.ProcessStimulus(inputValue);
|
selectedNucleus.ProcessStimulus(inputValue);
|
||||||
//selectedReceiver.parent.UpdateStateIsolated();
|
//selectedReceiver.parent.UpdateFromNucleus(selectedReceiver);
|
||||||
selectedReceiver.parent.UpdateFromNucleus(selectedReceiver);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CleanupReceivers() {
|
private void CleanupReceivers() {
|
||||||
|
|||||||
@ -39,7 +39,7 @@ public class Pulsar : Neuron {
|
|||||||
return clone;
|
return clone;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void UpdateStateIsolated() { //float3 _bias) {
|
public override void UpdateStateIsolated() {
|
||||||
float3 product = this.bias;
|
float3 product = this.bias;
|
||||||
|
|
||||||
//Applying the weight factors
|
//Applying the weight factors
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user