4 Commits

Author SHA1 Message Date
mikhail 1c735b124a refactor: DFS solver → matrix-based linear algebra (MathNet.Numerics)
- Rewrite ProductionSolver: system of linear equations A×x=b via LU/QR decomposition
- Add ResourceClassifier: classify resources as target/intermediate/raw
- Add RecipeMatrixBuilder: build coefficient matrix and RHS vector
- Add DI container (Microsoft.Extensions.DependencyInjection) in CLI
- Fix resource flow calculation (RecipeRate is total, not per-machine)
- Fix recipes.json: moduleCategory → machineCategory (recipe #19)
- Update tests: 30 tests covering solver, classifier, matrix builder
- Update README: document matrix model, architecture, principles
2026-07-02 14:46:14 +03:00
mikhail a8c9808062 fix: resolve 3 critical ProductionSolver bugs
- Bug #1: CalculateExecution now filters product by targetResourceId
  instead of blindly taking .First() — fixes multi-product recipes
- Bug #2: Replace visited HashSet with recipeOutput tracker — allows
  re-processing when demand increases (double targets on same resource)
- Bug #3: Clamp effectiveSpeed to MinEffectiveSpeed (0.05) floor —
  prevents division by zero with heavy productivity module stacks

Also: switch from Stack (DFS) to Queue (BFS) for more predictable
resolution order; add 4 regression tests (24 total, all green)
2026-07-02 13:27:43 +03:00
mikhail 29507813e5 chore: add FactorioCalc.sln to src/ 2026-07-02 13:16:59 +03:00
mikhail eae7c066d1 feat: Factorio Space Age Production Calculator
- Domain: immutable entities (Resource, Recipe, Machine, Module, etc.)
- Data: JSON recipe repository (34 resources, 26 recipes, Space Age)
- Solver: DFS-based production planner with module support
- Reporting: Console, JSON, Excel exporters
- CLI: solve/list commands with Spectre.Console
- Tests: 20 unit tests (xUnit) all passing
- Tech: C# .NET 10, MathNet.Numerics, ClosedXML

Model: GPT-4.1 (OpenAI) — executed by pi coding agent
2026-07-02 13:08:25 +03:00