Skip to content

Replace Scenario scaling with iterative factory balancing #147

Description

@ApocDev

Problem

Factory Scenario currently scales cached block boundary rows. A valid producer whose current goal is zero therefore contributes an all-zero row and makes a positive target infeasible. More broadly, users want a direct Balance factory operation rather than an LP tied to the current nonzero projection.

Direction

Model the factory after YAFC-style iterative balancing:

  • keep enabled terminal positive/stock goals pinned as the factory anchors;
  • adjust intermediate positive goals to cover downstream demand;
  • adjust explicit negative goals to absorb available surplus;
  • re-solve each changed block and recompute factory boundary flows;
  • repeat until stable, with tolerance/pass/no-progress guards;
  • treat unsupported ingredients as external imports;
  • probe valid zero-rate producers at a normalized nonzero rate so they can be activated;
  • surface missing producers and non-convergence clearly.

Acceptance criteria

  • Block 34-style zero-rate producers can be activated by factory balancing.
  • Current terminal goals remain unchanged unless the user explicitly overrides them.
  • Intermediate production and negative consumption goals settle across multiple blocks.
  • Apply is one undoable action and does not partially persist failed iterations.
  • Scenario remains a preview, with Balance factory as the primary current-target action.
  • Solver, orchestration, browser, and documentation coverage pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: plannerProduction block / planning modelarea: webWeb UI (React/TanStack/vite-plus)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions