From a55e899c680fc6ead72b07dea02432f396e86b9b Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Fri, 14 Aug 2026 16:16:24 +0200 Subject: [PATCH] Things seem to work again --- Runtime/Scripts/Core/Cluster.cs | 10 +++++----- Runtime/Scripts/Core/Neuron.cs | 12 +----------- Runtime/Scripts/Core/Population.cs | 6 +++--- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/Runtime/Scripts/Core/Cluster.cs b/Runtime/Scripts/Core/Cluster.cs index 143f1ed..5309887 100644 --- a/Runtime/Scripts/Core/Cluster.cs +++ b/Runtime/Scripts/Core/Cluster.cs @@ -106,13 +106,13 @@ namespace NanoBrain { } if (ix >= 0) { - Debug.Log($"update {neuronName} {timestamp}"); + // Debug.Log($"update {neuronName} {timestamp}"); actions[ix].action = action; actions[ix].timestamp = timestamp; return; } - Debug.Log($"new {neuronName} {timestamp}"); + // Debug.Log($"new {neuronName} {timestamp}"); // No existing item; compute insertion point (sorted by timestamp ascending) for (int i = 0; i < actions.Count; i++) { if (actions[i].timestamp > timestamp) { @@ -126,9 +126,9 @@ namespace NanoBrain { } public static void Check(List actions) { long now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); - if (actions.Count > 0) { - Debug.Log($"{actions.Count} actions, {actions[0].neuronName} {actions[0].timestamp} {now} {actions[0].timestamp - now}"); - } + // if (actions.Count > 0) { + // Debug.Log($"{actions.Count} actions, {actions[0].neuronName} {actions[0].timestamp} {now} {actions[0].timestamp - now}"); + // } while (actions.Count > 0 && actions[0].timestamp <= now) { Action action = actions[0].action; actions.RemoveAt(0); diff --git a/Runtime/Scripts/Core/Neuron.cs b/Runtime/Scripts/Core/Neuron.cs index 56c8b31..5d4e4ac 100644 --- a/Runtime/Scripts/Core/Neuron.cs +++ b/Runtime/Scripts/Core/Neuron.cs @@ -185,16 +185,6 @@ namespace NanoBrain { /// public virtual float3 outputValue { get { - // long now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); - // List actions = this.parent.actions; - // if (actions.Count > 0) { - // Debug.Log($"{actions.Count} actions, {actions[0].neuronName} {actions[0].timestamp} {now} {actions[0].timestamp - now}"); - // } - // while (actions.Count > 0 && actions[0].timestamp <= now) { - // Action action = actions[0].action; - // actions.RemoveAt(0); - // action(); - // } this.parent.CheckActions(); return _outputValue; } @@ -821,7 +811,7 @@ namespace NanoBrain { } private void ResetStimulus() { - Debug.Log($"reset stimulus {this.parent.name + "." +this.name}"); + // Debug.Log($"reset stimulus {this.parent.name + "." +this.name}"); this.parent.name = this.parent.baseName; this.bias = Vector3.zero; this.parent.thingId = 0; diff --git a/Runtime/Scripts/Core/Population.cs b/Runtime/Scripts/Core/Population.cs index 1c19569..5b4c6ae 100644 --- a/Runtime/Scripts/Core/Population.cs +++ b/Runtime/Scripts/Core/Population.cs @@ -47,7 +47,7 @@ namespace NanoBrain { Debug.Log($"Selected {i}: {member.performance}"); member.initialized = true; selectedMembers.Add(member); - LogTrainableWeights(member.brain); + // LogTrainableWeights(member.brain); } } @@ -87,9 +87,9 @@ namespace NanoBrain { member.brain.CopyWeightsFrom(ants[parent1].brain); member.brain.ProcessWeightsFrom(ants[parent2].brain, Average); - LogTrainableWeights(member.brain); + // LogTrainableWeights(member.brain); member.brain.GaussianAdditiveMutation(1e-1f); - LogTrainableWeights(member.brain); + // LogTrainableWeights(member.brain); } private static float Average(float a, float b) {