The subcluster is producing (wrong) results
This commit is contained in:
parent
5aedb30d36
commit
d754457a14
14
Cluster.cs
14
Cluster.cs
@ -193,8 +193,22 @@ public class Cluster : INucleus {
|
|||||||
|
|
||||||
// This does not work because the prefab nucleus does not have a state
|
// This does not work because the prefab nucleus does not have a state
|
||||||
this.prefab.inputs[0].UpdateState(sum);
|
this.prefab.inputs[0].UpdateState(sum);
|
||||||
|
//this._outputValue = this.output.outputValue;
|
||||||
|
UpdateResult(this.output.outputValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual void UpdateResult(Vector3 result) {
|
||||||
|
// float d = Vector3.Distance(result, this.outputValue);
|
||||||
|
// if (d < 0.5f) {
|
||||||
|
// //Debug.Log($"insignificant update: {d}");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
this.outputValue = result;
|
||||||
|
foreach (INucleus receiver in this.receivers)
|
||||||
|
receiver.UpdateState();
|
||||||
|
}
|
||||||
|
|
||||||
public void UpdateNuclei() {
|
public void UpdateNuclei() {
|
||||||
this.stale++;
|
this.stale++;
|
||||||
if (this.stale > 2)
|
if (this.stale > 2)
|
||||||
|
|||||||
@ -25,8 +25,11 @@ public class ClusterPrefab : ScriptableObject {
|
|||||||
if (this._inputs == null) {
|
if (this._inputs == null) {
|
||||||
this._inputs = new();
|
this._inputs = new();
|
||||||
foreach (IReceptor receptor in this.nuclei) {
|
foreach (IReceptor receptor in this.nuclei) {
|
||||||
if (receptor is INucleus nucleus)
|
if (receptor is INucleus nucleus) {
|
||||||
this._inputs.Add(nucleus);
|
// inputs have no incoming synapses yet.
|
||||||
|
if (nucleus.synapses.Count == 0)
|
||||||
|
this._inputs.Add(nucleus);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this._inputs;
|
return this._inputs;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user