Skip to content

[Simulation Engine] Add feed only simulation type - #3183

Open
matthew7838 wants to merge 48 commits into
devfrom
feed-only-simulation-2988
Open

matthew7838 wants to merge 48 commits into
devfrom
feed-only-simulation-2988

Conversation

@matthew7838

@matthew7838 matthew7838 commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Adds a feed_only simulation type so the Feed Storage module can run on its own.

Context

Issue(s) closed by this pull request: closes #2988

What

  • New SimulationType.FEED_ONLY ("feed_only") and its daily routine.
  • New optional input: initial feed storage contents, keyed by storage instance name.
  • Storage.stock_initial_contents() and FeedManager.stock_initial_storage_contents().
  • Extracted SimulationEngine._execute_feed_storage_upkeep() out of _execute_feed_planning().
  • New feed_only example scenario, registered in available_simulation_tasks.json.

Why

  • Feed storages only fill from field harvests, so without the crop and soil module they stay empty for the whole run.
  • Storage contents have to come from somewhere: this states them as an initial condition instead of inventing harvests.
  • Feed planning is gated on a harvest schedule, so degradations would never run in a simulation with no harvests.

How

  • Initial contents are stocked once at setup, through Storage.receive_crop, so capacity checks and grain / high moisture arrival losses still apply.
  • Daily routine is storage upkeep (report levels, process degradations) then record keeping.
  • Feed planning is not called: with no animals, ideal_feeds_to_purchase is always empty, so the purchasing path is a no-op.
  • Stocking runs for every feed simulating type and is opt-in by input presence, so existing scenarios are unaffected.

Test plan

  • Unit tests pass. New tests for Storage.stock_initial_contents, FeedManager.stock_initial_storage_contents, _gather_initial_feed_storage_contents, and the feed only daily routine.
  • All 4 e2e scenarios pass every domain, confirming the upkeep extraction changed no existing output.

Input Changes

  • Added input/data/feed_management/example_feed_only_initial_contents.json.
  • Added input/data/config/example_feed_only_config.json, input/metadata/example_feed_only_metadata.json, input/data/tasks/example_feed_only_task.json.
  • Added initial_feed_storage_contents_properties and feed_only to the simulation_type pattern in default.json.
  • Added a feed_only entry to available_simulation_tasks.json.

Output Changes

  • N/A for existing simulation types. The new feed_only scenario reports existing feed storage variables only.

Filter

Notes for reviewers

  • Only the storage half of the module runs: with no animals and no purchases, FeedManager's feeding, purchasing, and inventory projection paths are never reached.
  • Optional inputs have to be separate metadata blobs. An optional nested object inside the existing storage configs fails validation, since objects are not fixable and cannot be nullable.

matthew7838 and others added 3 commits July 31, 2026 16:26
Adds a `feed_only` SimulationType that runs the Feed Storage module
without the crop and soil, animal, or manure modules.

Feed storages are given their starting contents through a new optional
initial feed storage contents input, since there is no crop and soil
module to harvest anything into them. Contents are stocked through
`Storage.receive_crop`, so capacity checks and arrival losses apply.

Extracts `_execute_feed_storage_upkeep` from `_execute_feed_planning` so
storage reporting and degradations can run on days that feed planning
does not. Call order is unchanged for existing simulation types.
@github-actions
github-actions Bot force-pushed the feed-only-simulation-2988 branch from 97575fc to 2ee5011 Compare July 31, 2026 07:28
@github-actions
github-actions Bot force-pushed the feed-only-simulation-2988 branch from 2ee5011 to 350c9b5 Compare July 31, 2026 07:29
@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: %

Mypy errors on feed-only-simulation-2988 branch: 1139
Mypy errors on dev branch: 1135
4 more errors on feed-only-simulation-2988 branch

@github-actions

Copy link
Copy Markdown
Contributor

🚨 Some tests have failed.

@matthew7838
matthew7838 marked this pull request as draft July 31, 2026 08:03
@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on feed-only-simulation-2988 branch: 1139
Mypy errors on dev branch: 1135
4 more errors on feed-only-simulation-2988 branch

@matthew7838
matthew7838 force-pushed the feed-only-simulation-2988 branch from dcc4040 to 77806d6 Compare July 31, 2026 14:34
@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on feed-only-simulation-2988 branch: 1139
Mypy errors on dev branch: 1135
4 more errors on feed-only-simulation-2988 branch

@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on feed-only-simulation-2988 branch: 1138
Mypy errors on dev branch: 1134
4 more errors on feed-only-simulation-2988 branch

@matthew7838
matthew7838 marked this pull request as ready for review August 14, 2026 05:50
@matthew7838 matthew7838 changed the title Add feed only simulation type [Simulation Engine] Add feed only simulation type Aug 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on feed-only-simulation-2988 branch: 1138
Mypy errors on dev branch: 1134
4 more errors on feed-only-simulation-2988 branch

@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on feed-only-simulation-2988 branch: 1137
Mypy errors on dev branch: 1133
4 more errors on feed-only-simulation-2988 branch

@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on feed-only-simulation-2988 branch: 1133
Mypy errors on dev branch: 1133
No difference in error counts

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on feed-only-simulation-2988 branch: 1164
Mypy errors on dev branch: 1164
No difference in error counts

@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on feed-only-simulation-2988 branch: 1164
Mypy errors on dev branch: 1164
No difference in error counts

@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on feed-only-simulation-2988 branch: 1164
Mypy errors on dev branch: 1164
No difference in error counts

matthew7838 and others added 4 commits September 16, 2026 13:53
Resolves conflicts with the manure only simulation, which added a
SimulationType alongside this branch's. Both simulation types are kept:
the enum members, the daily simulation function map, the daily routines,
the simulation_type pattern, the example task entries, and the tests all
carry manure_only and feed_only.
@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on feed-only-simulation-2988 branch: 1164
Mypy errors on dev branch: 1164
No difference in error counts

@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on feed-only-simulation-2988 branch: 1164
Mypy errors on dev branch: 1164
No difference in error counts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SimulationEngine][FeedManager] Create FeedManager only simulation

1 participant