# Optimization Model for Selective Harvest Planning Performed by Humans and Robots
## 3 Problem Description and Formulation
### Model Formulation  
**Inputs**  
\(n\)**--number of periods  
\(m\)**--number of maturity levels  
\(d\)**--number of days after anthesis  
\(d_{start}\)**--min days after anthesis of maturity level \(j\)  
\(d_{jend}\)**--max days after anthesis of maturity level \(j\)  
\(y_{d,1}\)**--number of peppers \(d\)\(DAA\) available to harvest in the first period  
\(I_{0}\)**--number of peppers at anthesis each day  
\(C_{h}\)**--harvester capablities in one period  
\(p\)**--price per kilogram of pepper fresh weight  
\(W(d)\)**--fresh weight (kilogram) of pepper \(d\) days after anthesis  
\(S\)**--harvester's salary/rental cost through all planning horizons  
\(F\)**--total fixed expenses through all of planning horizons, including utilities, land, water, fertilization, planting, and taxes  
**Variables**  
\(N\)**--number of harvesters (hired workers or equivalent numbers of robots see Section 5.2.2) (_decision variable_)  
\(H_{j,t}\)**--peppers harvested from maturity class \(j\) in period \(t\) (_decision variable_)  
\(THW_{t}\)**--total harvest weight of the peppers in period \(t\) (fresh weight in kilograms)  
\(A_{j,t}\)**--peppers from class \(j\) available to harvest at the beginning of period \(t\)  
\(P_{d,t}\)**--peppers \(d\) days after anthesis that are harvested in period \(t\)  
\(Y_{d,t}\)**--peppers available to harvest \(d\) days after anthesis at the beginning of period \(t\)  
The farmer has two decisions to make: _the number of harvesters to use_ for the harvest season (\(N\)), and _the number of peppers to harvest from each maturity class at each period (\(H_{j,t}\))_. Since we are dealing with _selective harvesting_, the number of harvesters is calculated as the number of workers or the equivalent-performing robotic harvesters (see Section 5.2). The harvest season is \(n\) periods long, and the harvesters can distinguish between peppers in \(m\) maturity classes. The objective function represents the profit to the farmer and includes the following components: income from the harvested peppers (calculated as the fresh weight of the harvested peppers (\(THW_{t}\)) multiplied by the price per kilogram (\(p\))); variable expenses (calculated as the number of harvesters (\(N\)) multiplied by the workers' salaries or the robots' rental cost (\(S\)) through all planning horizons); the total fixed expenses (\(F\)) through all planning horizons (calculated by summing expenses due to utilities, land, water etc. ):  
\[Max\ Z=p\times\sum_{t=1}^{n}THW_{t}-N\times S-F \tag{2}\]  
subject to: (the constraints are explained one by one below):  
\[Y_{1,t}=I_{0}\hskip 28.452756 pt\forall t=2\ldots n \tag{3}\]  
\[Y_{d,t}=Y_{d-1,t-1}-P_{d-1,t-1}\hskip 28.452756 pt\forall t=2\ldots n,\ d=2\ldots d _{m} \tag{4}\]  
\[Y_{d,t}\geq\ P_{d,t}\hskip 28.452756 pt\forall t=1\ldots n,\ d=1\ldots d_{m} \tag{5}\]  
\[H_{j,t}=\sum_{d=distant}^{d\text{\it{j}end}}P_{d,t}\forall t=1\ldots n,\ j=1 \ldots m \tag{6}\]  
\[A_{j,t}=\sum_{d=distant}^{d\text{\it{j}end}}Y_{d,t}\forall t=1\ldots n,\ j=1 \ldots m \tag{7}\]  
\[A_{j,t}\geq\ H_{j,t}\forall t=1\ldots n,\ j=1\ldots m \tag{8}\]  
\[\sum_{j=1}^{m}H_{j,t}\ \leq\ \ N\cdot C_{t}\forall t=1\ldots n \tag{9}\]  
\[THW_{t}=\sum_{d=1}^{dm}(W(d)\times P_{d,t})\forall t=1\ldots n \tag{10}\]  
Equations (3)-(5) define the mechanism of pepper growth in the greenhouse using the variables \(Y_{d,t}\) and \(P_{d,t}\). The number of available peppers \(d\) DAA at the beginning of the planning horizon (\(Y_{d,1}\)) is given. Since the actual \(d\) of a pepper is unknown to the workers, the decision is made based on the maturity classes (\(A_{j,t}\) and \(H_{j,t}\)), as described above. The composition of each maturity class is obtained from Equations (6) and (7). In addition, the number of peppers harvested from each maturity class is limited by the peppers available, seen in Equation (8), and the maximal number of peppers harvested is determined by the number of harvesters in Equation (9). The actual harvest weight (\(THW\)) is determined via the harvested pepper's d, as in Equation (10).