How drotyk/wheat-yield-predictor works
A C++ console application guides the user through selecting wheat variety, soil, fertilizer, region, and seasonal weather, then calculates and displays an estimated yield. main.cpp is the interactive entry point; it loads the JSON-backed options and passes the selections to the predictor. The predictor applies the documented agronomic factors, variety sensitivity and resistance, then clamps the result to the variety’s yield bounds. The README documents these capabilities; the sampled implementation supports the loading, selection, calculation, and display relationships shown here.
Main entry points: ConfigLoader.cpp Config loader · WheatYieldPredictor.cpp Yield predictor · main.cpp Interactive menu · WheatVariety.h Wheat variety
Components 11
Console interaction
- Interactive menu
main.cpp
Configuration
- Config loader
src/ConfigLoader.cpp - Agronomy config
data/config.json
Agronomic inputs
- Wheat variety
cls/WheatVariety.h - Variety bonuses
cls/VarietyBonus.h - Soil type
cls/SoilType.h - Fertilizer effect
cls/FertilizerEffect.h - Agroclimatic region
cls/Region.h - Seasonal weather
cls/WeatherCondition.h
Yield prediction
- Yield predictor
src/WheatYieldPredictor.cpp
Other components
- User
Connections 17
- User → Interactive menu: enters selections
- Interactive menu → Config loader: loads options
- Config loader → Agronomy config: reads JSON
- Config loader → Wheat variety: parses varieties
- Config loader → Soil type: parses soils
- Config loader → Fertilizer effect: parses fertilizers
- Config loader → Agroclimatic region: parses regions
- Config loader → Seasonal weather: parses weather
- Config loader → Variety bonuses: parses bonuses
- Interactive menu → Yield predictor: passes selections
- Yield predictor → Wheat variety: reads yield traits
- Yield predictor → Variety bonuses: reads sensitivities
- Yield predictor → Soil type: reads soil factor
- Yield predictor → Fertilizer effect: reads fertilizer effect
- Yield predictor → Agroclimatic region: reads region factor
- Yield predictor → Seasonal weather: averages impacts
- Yield predictor → Interactive menu: displays prediction