Things seem to work again

This commit is contained in:
Pascal Serrarens 2026-08-14 16:16:24 +02:00
parent 8b456e2b7c
commit a55e899c68
3 changed files with 9 additions and 19 deletions

View File

@ -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<TimedAction> 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);

View File

@ -185,16 +185,6 @@ namespace NanoBrain {
/// </summary>
public virtual float3 outputValue {
get {
// long now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
// List<Cluster.TimedAction> 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;

View File

@ -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) {