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:
parent
425fbd285e
commit
2081373fa7
2 changed files with 6 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue