Skip to content

Add feed only simulation type - #3183

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

Add feed only simulation type#3183
matthew7838 wants to merge 8 commits into
devfrom
feed-only-simulation-2988

Conversation

@matthew7838

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

  • 7109 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.
  • All 6 example scenarios run with 0 errors, including the new feed_only.
  • 7 year feed_only run: 445,000 kg DM stocked, 322,684 kg DM remaining (27.5% loss; alfalfa silage 51.6%, corn silage 30.8%, hay 17.7%, dry grain 1.0%).

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. Measured feed module coverage in a feed_only run is 67% (storage.py 87%, silage.py 87%, hay.py 87%, feed_manager.py 37%). Whether that is enough for "FeedManager only" is worth a look before merge.
  • 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

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