Brain.Validate: RetrySeconds must be positive; a bar that lifts the next tick is no bar

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-26 05:20:43 +01:00
commit 2081373fa7
2 changed files with 6 additions and 4 deletions

View file

@ -331,7 +331,7 @@ namespace Lodur
/// <summary>How long a direct try (<see cref="Actor.PlanLength"/> -1) of one (goal, target) pair may last before the Actor gives it up: it bars the pair's direct try, reports <see cref="TickEvents.Frustrated"/> and decides again past the goal's dwell. Not NaN, not negative; +infinity never frustrates. Default 5 (a placeholder; ruling bds-unplannable-tries-direct).</summary>
public double FrustrationSeconds { get; init; } = 5.0;
/// <summary>How long a bar on a direct try lasts if the world he knows does not change first: the pair is tried direct again after it. Not NaN, not negative; +infinity never lifts by time. Default 30 (a placeholder).</summary>
/// <summary>How long a bar on a direct try lasts if the world he knows does not change first: the pair is tried direct again after it. Positive, not NaN; +infinity never lifts by time. Default 30 (a placeholder).</summary>
public double RetrySeconds { get; init; } = 30.0;
/// <summary>The most groundings one Select may regress across all its plans, at least 1, default 4096: one budget per decision, spent by deepening across the want pairs, short plans first (lodur:question:bds-think-budget-per-decision).</summary>
@ -541,9 +541,9 @@ namespace Lodur
throw new ArgumentException("FrustrationSeconds must not be NaN or negative.");
}
if (!(RetrySeconds >= 0.0))
if (!(RetrySeconds > 0.0))
{
throw new ArgumentException("RetrySeconds must not be NaN or negative.");
throw new ArgumentException("RetrySeconds must be positive (not NaN, zero or negative): a bar that lifts the next tick is no bar.");
}
if (ThinkBudget < 1)

View file

@ -399,7 +399,9 @@ public sealed class PlannerFrustrationTests
Assert.Throws<ArgumentException>(() => Build(Make(retry: bad)));
}
Assert.Throws<ArgumentException>(() => Build(Make(frustration: 0.5, retry: 0.0)));
Build(Make(frustration: double.PositiveInfinity, retry: double.PositiveInfinity));
Build(Make(frustration: 0.0, retry: 0.0));
Build(Make(frustration: 0.0, retry: 1.0));
}
}