diff --git a/src/Lodur.Core/Brain.cs b/src/Lodur.Core/Brain.cs index e218367..201a2f3 100644 --- a/src/Lodur.Core/Brain.cs +++ b/src/Lodur.Core/Brain.cs @@ -331,7 +331,7 @@ namespace Lodur /// How long a direct try ( -1) of one (goal, target) pair may last before the Actor gives it up: it bars the pair's direct try, reports and decides again past the goal's dwell. Not NaN, not negative; +infinity never frustrates. Default 5 (a placeholder; ruling bds-unplannable-tries-direct). public double FrustrationSeconds { get; init; } = 5.0; - /// 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). + /// 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). public double RetrySeconds { get; init; } = 30.0; /// 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). @@ -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) diff --git a/tests/Lodur.Core.Tests/PlannerFrustrationTests.cs b/tests/Lodur.Core.Tests/PlannerFrustrationTests.cs index a7dd62d..6a6b9a0 100644 --- a/tests/Lodur.Core.Tests/PlannerFrustrationTests.cs +++ b/tests/Lodur.Core.Tests/PlannerFrustrationTests.cs @@ -399,7 +399,9 @@ public sealed class PlannerFrustrationTests Assert.Throws(() => Build(Make(retry: bad))); } + Assert.Throws(() => 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)); } }