fix(production): correct full-load capture and solver scaling

Stop capturing the transient miner output damper, apply the sandbox boost state to artificial stars as for launchers, and keep lens-free photon flows when no ray receiver is selected.

Scale the planner conservation check by each ledger row and normalize the simplex right-hand side so large rates no longer fail. Skip non-production objects before copying native settings, decode blueprints through the native paste path, and simplify analyzer mode resolution.

Update stale ProductionCheck expectations, add regression checks, and document the rules.
This commit is contained in:
soarqin committed 2026-10-25 22:01:05 +08:00
1 parent 97f032a5af
commit 51e90a8e1d
13 files changed
+418 -254

No files matched your search

+35 -3
View File
@@ -17,10 +17,14 @@ public sealed class RayReceiverAdapter : IProductionProcessAdapter
{
process = null;
diagnostic = null;
if (building?.Kind != ProductionBuildingKind.RayReceiver)
if (building == null)
return TryEvaluateWithoutReceiver(recipe, mode, operatingParameters, out process, out diagnostic);
if (building.Kind != ProductionBuildingKind.RayReceiver)
{
diagnostic = new ProductionDiagnostic(ProductionDiagnosticCode.MissingBuilding,
"Select a ray receiver to evaluate photon generation.", recipeId: recipe?.Id ?? 0);
diagnostic = new ProductionDiagnostic(ProductionDiagnosticCode.IncompatibleBuilding,
"The selected building cannot receive Dyson-sphere rays.", recipeId: recipe?.Id ?? 0,
buildingItemId: building.ItemId);
return false;
}
@@ -141,6 +145,34 @@ public sealed class RayReceiverAdapter : IProductionProcessAdapter
return true;
}
// Photon output per cycle does not depend on the receiver, but lens wear, speedup, and power do.
private static bool TryEvaluateWithoutReceiver(ProductionRecipe recipe, ProliferationMode mode,
IReadOnlyDictionary<string, double> operatingParameters, out ProductionProcess process,
out ProductionDiagnostic diagnostic)
{
process = null;
diagnostic = null;
if (recipe.Inputs.Count != 0 || recipe.Outputs.Count != 1)
{
diagnostic = new ProductionDiagnostic(ProductionDiagnosticCode.UnsupportedProcess,
"A photon recipe must have one output and no inputs.", recipeId: recipe.Id);
return false;
}
if (mode != ProliferationMode.None ||
operatingParameters != null && operatingParameters.TryGetValue("LensItemId", out var lensId) &&
lensId != 0)
{
diagnostic = new ProductionDiagnostic(ProductionDiagnosticCode.MissingBuilding,
"Select a ray receiver to evaluate lens consumption and speedup.", recipeId: recipe.Id);
return false;
}
process = new ProductionProcess(recipe.Id, 0, ProliferationMode.None, 0,
Array.Empty<KeyValuePair<int, double>>(), recipe.Outputs, 0, 0, false);
return true;
}
private static bool Finite(double value)
{
return !double.IsNaN(value) && !double.IsInfinity(value);