This research proposes a new framework for agri-food capacity production by considering resiliency and robustness and paying attention to disruption and risk for the first time. It is applied robust stochastic optimization by adding robustness to the constraint's objective function and resiliency situation. This research minimizes the mean absolute deviation and coefficient of standard deviation errors by linear function in the agri-food capacity production. This study suggests agri-food managers and decision-makers use this mathematical method to forecast and improve production management. The results of this research lead to better decision-making and are compared with other sine functions. The main model's Robust and Resiliency Mean Absolute Deviation (RRMAD) value is 1.28% lower than other sine-type functions. The conservativity coefficient, confidence level, weight factor, resiliency coefficient, and probability of the scenario vary. The main model's RRMAD value is 1.28% lower than other sine-type functions. Growing the weight factor will result in an increase in RRMAD and a smooth decline in R-squared. Additionally, as the resilience coefficient rises, the RRMAD function increases while the R-squared declines. By altering the probability of the scenario, the RRMAD function drops, and the R-squared goes up.